Quantcast
Channel: Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2583

Allocatable array in OpenMP

$
0
0

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)


Viewing all articles
Browse latest Browse all 2583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>