Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bogus error with "omp atomic" in a Fortran program

j4nu5May 22 2017 — edited Jul 5 2017

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
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 2 2017
Added on May 22 2017
4 comments
459 views