https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127893

--- Comment #3 from [email protected] ---
I have now constructed a small standalone reproducer which contains no
application code and reproduces the problem very strongly.

The test performs a fixed total of 5,000,000 sequential-unformatted Fortran
READ statements. Each OpenMP worker uses its own file and its own unique
Fortran unit. There is no shared I/O unit and no OpenMP synchronization in the
timed region.

Compiled with:

gfortran-13 -O2 -fopenmp repro.f90 -o repro13
gfortran-14 -O2 -fopenmp repro.f90 -o repro14

Results:

                  5 threads       14 threads

gfortran 13        0.8112 s         0.7313 s
gfortran 14        3.1802 s        29.0052 s

Thus with 5 threads GCC 14 is about 3.9x slower than GCC 13.

With 14 threads GCC 14 is about 39.7x slower than GCC 13.

Also, within the GCC 14 executable itself, increasing the number of threads
from 5 to 14 makes the program about 9.1x slower, despite the total number of
READ statements remaining fixed at 5,000,000.

With GCC 13 the same increase in thread count slightly improves performance.

The checksums agree between GCC 13 and GCC 14 for a given thread count, so both
executables perform the same work.

I will attach the complete reproducer source to this PR.

Reply via email to