- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I tried to generate below OpenMP code
INTEGER, ALLOCATABLE :: A(:)
....
C$OMP PARALLEL DEFAULT(SHARED)
C$OMP DO private(A)
do i =1,n
ALLOCATE((A(k)) // k - variable from do-loop procedure
......
However, error encountered while attempting to allocate a data object.
As I know, this bug was fixed by former patch. But I'm unable to update. (ifort - 11.1.052)
So I tried to next
INTEGER, pointer :: A(:)
....
C$OMP PARALLEL DEFAULT(SHARED)
C$OMP DO private(A)
do i =1,n
nullify(A)
ALLOCATE((A(k)) // k - variable from do-loop procedure
......
But this generates incorrect values.
What should I do? (Array size should gain from inter do-loop)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you were using a recent compiler, I'd suggest filing a problem report with an actual test case, if you can get access via premier.intel.com. If there is a bug in a compiler which is no longer on support, you don't have much choice beyond finding a work-around or upgrading to a newer compiler which can run your case (which we won't know without an actual example).
A possible work-around might be to put the allocate in a separate procedure, and make that procedure thread safe by declaring it with RECURSIVE or by setting -auto or equivalent (not -openmp).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In first example try: change private(A) to firstprivate(A).
In second example try, move nullify(A) to out of parallel region, change private(A) to firstprivate(A).
If all else fails, enclose the contents of the parallel region into a subroutine, then call the subroutine from the parallel region.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page