From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lxmtout1.gsi.de (lxmtout1.gsi.de [140.181.3.111]) by sourceware.org (Postfix) with ESMTPS id F0E203858D1E for ; Sat, 26 Feb 2022 15:37:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F0E203858D1E Received: from localhost (localhost [127.0.0.1]) by lxmtout1.gsi.de (Postfix) with ESMTP id 7CA9C2051045; Sat, 26 Feb 2022 16:37:51 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at lxmtout1.gsi.de Received: from lxmtout1.gsi.de ([127.0.0.1]) by localhost (lxmtout1.gsi.de [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4c3omgHCO-HW; Sat, 26 Feb 2022 16:37:51 +0100 (CET) Received: from srvex1.campus.gsi.de (unknown [10.10.4.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by lxmtout1.gsi.de (Postfix) with ESMTPS id 625052051043; Sat, 26 Feb 2022 16:37:51 +0100 (CET) Received: from srvex1.Campus.gsi.de (10.10.4.11) by srvex1.campus.gsi.de (10.10.4.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.18; Sat, 26 Feb 2022 16:37:50 +0100 Received: from srvex1.Campus.gsi.de ([fe80::d6d:62f8:8c5f:1743]) by srvex1.campus.gsi.de ([fe80::d6d:62f8:8c5f:1743%21]) with mapi id 15.01.2375.018; Sat, 26 Feb 2022 16:37:50 +0100 From: "Bertini, Denis Dr." To: Thomas Koenig , Harald Anlauf CC: Tobias Burnus , "fortran@gcc.gnu.org" Subject: Re: Problem setting buffer size for gfortran ( v 11.2) Thread-Topic: Problem setting buffer size for gfortran ( v 11.2) Thread-Index: AQHYKoiPSth44TRYAkqX8UYUeWdL8aykvYDbgADA14CAAHi57A== Date: Sat, 26 Feb 2022 15:37:50 +0000 Message-ID: References: <2916ad84-bfbe-757b-290e-61d9c5805367@gmx.de> <99fe8038e55242b1bc4e7792ff0d7777@gsi.de> <45776b22-8587-597c-c2d1-93df2c8cfdbb@codesourcery.com> <5a95ec72581b4c8fb59e81fdb93e4991@gsi.de> <9546ace7-cab6-9115-e83a-2a4eecab191f@gmx.de> , <691ce537-ff39-7410-327f-ef11d89e2419@netcologne.de> In-Reply-To: <691ce537-ff39-7410-327f-ef11d89e2419@netcologne.de> Accept-Language: en-US, de-DE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [140.181.3.12] MIME-Version: 1.0 X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00, HTML_MESSAGE, KAM_DMARC_STATUS, SPAM_BODY, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Feb 2022 15:37:55 -0000 Hi Thomas, OK so i took your example ( exact copy) and compile it with gfortran 11.2. Then without setting the environment variable: export GFORTRAN_UNFORMATTED_BUFFER_SIZE=3D200000 i got dbertini@lxbk0596:/lustre/rz/dbertini/fio > strace -e write ./fio write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 408) =3D 408 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 100368) =3D 100368 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 100368) =3D 100368 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 100368) =3D 100368 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 100368) =3D 100368 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 6120) =3D 6120 +++ exited with 0 +++ setting for example dbertini@lxbk0596:/lustre/rz/dbertini/fio > export GFORTRAN_UNFORMATTED_BUF= FER_SIZE=3D400000 dbertini@lxbk0596:/lustre/rz/dbertini/fio > strace -e write ./fio write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 408) =3D 408 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 200328) =3D 200328 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 200328) =3D 200328 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\= 0"..., 6936) =3D 6936 +++ exited with 0 +++ So it seems to work right? But do you understand the strace output in both cases ? What means the data buffer distribution? Is there some data alignment alforithm working in the background here? Cheers. Denis ________________________________ From: Thomas Koenig Sent: Saturday, February 26, 2022 10:20:25 AM To: Bertini, Denis Dr.; Harald Anlauf Cc: Tobias Burnus; fortran@gcc.gnu.org Subject: Re: Problem setting buffer size for gfortran ( v 11.2) On 25.02.22 21:53, Bertini, Denis Dr. via Fortran wrote: > It seems that the value set in the foreseen environment variable is just > ignored. > And always a buffer size of 8kiB is used, which is the default values > for formatted I/O harcoded in libgfortran. > The only way to change this value is editing and recompiling the libgfort= ran. This is really strange, I also cannot reproduce this. With the Ubuntu-supplied gfortran 9.3.0 I get (just setting a few semi-random numbers for the unformatted buffer size). $ cat write.f90 program main implicit none integer, parameter :: n=3D100 integer, dimension(n) :: x integer :: i x =3D [(i,i=3D1,n)] open (10,file=3D"tst.dat",form=3D"unformatted",action=3D"write") do i=3D1,1000 write (10) x end do end program main $ gfortran write.f90 $ strace -e write ./a.out write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 408) =3D 408 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 65688) =3D 65688 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 65688) =3D 65688 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 65688) =3D 65688 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 65688) =3D 65688 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 65688) =3D 65688 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 65688) =3D 65688 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 13464) =3D 13464 +++ exited with 0 +++ $ GFORTRAN_UNFORMATTED_BUFFER_SIZE=3D200000 strace -e write ./a.out write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 408) =3D 408 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 100368) =3D 100368 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 100368) =3D 100368 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 100368) =3D 100368 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 100368) =3D 100368 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 6120) =3D 6120 +++ exited with 0 +++ $ GFORTRAN_UNFORMATTED_BUFFER_SIZE=3D210000 strace -e write ./a.out write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 408) =3D 408 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 105264) =3D 105264 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 105264) =3D 105264 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 105264) =3D 105264 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 91800) =3D 91800 +++ exited with 0 +++ $ GFORTRAN_UNFORMATTED_BUFFER_SIZE=3D2100000 strace -e write ./a.out write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 408) =3D 408 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 407592) =3D 407592 +++ exited with 0 +++ $ GFORTRAN_UNFORMATTED_BUFFER_SIZE=3D21000000 strace -e write ./a.out write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 408) =3D 408 write(3, "\220\1\0\0\1\0\0\0\2\0\0\0\3\0\0\0\4\0\0\0\5\0\0\0\6\0\0\0\7\0\0\0"..., 407592) =3D 407592