On 7/17/25 9:37 PM, Jerry D wrote:
I have created a new gfortran-test branch on gcc here.
origin/devel/gfortran-test
This has the patches applied as needed to do the testing I have done.
When Andre's patches are approved I will revert and rebase this so we can test
the next set of major changes. I have done this to simplify the process of
testing for those who would like to just check out the branch and build it.
Regards,
Jerry
On 7/17/25 5:44 PM, Jerry D wrote:
On 7/16/25 7:13 AM, Andre Vehreschild wrote:
Hi Jerry,
I am back on track.
--- snip ---
After some back and forth with Andre I finally understand the discrepancies I
was having here. Andre has an OpenCoarrays branch being used to update
OpenCoarrays to sync with changes to gfortran-16. This branch is here:
https://github.com/sourceryinstitute/OpenCoarrays/tree/vehre/issue-779-form-team
The changes being made to implement the newer TEAM features and shared mem
result in a change to the gfortran interface for -fcoarray=lib libraries. The
first four patches of the patch set implement these changes. The last two add
the new shared memory library.
First I applied the gfortran patches and did a clean build of the compiler.
Second I rebuild OpenCoarrays with the issue-779-form-team branch using the
patched gfortran compiler.
All OpenCoarrays tests pass.
Here is the results of the random-weather example:
$ cat ~/bin/set-shared
export FC=/home/jerry/dev/usrav/bin/gfortran
export CC=/home/jerry/dev/usrav/bin/gcc
export GFORTRAN_NUM_IMAGES=8
export LD_LIBRARY_PATH=/home/jerry/dev/usrav/lib64/:/home/jerry/dev/usrav/lib/
[aside: FC and CC must be set correctly so the OpenCoarrays uses the correct
gfortran]
$ . set-shared
$ $FC -v
Using built-in specs.
COLLECT_GCC=/home/jerry/dev/usrav/bin/gfortran
COLLECT_LTO_WRAPPER=/home/jerry/dev/usrav/libexec/gcc/x86_64-pc-linux-
gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gccav/configure --prefix=/home/jerry/dev/usrav --enable-
languages=c,c++,fortran --enable-libgomp --disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20250717 (experimental) (GCC)
[aside: No need to install as long as one uses the newly built caf and cafrun.]
$ ../opencoarrays-clean/bin/caf random-weather.f90
$ time ../opencoarrays-clean/bin/cafrun -np 8 ./a.out
.
.
.
real 0m26.533s
user 3m2.067s
sys 2m35.954s
$ $FC -fcoarray=lib random-weather.f90 -lcaf_shmem
$ time ./a.out
.
.
.
real 0m0.055s
user 0m0.279s
sys 0m0.102s
With this setup I can test with other examples. I have the necessary gfortran
patches gathered here and will get these out to the gfortran-test branch I
created earlier.
Regards,
Jerry
I expanded on Toon's random_weather.f90 test using:
!integer, parameter :: DNX = 72, DNY = 70, DNZ = 30, BDSIZE = 4, HORSTEP =
10000, VERSTEP = 100, FCLEN = 3600, TIMSTEP = 240
integer, parameter :: DNX = 1000, DNY = 1500, DNZ = 100, BDSIZE = 4, HORSTEP =
10000, VERSTEP = 100, FCLEN = 3600, TIMSTEP = 240
For the default problem size and using 20 images on my 8 core 16 "thread"
machine.
shmem:
$ export GFORTRAN_NUM_IMAGES=20
$ $FC -fcoarray=lib random-weather.f90 -lcaf_shmem
$ time ./a.out
...
real 1m12.935s
user 11m50.423s
sys 5m57.636s
mpich:
$ ../opencoarrays-clean/bin/caf random-weather.f90
$ time ../opencoarrays-clean/bin/cafrun -np 20 ./a.out
...
real 164m48.280s
user 2492m58.342s
sys 121m22.190s
I believe that the benefits of this outweigh any concerns and it is
quite useful for particular problem sets and can for people developing
and testing coarray applications before deploying to big iron
machines if needed.
These results are using the gfortran-test branch in the gcc git
repository.
I am ready to approve this. Can anyone second this.
Regards,
Jerry