Hi Investigating some sporadical performance drop when using Fortran IO on our Lustre shared file system, we realized that the buffer size used as default by the gnu fortran compiler is 8 kiB only. We wanted to change this default and according to the documentation, one has just to set the environment variables:
GFORTRAN_UNFORMATTED_BUFFER_SIZE GFORTRAN_FORMATTED_BUFFER_SIZE= GFORTRAN_UNBUFFERED_ALL=n to increase the buffer size during runtime. Unfortunately isetting these variables does not change the default buffer size. I tried with gfortran 8, 10, and the new 11.2. Looking a the code, i found in io/unix.c that the default is set to the following value, static const int FORMATTED_BUFFER_SIZE_DEFAULT = 8192; static const int UNFORMATTED_BUFFER_SIZE_DEFAULT = 128*1024; Of course, changing the default value and recompiling works and change accordingly the buffer size It should nevertheless be possible to change these values without recompiling. Is there something one should be aware of when setting these variables? Best regards, Denis --------- Denis Bertini Abteilung: CIT Ort: SB3 2.265a Tel: +49 6159 71 2240 Fax: +49 6159 71 2986 E-Mail: d.bert...@gsi.de GSI Helmholtzzentrum für Schwerionenforschung GmbH Planckstraße 1, 64291 Darmstadt, Germany, www.gsi.de Commercial Register / Handelsregister: Amtsgericht Darmstadt, HRB 1528 Managing Directors / Geschäftsführung: Professor Dr. Paolo Giubellino, Dr. Ulrich Breuer, Jörg Blaurock Chairman of the GSI Supervisory Board / Vorsitzender des GSI-Aufsichtsrats: Ministerialdirigent Dr. Volkmar Dietz