Hi trav9,
The problem is that you are "applying" an OMP PARALLEL DO to something that is not a DO if you uncomment the line
!nthreads = omp_get_num_threads() ! get number of threads
Instead, I'd use
- Code: Select all
!$OMP PARALLEL PRIVATE(id, nthreads, p, d, j, i)
nthreads = omp_get_num_threads() ! get number of threads
p = OMP_IN_PARALLEL()
d = OMP_GET_DYNAMIC()
id = omp_get_thread_num() ! get thread
!$OMP DO SCHEDULE(DYNAMIC)
do j = 0,100,2
...
Note, however, that I've added j, i to the list of private variables, but that may be not necessary.
I'm curious: does the code compile otherwise? I've uncommented the first assignment and the compiler identifies the problem:
$ gfortran -fopenmp test.f90 -o test
test.f90:20.66:
nthreads = omp_get_num_threads() ! get number of threads
1
Error: Unexpected assignment statement at (1)
HTH,
Fernando.