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

Problem with the lock/unlock statement in the main program unit

FlyingHermes
New Contributor I
348 Views

 

 

dssd

Here is an small code which causes a problem when the lock/unlock statements are called from the main program unit.

! ifort -coarray main.f90; ./a.out

Module MyLock_Module
  use ISO_Fortran_Env ,only: Lock_Type
  implicit none
  type(Lock_Type) :: MyLock
  • contains Subroutine Lock_It() lock(MyLock) unlock(MyLock) End Subroutine End Module Program Main use MyLock_Module implicit none call Lock_It ! lock(MyLock) ! These two lines ... ! unlock(MyLock) ! ... cause a problem End Program
  • If the two line with the "lock" and "unlock" statement are uncommented, then this code fails to compile with the following output

    $ ifort -coarray main.f90; ./a.out
    /tmp/ifort45kohb.o: In function `CI0001$main_$BLK':
    main.f90:(.text+0x16d): undefined reference to `.st_mylock_module_mp_mylock_$2_V$82'
    

    using

    $ ifort -v
    ifort version 14.0.3

    Thanks

    0 Kudos
    1 Reply
    Lorri_M_Intel
    Employee
    348 Views

    Interesting.  I was able to reproduce this with 14.0, but not with 15.0; however I don't see any place we explicitly fixed a problem like this.

    So, I'm going to add this little test to our regression suite just to make sure it stays working.

             Thank you for the small example -

                           --Lorri

     

    0 Kudos
    Reply