On 7/19/25 23:26, Thomas Koenig wrote:
I wrote:
I have grave concerns.
At the last (to me an Nicolas) known state, before he was ousted
from the project, there were known race conditions, which can
cause freezing and/or data corruption.
I believe these have not been addressed, neither tested nor by
inspection.
Maybe a word of explanation.
What I would like to see are tests like
program memain
integer :: i,j
do j=0,5 ! To be adjusted
do i=1,10**j
sync all
end do
print *,"Finished 10**", j
end do
end program
run on a few hundred cores in parallel.
Or counting (again, untested):
program memain
use, interinsic :: iso_fortran_env, only : lock_type
type(lock_type), codimension[*] :: lck
integer, codimension(*) :: count
integer :: i, j, s
do j=0,5 ! To be adjusted, dunno how long this runs
if (this_image() == 1) count = 0
sync all
do i=1,10**j
lock (lck[1])
count[1] = count[1] + 1
unlock (lck[1])
end do
sync all
if (this_image() == 1) then
print *,"Expected: ",10**j*num_images(), "Found: ", count
end if
sync all
end do
end program
plus similar torture cases for SYNC IMAGES, CRITICAL and END CRITICAL,
allocatable coarrays etc.
If this testing is not done (and resulting bugs fixed), there is an
extremely high chance that race conditions and other problems
such as memory leaks are introduced.
Thanks for these example test programs.
For giving these a start, I ran them with the gfortran release 14 and
the related OpenCoarrays library + OpenMPI as installed on my Debian
Testing system (last updated on 7th of July 2025).
[ Note: "interinsic -> intrinsic" and "integer, codimension(*) :: count"
-> "integer, codimension[*] :: count", in the second program. ]
$ gfortran -fcoarray=lib syncall.f90 -lcaf_openmpi
$ mpirun -np 16 --mca btl self,vader ./a.out
Finished 10** 0
Finished 10** 1
...
Finished 10** 5
Finished 10** 5
$ gfortran -fcoarray=lib locks.f90 -lcaf_openmpi
$ mpirun -np 16 --mca btl self,vader ./a.out
Expected: 16 Found: 16
Expected: 160 Found: 160
Expected: 1600 Found: 1600
Expected: 16000 Found: 16000
Expected: 160000 Found: 160000
Expected: 1600000 Found: 1600000
$
So that seems to work.
Kind regards,
--
Toon Moene - e-mail: t...@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands