- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
My problem is that the openmp routine, 'omp_get_thread_num()' yields wrong result.
I'm using ifl 7.1 on windows server 2003.
I set the enviroment variable, OMP_NUM_THREADS to 8, and then ran the following openmp program.
program hello
integer num
write(6, *) "hello parallel world from threads ! "
!$omp parallel
num=omp_get_thread_num()
write(6, *) 'omp_num: ',num
!$omp end parallel
end
Starting the program above, I saw the following.
hello parallel world from threads !
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
The routine, 'omp_get_thread_num()' yield wrong result. In other words, the integer variable, 'num' must lie between 0 and 7.
Any ideas what the problem can be?
Thanks
My problem is that the openmp routine, 'omp_get_thread_num()' yields wrong result.
I'm using ifl 7.1 on windows server 2003.
I set the enviroment variable, OMP_NUM_THREADS to 8, and then ran the following openmp program.
program hello
integer num
write(6, *) "hello parallel world from threads ! "
!$omp parallel
num=omp_get_thread_num()
write(6, *) 'omp_num: ',num
!$omp end parallel
end
Starting the program above, I saw the following.
hello parallel world from threads !
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
omp_num: -2147483648
The routine, 'omp_get_thread_num()' yield wrong result. In other words, the integer variable, 'num' must lie between 0 and 7.
Any ideas what the problem can be?
Thanks
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You didn't INCLUDE the OpenMP definitions file, so the routine is implicitly REAL.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks steve.
You're right.
I've forgot typing 'use omp_lib' .
Changhee
You're right.
I've forgot typing 'use omp_lib' .
Changhee

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page