https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91030
--- Comment #18 from David Edelsohn <dje at gcc dot gnu.org> --- For GPFS, the striping unit is 16M. The 8K buffer size chosen by GFortran is a huge performance sink. We have confirmed this with testing. The recommendation from GPFS is that one should query the filesystem with fstat() and write in chunks of the block size. Instead of arbitrarily choosing a uniform buffer size of 8K, GFortran would achieve better I/O performance in general by dynamically querying the filesystem characteristics and choosing a buffer size tuned to the filesystem. Presumably one must find some balance of memory consumption if the application opens a huge number of files. Or maybe some environment variable to override the buffer size. IBM XL FORTRAN achieves better performance, even for EXT4, by adapting I/O to the filesystem block size.