This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,831 Users
  • 2,269,775 Discussions
  • 7,916,823 Comments

Discussions

Bogus error with "omp atomic" in a Fortran program

j4nu5
j4nu5 Member Posts: 5

Hi all,

I am seeing some strange behavior of the Oracle Fortran compiler (12.5 and 12.6 beta) with the following code:

module m

   type :: nodeType

      real :: ohhMin, ohhMax

      integer :: cntPart

   end type

contains

   subroutine sub(node, ohh)

      type(nodeType), pointer :: node

      real, intent(in) :: ohh

!$omp atomic

      node%cntPart = node%cntPart + 1

!$omp atomic

      node%ohhMin = min(ohh, node%ohhMin)

   end subroutine

end module

Compiling this with -xopenmp gives me:

  node%ohhMin = min(ohh, node%ohhMin)
              ^                 

"omp_atomic.f90", Line = 17, Column = 19: ERROR: This atomic access has a different type from another that accesses the same memory location.

I'm pretty sure this is a compiler bug. Right? The error goes away if I pull the variables that are being set in the atomic statements out of the derived type and make them stand-alone variables. They're certainly not accessing the same location!

Would be great if this could be fixed for the final 12.6 release of Developer Studio.

Best regards,

Janus

Comments

This discussion has been closed.