- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear All,
I'm learning OpenMP. I wrote a basic program (attached below), to display threads number. As I have a Core 2 Duo, I was expecting to see in the output window.
Thread number : , 1
Thread number : , 2
But I can se only
Thread number : , 1
It means that my application can see only one thread! Do someone no why? Of course I have use /Qparallel mode
Best regards,
Didace
program test_parallel
use omp_lib
!$OMP PARALLEL DEFAULT(SHARED)
write(*,*)
write(*,'(17h Thread number : ,i1)') 1 + OMP_GET_THREAD_NUM()
write(*,*)
!$OMP END PARALLEL
end program test_parallel
I'm learning OpenMP. I wrote a basic program (attached below), to display threads number. As I have a Core 2 Duo, I was expecting to see in the output window.
Thread number : , 1
Thread number : , 2
But I can se only
Thread number : , 1
It means that my application can see only one thread! Do someone no why? Of course I have use /Qparallel mode
Best regards,
Didace
program test_parallel
use omp_lib
!$OMP PARALLEL DEFAULT(SHARED)
write(*,*)
write(*,'(17h Thread number : ,i1)') 1 + OMP_GET_THREAD_NUM()
write(*,*)
!$OMP END PARALLEL
end program test_parallel
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - ekeom
It means that my application can see only one thread! Do someone no why? Of course I have use /Qparallel mode
Hi!
To me, your program looks OK. The problem should be the /Qparallel switch you've used to compile your code. /Qparallel only enables parallel code generation, but not OpenMP compilation. You should use /Qopenmp to turn on OpenMP support. Then, your code should print the expected results.
Cheers,
-michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Michael Klemm, Intel
Hi!
To me, your program looks OK. The problem should be the /Qparallel switch you've used to compile your code. /Qparallel only enables parallel code generation, but not OpenMP compilation. You should use /Qopenmp to turn on OpenMP support. Then, your code should print the expected results.
Cheers,
-michael
Thank you for your answer. You are propbably right, I have a quick look on the on line help. Yes I should use /Qopenmp. But I don't know where I can find it, with Visual Studio graphical inteface.
Best regards,
Didace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Michael Klemm, Intel
Hi!
To me, your program looks OK. The problem should be the /Qparallel switch you've used to compile your code. /Qparallel only enables parallel code generation, but not OpenMP compilation. You should use /Qopenmp to turn on OpenMP support. Then, your code should print the expected results.
Cheers,
-michael
It me again. I have found how to active /Qopenmp.
Best regrads,
Didace

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