From: "Bertini, Denis Dr." <D.Bertini@gsi.de>
To: Harald Anlauf <anlauf@gmx.de>
Cc: Tobias Burnus <tobias@codesourcery.com>,
"fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Subject: Re: Re: Problem setting buffer size for gfortran ( v 11.2)
Date: Fri, 25 Feb 2022 20:01:25 +0000 [thread overview]
Message-ID: <c4fd08a52e4947ddbaee3982a3ad681f@gsi.de> (raw)
In-Reply-To: <trinity-59001f50-077d-424e-a648-24645944dd0c-1645813711633@3c-app-gmx-bap28>
Hi Harald
I modified a little your test program to the following:
>>>>>>>>>>>>>>>>>>>>>>>>>>
program fio
integer :: stat
character(80) :: s
integer, parameter :: nx = 256
integer, parameter :: ny = 256
integer, parameter :: nz = 256
integer :: i, j, k, l
double precision :: data(nx,ny,nz)
call get_environment_variable ("GFORTRAN_FORMATTED_BUFFER_SIZE", s, status=stat)
if (stat == 0) then
print *, "GFORTRAN_FORMATTED_BUFFER_SIZE=",trim(s)
else
print *, "GFORTRAN_FORMATTED_BUFFER_SIZE not set"
end if
! reset array
data(:,:,:) = -1
! fill dummy data
do i = 1, nx
do j = 1, ny
do k = 1, nz
data(i,j,k) = (i+j+k) * 0.1
end do
end do
end do
open(10,file="bigfile", status="new", action="write", form='unformatted', access='stream')
write(10) data(1:nx, 1:ny, 1:nz)
close(10)
end program fio
>>>>>>>>>>>>>>>>>>>>>>>>
Now i set the env. variable to the following values:
export GFORTRAN_UNFORMATTED_BUFFER_SIZE=10000
export GFORTRAN_FORMATTED_BUFFER_SIZE=10000
export GFORTRAN_UNBUFFERED_ALL=n
From the output log indeed i got the correct env. variable as i set:
GFORTRAN_FORMATTED_BUFFER_SIZE=10000
But from strace output i got always
>>>>>>>>>>>>>>>>>>>>>>
write(3, "\0\0\0\0\0\0\10@\0\0\0\340\314\314\10@\0\0\0\240\231\231\t@\0\0\0`ff\n@"..., 8192) = 8192
write(3, "\0\0\0@33\v@\0\0\0\0\0\0\f@\0\0\0\340\314\314\f@\0\0\0\240\231\231\r@"..., 8192) = 8192
write(3, "\0\0\0`ff\16@\0\0\0@33\17@\0\0\0\0\0\0\20@\0\0\0`ff\20@"..., 8192) = 8192
write(3, "\0\0\0\340\314\314\20@\0\0\0@33\21@\0\0\0\240\231\231\21@\0\0\0\0\0\0\22@"..., 8192) = 8192
write(3, "\0\0\0`ff\22@\0\0\0\340\314\314\22@\0\0\0@33\23@\0\0\0\240\231\231\23@"..., 8192) = 8192
write(3, "\0\0\0\0\0\0\24@\0\0\0`ff\24@\0\0\0\340\314\314\24@\0\0\0@33\25@"..., 8192) = 8192
.....
>>>>>>>>>>>>>>>>>>
Showing the fixed that still a 8kiB buffer size is effectively ude in I/O...
Best
Denis
________________________________
From: Harald Anlauf <anlauf@gmx.de>
Sent: Friday, February 25, 2022 7:28:31 PM
To: Bertini, Denis Dr.
Cc: Tobias Burnus; fortran@gcc.gnu.org
Subject: Aw: Re: Problem setting buffer size for gfortran ( v 11.2)
Hi Denis,
I and verified it works here on our Lustre with gfortran-10.3.0.
You could use:
integer :: stat
character(80) :: s
call get_environment_variable ("GFORTRAN_FORMATTED_BUFFER_SIZE", s, status=stat)
if (stat == 0) then
print *, "GFORTRAN_FORMATTED_BUFFER_SIZE=",trim(s)
else
print *, "GFORTRAN_FORMATTED_BUFFER_SIZE not set"
end if
open(10,file="bigfile")
write(10,*) "data"
close(10)
end
to verify that the environment variable is set for a process/rank.
If that doesn't help, I'd suggest that it is possibly not a gfortran issue.
Cheers,
Harald
Gesendet: Freitag, 25. Februar 2022 um 18:28 Uhr
Von: "Bertini, Denis Dr." <D.Bertini@gsi.de>
An: "Tobias Burnus" <tobias@codesourcery.com>, "Harald Anlauf" <anlauf@gmx.de>
Cc: "fortran@gcc.gnu.org" <fortran@gcc.gnu.org>
Betreff: Re: Problem setting buffer size for gfortran ( v 11.2)
Hi Tobias,
So i use now in my submission script the option you were quoting i.e
> srun --export=ALL
which is actually the default as stated in the slurm documentation.
Setting the following environment to change the buffer size in both formatted/unformatted I/O 😎
export GFORTRAN_FORMATTED_BUFFER_SIZE=10000
export GFORTRAN_UNFORMATTED_BUFFER_SIZE=10000
export GFORTRAN_UNBUFFERED_ALL=n
Does not work even on gcc/gfortran 11.2
If i set the same way some environment variables for openMPI,
it is working.
So this is not related to the forwarding of environment variables
with srun.
Are the variables set correct ?
Best,
Denis
________________________________
From: Tobias Burnus <tobias@codesourcery.com>
Sent: Thursday, February 24, 2022 9:20:26 AM
To: Bertini, Denis Dr.; Harald Anlauf
Cc: fortran@gcc.gnu.org
Subject: Re: Problem setting buffer size for gfortran ( v 11.2)
Hi Denis,
On 24.02.22 09:15, Bertini, Denis Dr. via Fortran wrote:
> I can try that but on our cluster we are bound to use
> srun (slurm).
> Do you know how to use the same functionality with srun
> to set the environment variables.
I didn't – but the manual did: srun --export=...
See: https://slurm.schedmd.com/srun.html#OPT_export_1
Good luck,
Tobias
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
next prev parent reply other threads:[~2022-02-25 20:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-23 16:10 Bertini, Denis Dr.
2022-02-23 18:26 ` Harald Anlauf
2022-02-23 18:26 ` Harald Anlauf
2022-02-23 20:28 ` Bertini, Denis Dr.
2022-02-23 20:57 ` Harald Anlauf
2022-02-23 20:57 ` Harald Anlauf
2022-02-23 20:59 ` Bertini, Denis Dr.
[not found] ` <trinity-9bf94afe-e773-4366-b0b2-ae398de80664-1645651097363@3c-app-gmx-bs49>
2022-02-23 21:23 ` Bertini, Denis Dr.
2022-02-23 21:38 ` Harald Anlauf
2022-02-24 7:57 ` Bertini, Denis Dr.
2022-02-24 8:13 ` Tobias Burnus
2022-02-24 8:15 ` Bertini, Denis Dr.
2022-02-24 8:20 ` Tobias Burnus
2022-02-25 17:28 ` Bertini, Denis Dr.
[not found] ` <trinity-59001f50-077d-424e-a648-24645944dd0c-1645813711633@3c-app-gmx-bap28>
2022-02-25 20:01 ` Bertini, Denis Dr. [this message]
2022-02-25 20:44 ` Harald Anlauf
2022-02-25 20:44 ` Harald Anlauf
2022-02-25 20:53 ` Bertini, Denis Dr.
2022-02-26 9:20 ` Thomas Koenig
2022-02-26 15:37 ` Bertini, Denis Dr.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c4fd08a52e4947ddbaee3982a3ad681f@gsi.de \
--to=d.bertini@gsi.de \
--cc=anlauf@gmx.de \
--cc=fortran@gcc.gnu.org \
--cc=tobias@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).