Am 07.07.19 um 22:13 schrieb Thomas Koenig:
> Hello world,
>
> the attached patch sets the I/O block size for unformatted files to
> 2**17 and makes this, and the block size for formatted files,
> adjustable via environment variables.
>
> The main reason is that -fconvert=big-endian was quite slow on
> some HPC systems. A bigger buffer should eliminate that.  Also,
> People who use unformatted files are likely to write large amounts
> of data, so this seems like a good fit.  Finally, some benchmarking
> showed that 131072 seemed like a good value to use. Thanks to Jerry
> for support.
>
> I didn't change the value for formatted files because, frankly, we are
> using a lot of CPU for converting numbers there, so any gain
> negligible (unless somebody comes up with a benchmark which says
> otherwise).

formatted write: Did you try writing to an USB stick or similar? I guess
for flash based devices anything below 64k will slow down operation.
Computers like Raspberry Pi and the like often have flash based storage,
and it is not extremely unrealistic to run fortran programs on them.


Cheers.
Manfred

>
> As this is a change in behavior / new feature, I don't think that
> backporting is indicated, but if somebody feels otherwise, please
> speak up.
>
> Regression-tested. OK for trunk?
>
> Regards
>
>     Thomas
>
> 2019-07-07  Thomas König  <tkoe...@gcc.gnu.org>
>
>     PR libfortran/91030
>     * gfortran.texi (GFORTRAN_BUFFER_SIZE_FORMATTED): Document
>     (GFORTRAN_BUFFER_SIZE_FORMATTED): Likewise.
>
> 2019-07-07  Thomas König  <tkoe...@gcc.gnu.org>
>
>     PR libfortran/91030
>     * io/unix.c (BUFFER_SIZE): Delete.
>     (BUFFER_SIZE_FORMATTED_DEFAULT): New variable.
>     (BUFFER_SIZE_UNFORMATTED_DEFAULT): New variable.
>     (unix_stream): Add buffer_size.
>     (buf_read): Use s->buffer_size instead of BUFFER_SIZE.
>     (buf_write): Likewise.
>     (buf_init): Add argument unformatted.  Handle block sizes
>     for unformatted vs. formatted, using defaults if provided.
>     (fd_to_stream): Add argument unformatted in call to buf_init.
>     * libgfortran.h (options_t): Add buffer_size_formatted and
>     buffer_size_unformatted.
>     * runtime/environ.c (variable_table): Add
>     GFORTRAN_BUFFER_SIZE_UNFORMATTED and GFORTRAN_BUFFER_SIZE_FORMATTED.
>

Reply via email to