ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #04264
Large generated code
-
To:
FFC Mailing List <ffc@xxxxxxxxxxxxxxxxxxx>
-
From:
"Garth N. Wells" <gnw20@xxxxxxxxx>
-
Date:
Wed, 06 Jul 2011 12:17:15 +0100
-
User-agent:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10
FFC can generated *very* large files with the tensor contraction
approach, especially when auxiliary problems like error estimation are
used. This makes compilation slow, and possibly fail.
The array A in the generated code often has a lot of zeroes. Would it be
sensible to
1. Initialise A to zero and then fill non-zero entries
// Initialise (size is known at runtime, so compiler can optimise)
for (unsigned int i = 0; i < size; ++i)
A[i] = 0.0;
// Nonzero terms of in
A[0] = 1.0;
A[22] = 2.0;
A[23] = 1.0;
2. Format floating point numbers for compactness, e.g.
A[0] = 0.0;
A[1] = 1.0;
instead of
A[0] = 0.00000000000;
A[1] = 1.00000000000;
Garth
Follow ups