Hi,
I work on a code that requires repeated writing/reading of (gigabyte scale) data to disc during runtime. This is implemented with asynchronous operations (like demonstarted in the simplified code below). The code runs fine and gives correct data when nlop is 20. If nlop is bigger(for example 30) the code crashes. It is not obvious to me why - it would be nice if you could have a look at it. I tried with pgfortran, version 18.4 and 19.3.
program async_test
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
implicit none
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
integer, parameter :: nmax = 10000000
integer, parameter :: nlop = 30 ! working if nlop is 20
logical, parameter :: lwai = .true.
real, dimension(-2:nmax+2) :: eps,del
integer i, id1, id2, record_length
logical first
first=.true.
! record_length = nmax * 1 ! record length in multiples of 4 bytes
record_length = nmax * 4 ! record length in multiples of single bytes
!!!! writing data !!!!
open(120,file='testpgi.dat',access='direct',asynchronous='yes',recl=record_length)
do i = 1,nlop
write(*,*) "i,id1,id2=",i,id1,id2
! skip wait for the first write
if (first) then
first=.false.
else
wait(120,id=id1)
wait(120,id=id2)
endif ! first
! write eps
eps=real(i)
write(120,asynchronous='yes',id=id1,rec=2*i-1) eps(1:nmax)
! write del
del=real(-i)
write(120,asynchronous='yes',id=id2,rec=2*i) del(1:nmax)
enddo ! i
if (lwai) then
wait(120,id=id1)
wait(120,id=id2)
endif ! lwai
close(120)
!!!! reading data !!!!
open(120,file='testpgi.dat',access='direct',recl=record_length)
do i = 1,nlop
read(120,rec=2*i-1) eps(1:nmax)
read(120,rec=2*i) del(1:nmax)
! check first and last value
print*,i,eps(1),eps(nmax),del(1),del(nmax)
enddo ! i
close(120)
end program async_test