I wish to use the OpenMP in gfortran. Gnu fortran is integrated in CodeBlocks IDE editor, I set the required linker directive(-fopenmp) in order to be able to use the features of parallelism but simple code snippet below returns the unintelligible results for number of process running. It seems that there is not any initialization difficulties since there is no complain from compiler during compilation time, otherwise compiler would raise unknown functions/procedures for all the calling.
What am I doing wrong here?
- Code: Select all
threads = omp_get_num_procs();
id = omp_get_thread_num()
write(*,*)'In parallel region (T)? ', omp_get_max_threads()
write(*,*)'Threads allocated : ', OMP_get_num_procs()
!$OMP PARALLEL END