Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

Use of Associate

abhimodak
New Contributor I
1,166 Views
Hi

Is there something about the associate in OpenMP? The program below gives internal compiler error with update 5 in VS2010.

Abhi

======

[fortran]         Program Test_OpenMPAssociate

            Implicit None

            Type newObject
               Integer :: m = 0
            End Type newObject

            Type(newObject), Allocatable :: OBJ(:)
            Integer, Allocatable :: J(:)

            Integer :: N
            Integer :: i
            Integer :: iError

            N = 20
            Allocate(OBJ(N), J(N), stat=iError)

            !$OMP PARALLEL DO
            do i=1,N
               Associate(m => OBJ%m)
                  J(i) = m(i)
               End Associate
            end do
            !$OMP END PARALLEL DO

            do i=1,N
               print *, J(i)
            end do

         End Program Test_OpenMPAssociate

[/fortran]
0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,166 Views
Internal compiler error is almost always a compiler bug. It is here. I will report this to the developers. Issue ID is DPD200172236.

I found that if you move the ASSOCIATE construct to outside the parallel region, it works. But.. What do you think this program does? You never give a value (other than 0) to the various OBJ%m components.
0 Kudos
abhimodak
New Contributor I
1,166 Views

I should have mentioned that the above program was just for the illustration purpose. My apologies. But you can easily see its usage in general cases of associate inside a loop, for example, instead of the object suppose there was obj%subobject%sub-subobject etc..

Abhi

0 Kudos
Steven_L_Intel1
Employee
1,166 Views
That's fine - the compiler should never get an internal compiler error, even for a program that doesn't do anything useful. Yes, ASSOCIATE in a parallel region should work.
0 Kudos
Steven_L_Intel1
Employee
1,166 Views
This has been fixed in our sources. I don't yet know when the fix will be available - I'll provide an update when I do.
0 Kudos
Reply