On 7/22/25 17:22, Iain Sandoe wrote:

Hi Andre


2. If I try linking a trivial Fortran code thus:

gfortran /src-local/test/fortran/hello.f90 -o h -lcaf_shmem -fcoarray=lib

the exe then hangs - it looks like it might be deadlocked in startup code:

Call graph:
     2166 Thread_408707810   DispatchQueue_1: com.apple.main-thread  (serial)
     + 990 _pthread_cond_wait  (in libsystem_pthread.dylib) + 152  
[0x7ff818e29626]
     + ! 749 ???  (in <unknown binary>)  [0x7ff8a93092f0]
     + ! 127 _pthread_cond_wait  (in libsystem_pthread.dylib) + 147  
[0x7ff818e29621]
     + ! 114 pthread_testcancel  (in libsystem_pthread.dylib) + 1  
[0x7ff818e2697f]
     + 630 _pthread_cond_wait  (in libsystem_pthread.dylib) + 97,139,...  
[0x7ff818e295ef,0x7ff818e29619,...]
     + 537 counter_barrier_wait  (in h) + 67  [0x1044a8a93]  
counter_barrier.c:71
     + ! 271 DYLD-STUB$$pthread_cond_wait  (in h) + 0  [0x1044aa8e6]
     + ! 154 counter_barrier_wait  (in h) + 62  [0x1044a8a8e]  
counter_barrier.c:71
     + ! 112 _pthread_cond_wait  (in libsystem_pthread.dylib) + 1418,0  
[0x7ff818e29b18,0x7ff818e2958e]
     + 9 _gfortran_caf_init  (in h) + 47  [0x1044a52ff]  shmem.c:91
     +   9 counter_barrier_wait  (in h) + 48  [0x1044a8a80]  
counter_barrier.c:70
     2166 Thread_408707823: com.apple.rosetta.exceptionserver
       2166 ???  (in runtime)  load address 0x7ff7fff8b000 + 0x13e58  
[0x7ff7fff9ee58]
         2166 ???  (in runtime)  load address 0x7ff7fff8b000 + 0x123e0  
[0x7ff7fff9d3e0]
           2166 ???  (in runtime)  load address 0x7ff7fff8b000 + 0x4944  
[0x7ff7fff8f944]

Using my build [Debian Testing on x86_64)] of the branch provided by Jerry (see https://gcc.gnu.org/pipermail/gcc-testresults/2025-July/853295.html) I got the following:

I used Thomas's "sync all" code as an example (see https://gcc.gnu.org/pipermail/fortran/2025-July/062550.html).

$ ~/compilers/install/gfortran-test/bin/gfortran -fcoarray=lib syncall.f90 -lcaf_shmem $ (export LD_LIBRARY_PATH=~/compilers/install/gfortran-test/lib64:$LD_LIBRARY_PATH; echo ' &config / ' | time mpirun -np 9 ./a.out)
 Finished 10**           0
 Finished 10**           0
...
 Finished 10**           5
 Finished 10**           5
29.00user 240.04system 0:19.19elapsed 1402%CPU (0avgtext+0avgdata 13272maxresident)k
0inputs+0outputs (13major+43963minor)pagefaults 0swaps

So, although it didn't "hang" it certainly had a few hickup's and 20 seconds elapsed time is rather pathetic for this simple code.

Kind regards,

--
Toon Moene - e-mail: t...@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands

Reply via email to