- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a large project I'm attempting to partially parallelize. I have the following settings on the project property pages:
debug: environment: OMP_NUM_THREADS=8
fortran: language: process OpenMP directives: Generate Parallel Code (/Qopenmp)
fortran: runtime library: debug multithreaded
The below subroutine should print the thread id from 0 to 5, but instead it prints. Why?
F 6
# threads: 1
hello from thread: 0
subroutine clauses
USE OMP_LIB
implicit none
call omp_set_num_threads(6)
PRINT *, OMP_IN_PARALLEL(), OMP_GET_MAX_THREADS()
!$OMP PARALLEL
print *, "# threads:", OMP_GET_NUM_THREADS()
print *, 'hello from thread:', OMP_GET_THREAD_NUM()
!$OMP END PARALLEL
end subroutine clauses
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have a solution with multiple projects, you have enable the same project properties as those for the startup. I only had it only for the startup and it didn't work for those files in another project.
All fixed now.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jim,
I am not. Language -> Process OpenMP Directives, which I already set to Generate Parallel Code (/Qopenmp). Setting it to Generate Sequential Code (/Qopenmp-stubs) results in:
F 1
# threads: 1
hello from thread: 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have a solution with multiple projects, you have enable the same project properties as those for the startup. I only had it only for the startup and it didn't work for those files in another project.
All fixed now.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page