- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm a new user of OpenMP and have run into a problem. I'm using the Intel Fortran for Linux l_fce_8.1.029 on Fedora Core 4 SMP 64 bit on a new Dell dual-core em64t. The omp_get_thread_num() returns 0 in all threads.
program omptest
print *, "Hello parallel world from threads:"
call omp_set_num_threads(2)
print '(I6)', omp_get_num_threads()
print *
!$omp parallel
print '(I6)', omp_get_thread_num()
!$omp end parallel
print *, "Back to the sequential world."
end
omptest : omptest.o
ifort -openmp -o omptest omptest.o
omptest.o : omptest.f90
ifort -openmp -c omptest.f90
[root@sc430-1 test]# make
ifort -openmp -c omptest.f90
ifort: Command line warning: openmp requires C style preprocessing; using fpp to preprocess
omptest.f90(6) : (col. 6) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
ifort -openmp -o omptest omptest.o
[root@sc430-1 test]# ./omptest
Hello parallel world from threads:
0
0
0
Back to the sequential world.
I even tried to set the number of thread with the call omp_set_num_threads() but get the same results.
Interesting thing is that 2 threads are started for the number of processors but the thread number is always 0.
Thanks.
program omptest
print *, "Hello parallel world from threads:"
call omp_set_num_threads(2)
print '(I6)', omp_get_num_threads()
print *
!$omp parallel
print '(I6)', omp_get_thread_num()
!$omp end parallel
print *, "Back to the sequential world."
end
omptest : omptest.o
ifort -openmp -o omptest omptest.o
omptest.o : omptest.f90
ifort -openmp -c omptest.f90
[root@sc430-1 test]# make
ifort -openmp -c omptest.f90
ifort: Command line warning: openmp requires C style preprocessing; using fpp to preprocess
omptest.f90(6) : (col. 6) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
ifort -openmp -o omptest omptest.o
[root@sc430-1 test]# ./omptest
Hello parallel world from threads:
0
0
0
Back to the sequential world.
I even tried to set the number of thread with the call omp_set_num_threads() but get the same results.
Interesting thing is that 2 threads are started for the number of processors but the thread number is always 0.
Thanks.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh well, never mind. I made 32 bit integer explicit function declarations for the omp functions and everything works fine.
Thanks.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe I'm the only one that didn't know this..
include 'omp_lib.h'

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