Fortran asynchronous IO access direct


I am trying to use asynchronous IO to overlap GPU computations and file writing without success at the moment.

So I create a small example to perform asynchronous write that also crashes.

Here the code

program io
  implicit none
  character(len=256) :: message
  integer(kind=2)    :: stat = 0
  integer            :: i
  real               :: a, b, c
  integer            :: id
  real, dimension(1024*1024) :: tab

  namelist /var/i, a, b, c

  open( UNIT=1,              &
        FILE="",   &
        ACCESS="direct", &
        ASYNCHRONOUS="yes", recl=4*1024*1024 )

    call random_number( tab )
    write( UNIT=1, rec=1, ASYNCHRONOUS="yes", ID=id) tab
    print *, "I am waiting"
    WAIT( UNIT=1,ID=id )

    write( UNIT=1, rec=2, ASYNCHRONOUS="yes", ID=id) tab
    print *, "I am waiting"
    WAIT( UNIT=1, ID=id )

  close( UNIT=1 )

end program io

It returns the following

PGFIO-F-255/unformatted write/unit=1/illegal asynchronous I/O operation.
File name = unformatted, direct access record = 1
In source file test_io.f90, at line number 19

Do you have any explanations on this error code ?

Thank you

It looks like a bug. The program runs fine with intel and gfortran,
so I think we have a problem.

This problem has been logged as TPR 22524.


The TPR 22524 - Fortran asynchronous I/O example ‘illegal asynchronous I/O operation’

has been corrected with the current 16.5 release.