public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fwi at inducks dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/50937] STAT option with ALLOCATE statement on large arrays
Date: Tue, 01 Nov 2011 12:01:00 -0000	[thread overview]
Message-ID: <bug-50937-4-o3AeBKISKa@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50937-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #11 from fwi at inducks dot org 2011-11-01 12:00:54 UTC ---
(In reply to comment #10)
> Sometimes abstractions leak, unfortunately. There's really not anything
> gfortran can do about that. And, it's not unique to gfortran either. gfortran
> ALLOCATE uses the C malloc(), as does e.g. the default implementation of the
> C++ new operator and presumably a lot of other language runtimes as well. So
> they all share the same issues in case the system overcommits memory.

I hate to continue this discussion, but I think the integer overflow problem,
which is what I was reporting, was a different issue. The fact that you solved
it in recent gfortran versions proves that there was something you could do
about that.

> I can certainly sympathize with the notion that memory overcommit is inane and
> shouldn't be enabled by default, but that's a system policy issue and nothing
> gfortran can do anything about. As you're on Linux, FWIW you can disable
> overcommit by setting the "vm.overcommit_memory" sysctl to the value 2. See
> http://www.mjmwired.net/kernel/Documentation/vm/overcommit-accounting

Thanks for the info.

> And, one might add, if all you're going to do with the STAT result is checking
> whether it's nonzero and stopping the program in that case, you might as well
> not bother because that's exactly what ALLOCATE without STAT already does.

Not really, because then I can directly tell users how they can solve the
issue, that is either switch to a 64bit OS or compile the MPI version of the
same program (because then the main array is splitted in several chunks, all of
them small enough to be indexed with 32bit integers).
Without the STAT option, users will be left in the dark with just "it doesn't
work". Or with "I need to spend time reading the manual".

And please - I hope you all do not take my remarks as harsh criticism, I do
appreciate the efforts and job you did with gfortran. A few years ago, my code
was much faster with ifort than gcc's Fortran, nowadays it's comparable and I
can tell people to use gfortran if they like.


      parent reply	other threads:[~2011-11-01 12:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 17:21 [Bug fortran/50937] New: " fwi at inducks dot org
2011-10-31 18:06 ` [Bug fortran/50937] " kargl at gcc dot gnu.org
2011-10-31 18:16 ` fwi at inducks dot org
2011-10-31 18:25 ` jb at gcc dot gnu.org
2011-10-31 18:29 ` fwi at inducks dot org
2011-10-31 19:02 ` jb at gcc dot gnu.org
2011-10-31 19:26 ` fwi at inducks dot org
2011-10-31 19:51 ` sgk at troutmask dot apl.washington.edu
2011-10-31 20:18 ` fwi at inducks dot org
2011-10-31 21:03 ` sgk at troutmask dot apl.washington.edu
2011-11-01  7:55 ` jb at gcc dot gnu.org
2011-11-01 12:01 ` fwi at inducks dot org [this message]

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=bug-50937-4-o3AeBKISKa@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).