This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: informational question: compile time of large DATA arrays
- From: "Daniel Franke" <franke dot daniel at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Mon, 11 Sep 2006 17:56:13 +0200
- Subject: Re: informational question: compile time of large DATA arrays
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TF8aSr3Hqr1/yfMKoO9FMZHJP6z/cCfJrFjwQZmuDvo3bg7qiek18sL2Tj8BVjafXIHAdcngpPkis5u69hB3HUqoos/Y3n9FjnhTX2P7XQPmLRxCZsYCOKm1RH7GNccOCcjZrKDouurJrAj+9hCJRf0/Aw8f78XjofpZ3xsjZKU=
- References: <640ad44b0609070302u2c7558d2k1e312b88c68d3ac3@mail.gmail.com> <640ad44b0609070305y1901ef33yf3daa9f131e5ed9@mail.gmail.com> <6DAFD663-50FB-4F4B-BDCB-D3B38AD9B4C7@nasa.gov>
2006/9/11, Richard E Maine <Richard.Maine@nasa.gov>:
On Sep 7, 2006, at 3:05 AM, Daniel Franke wrote:
> MODULE foo
> REAL :: grid(0: 50 , 0: 10000 )
> DATA grid( 0 , 0 ) / 1.000000 /
> DATA grid( 0 , 1 ) / 0.9999750 /
> DATA grid( 0 , 2 ) / 0.9999000 /
> [ ... ]
> CONTAINS
> [a simple function working on the grid]
> END MODULE
I can't comment on gfortran specifically, but be aware that code like
this causes problems with many compilers.
Richard,
the only one I could give a try was ifort - I had to abort the
compilation after six hours , gfortran finished in four and a half
hours ...
I've been known to do workarounds such as initializing a small array
with the non-zero values and then copy that small array to the right
places in the big one with executable code that is executed only on
the first call. Yes, it adds a little complication (though not much),
but it makes the code run well on pretty much any compiler.
Here, I tried to fill the grid completely with precomputed values, the
(generated) source file had 500.000+ lines. I am all ears (or eyes) if
you or someone else could suggest a better way to initialize such an
array?!
Regards
Daniel