Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

OpenMP & Shared derived array

criswu
Novice
451 Views
       type :: zmplx2d
         complex*16,pointer:: val1(:,:),val2(:,:)
       end type

      type(zmplx2d),dimension(:),allocatable:: acamats


       !$omp parallel do private(ilo,jlo,snedges,fnedges,
     &    ies,ief) shared(acamats)
     &   schedule(guided)
       do j = Levindx(i), Levindx(i+1)-1
        ilo = edgeips(2,j)
        jlo = edgeips(1,j)
        snedges = igall(jlo+1)-igall(jlo)
        fnedges = igall(ilo+1)-igall(ilo)
        ies = igall(jlo)
        ief = igall(ilo)

        call farboxInteraction2(snedges,fnedges,acacomps(j),
     &       acamats(j)%val1,
     &       acamats(j)%val2,ztmp1(ief),ztmp2(ies))

       enddo 

I want to parallelize the do-loop using OpenMP.   the result of the codes is not correct.  It seems OpenMP don't support derived types.

Anyone knows why and how to solve this problem ? 

 

0 Kudos
1 Solution
criswu
Novice
451 Views

ztmp2 is the output of subroutine farboxinteraction2 ,so i have to perfect the variable ztmp2 

add clause reduction(:+ ztmp2) in OpenMP constructs would solve the problem 

View solution in original post

0 Kudos
2 Replies
criswu
Novice
451 Views

It seems not the problem of derived type array . 

i replaced the derived type by a complex array, the problem remains. 

0 Kudos
criswu
Novice
452 Views

ztmp2 is the output of subroutine farboxinteraction2 ,so i have to perfect the variable ztmp2 

add clause reduction(:+ ztmp2) in OpenMP constructs would solve the problem 

0 Kudos
Reply