Discussion:
[OMPI users] weird issue with output redirection to a file when using different compilers
fabricio
2017-07-13 23:49:46 UTC
Permalink
Hello there

I'm facing a weird issue in a centos 7.3 x86 machine when remotely
running a program [https://www.myroms.org] from host1 to host2 and host3.

When the program was compiled with intel ifort 17.0, output redirection
happens immediately and the file is constantly updated.
If the program is compiled with gnu gfortran 5.3.0, the file is not
written (zero bytes) until the end of the execution, as if some kind of
buffering was happening.
Openmpi version is the same, 1.10.7, and configure options are as below:

intel:
--prefix /intel/path
--enable-shared
--enable-static
--enable-orterun-prefix-by-default
--with-slurm
--with-psm
--with-verbs=yes
--with-threads=posix
--with-hwloc=/hwloc/path
--disable-java
--disable-vt

gnu:
--prefix /gnu/path
--enable-shared
--enable-static
--enable-orterun-prefix-by-default
--with-sge
--with-tm
--with-slurm
--with-valgrind
--with-psm
--with-verbs=yes
--with-threads=posix
--with-hwloc=/hwloc/path
--with-libevent=/libevent/path
--with-psm2
--disable-java
--disable-vt


Does anything strikes as odd? Am I fumbling something?


TIA,
Fabricio
Gilles Gouaillardet
2017-07-14 01:32:53 UTC
Permalink
Fabricio,

the fortran runtime might (or not) use buffering for I/O.
as a consequence, data might be written immediatly to disk, or at a later time
(e.g. the file is closed, the buffer is full or the buffer is flushed)

you might want to manually flush the file, or there might be an option
not to use
buffering when opening a file (sorry, i do not know them off hands)

Cheers,

Gilles
Post by fabricio
Hello there
I'm facing a weird issue in a centos 7.3 x86 machine when remotely running a
program [https://www.myroms.org] from host1 to host2 and host3.
When the program was compiled with intel ifort 17.0, output redirection
happens immediately and the file is constantly updated.
If the program is compiled with gnu gfortran 5.3.0, the file is not written
(zero bytes) until the end of the execution, as if some kind of buffering
was happening.
--prefix /intel/path
--enable-shared
--enable-static
--enable-orterun-prefix-by-default
--with-slurm
--with-psm
--with-verbs=yes
--with-threads=posix
--with-hwloc=/hwloc/path
--disable-java
--disable-vt
--prefix /gnu/path
--enable-shared
--enable-static
--enable-orterun-prefix-by-default
--with-sge
--with-tm
--with-slurm
--with-valgrind
--with-psm
--with-verbs=yes
--with-threads=posix
--with-hwloc=/hwloc/path
--with-libevent=/libevent/path
--with-psm2
--disable-java
--disable-vt
Does anything strikes as odd? Am I fumbling something?
TIA,
Fabricio
_______________________________________________
users mailing list
https://rfd.newmexicoconsortium.org/mailman/listinfo/users
fabricio
2017-07-14 01:42:06 UTC
Permalink
Post by Gilles Gouaillardet
Fabricio,
the fortran runtime might (or not) use buffering for I/O.
as a consequence, data might be written immediatly to disk, or at a later time
(e.g. the file is closed, the buffer is full or the buffer is flushed)
you might want to manually flush the file, or there might be an option
not to use
buffering when opening a file (sorry, i do not know them off hands)
You're right, Gilles!

For the record, the variable GFORTRAN_UNBUFFERED_ALL=1 controls this
behavior.
https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/GFORTRAN_005fUNBUFFERED_005fALL.html#GFORTRAN_005fUNBUFFERED_005fALL


Thank you very much!

Loading...