public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/60956] New: error reading (and writing) large text files in gfortran
@ 2014-04-24 20:16 awrichar at gmail dot com
  2015-02-06  4:48 ` [Bug fortran/60956] " jvdelisle at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: awrichar at gmail dot com @ 2014-04-24 20:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60956

            Bug ID: 60956
           Summary: error reading (and writing) large text files in
                    gfortran
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: awrichar at gmail dot com

Created attachment 32678
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32678&action=edit
demonstrates gfortran failed read/write of large text files

I'm getting some buggy behavior when working with very large data files
(complex, n=120^4) in gfortran 4.7.3.  I get "End of record" errors when
reading, and recently, "Cannot allocate memory" when writing.

Originally, I was able to successfuly write the large files, but when I try to
read them, gfortran issues the error:

>> test_complex_sort.f90 (unit = 100, file = 'sigma_hat_1.txt')
>> Fortran runtime error: End of file

If I explicitly loop through each element of the array during the READ instead,
gfortran has no issues. (Also if I use the Portland Group compiler and assign
the array all at once, there are no issues.)  If I reduce the variable size to
(120^4)/12, it runs, but (120^4)/10 fails.


I've written a test case (see attached), but this fails to WRITE the large
file, saying:

>> At line 19 of file test_complex_io.f90 (unit = 100, file = 'dummy.txt')
>> Fortran runtime error: Cannot allocate memory

The line in question (19) is simply
>> WRITE(100, *) u
and runs fine for cases (n.LT.10**8).  (All cases run fine when compiling with
the Portland Group Fortran compiler.)

Lastly, if I generate the 4GB text file using PG Fortran, then comment out
lines 18-20 in the attached file and complie with gfortran, I get a seg-fault
during the READ for the n=10^8 case.

These errors occurs on a computer with dual Xeon E-2690v2 processors and 256GB
(not a typo) of RAM, under Ubuntu 13.04 with gfortran 4.7.3.  (NOTE: When using
the PG Fortran compiler, the attached code uses ~3.2GB of memory, and writes a
4GB text file for the largest test case.)

Has anyone else experienced similar issues?  Is this reproducible for anyone
else, or in newer gfortran versions?  I haven't found any recent bugs reports
that seem similar, but I easily could have overlooked something.


--Andy


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-03-23  4:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-24 20:16 [Bug fortran/60956] New: error reading (and writing) large text files in gfortran awrichar at gmail dot com
2015-02-06  4:48 ` [Bug fortran/60956] " jvdelisle at gcc dot gnu.org
2015-02-06  6:51 ` [Bug fortran/60956] [4.8/4.9/5 Regression] " tkoenig at gcc dot gnu.org
2015-02-06 11:07 ` burnus at gcc dot gnu.org
2015-02-06 14:22 ` jvdelisle at gcc dot gnu.org
2015-02-06 15:00 ` jvdelisle at gcc dot gnu.org
2015-02-07  2:20 ` jvdelisle at gcc dot gnu.org
2015-02-07 15:13 ` jvdelisle at gcc dot gnu.org
2015-02-07 15:24 ` jakub at gcc dot gnu.org
2015-03-23  1:32 ` jvdelisle at gcc dot gnu.org
2015-03-23  4:55 ` jvdelisle at gcc dot gnu.org
2015-03-23  5:47 ` jvdelisle at gcc dot gnu.org

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).