- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm having some problem with an openmpparallel region in my code.When the data scope is explicily specified, the code works fine. However, when I use the default data scoping, the code doesn't give correct results. Is there a way to check the default data scoping? Thanks.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - xman.hawkeye
I'm having some problem with an openmpparallel region in my code.When the data scope is explicily specified, the code works fine. However, when I use the default data scoping, the code doesn't give correct results. Is there a way to check the default data scoping? Thanks.
!$omp parallel
it must be closed by
!$omp end parallel
but when you have the common combination
!$omp parallel do
the parallel scope ends automatically at end do. Many others require an explicit end parallel in Fortran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You might try the Source Verifier (Source Checker in 11.1) feature. It is likely to produce a lot of noise, but it does claim to detect certain OpenMP usage errors. Please read about it in the documentation - it's not just "throw a switch".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
I don't know of such a thing. However, when you have
!$omp parallel
it must be closed by
!$omp end parallel
but when you have the common combination
!$omp parallel do
the parallel scope ends automatically at end do. Many others require an explicit end parallel in Fortran.
!$omp parallel
it must be closed by
!$omp end parallel
but when you have the common combination
!$omp parallel do
the parallel scope ends automatically at end do. Many others require an explicit end parallel in Fortran.
!$OMP PARALLEL
!$OMP SECTIONS
C... DO SOMETHING
!$OMP SECTION
C... DO SOMETHING ELSE
!$OMP END SECTIONS
!$OMP END PARALLEL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you set default(none), the compiler will report error on any data used in the parallel region which haven't been designated as shared or some variety of private.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
If you set default(none), the compiler will report error on any data used in the parallel region which haven't been designated as shared or some variety of private.
Tim18, thanks for the suggestion. Yes, it is much safer to use default(none).
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