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

--- Comment #35 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to Thomas Koenig from comment #34)
> There is another point to consider.
> 
> I suppose not very many people use big-endian data formats
> these days. Little-endian dominates these days, and people
> who require that conversion on a regular basis (why does
> HPC need that, by the way?) are probably few and far between.
> 
> Another question is if people who do serious HPC work do
> a lot of stuff (without conversion) like
> 
>   write(10) x(1::2)
> 
> which would actually use the buffers, instead of
> 
>   write (10) x
> 
> where the whole buffering discussion does not apply.
> 
> Jerry, if you use strides in writing, without conversion,
> what result would you get for different block sizes?
> 

Disregard my previous data. If I run the tests manually outside of the script
you provided I get consistent results:

$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=1024 ./a.out
   2.7986080646514893     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=4096 ./a.out
   2.5836510658264160     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=8192 ./a.out
   2.5744562149047852     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=16384 ./a.out
   2.4813480377197266     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=32768 ./a.out
   2.5214788913726807     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=65536 ./a.out
   2.4661610126495361     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=131072 ./a.out
   2.4065649509429932     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=262144 ./a.out
   2.4941890239715576     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=524288 ./a.out
   2.3842790126800537     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=1048576 ./a.out
   2.4531490802764893     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=2097152 ./a.out
   2.5236811637878418     

So there is a sweet spot at the 131072 point on this particular machine, so I
agree we should be able to go higher (that inconsistency I reported earlier was
bugging me enough to experiment and I discovered this, Ryzen 2500U).

Strides without conversion:

$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=65536 ./a.out
   1.8322470188140869     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=65536 ./a.out
   1.8337209224700928     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=131072 ./a.out
   1.8346250057220459     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=262144 ./a.out
   1.8497080802917480     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=524288 ./a.out
   1.8243398666381836     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=1048576 ./a.out
   1.7886412143707275     
$ GFORTRAN_BUFFER_SIZE_UNFORMATTED=2097152 ./a.out
   1.8285851478576660    

All things considered I would say go for the higher value and the users can set
the environment variable lower if they need to.

Reply via email to