[Developers] Double quotes around keyword parameter values
Tom Goodale
goodale at cct.lsu.edu
Thu Jun 2 05:59:57 CDT 2005
Ok, however WaveToyFreeF90 doesn't check in the inner loop, so this is a
moot point.
Please return the check for double quotes in the CST that you removed, and
enumerate the places where you think it is inconsistent.
I agree that there are more efficient ways to deal with keywords, and some
of the suggestions are good, but a lot of them require restrictions on the
allowed values, and the introduction of global namespaces, both of which I
would like to avoid. Keywords were introduced as a safer version of the
string parameters we had in Cactus 3 and earlier, and are currently setup
so you can change from string to keyword, or keyword to string, parameters
without having to change your code.
Future versions may use atoms and other tricks to make the comparisons
faster, but this is not going to change in 4.0. We should make sure that
new users are made aware of the fact that string comparisons are slow.
There was a case early in 4.0 when someone found a 400x speedup by moving
the CCTK_Equals out of the inner loop !
Tom
On Sun, 29 May 2005, Erik Schnetter wrote:
> On Sunday 29 May 2005 16:54, Jonathan Thornburg wrote:
>> It would be interesting to see some actual profile data on this.
>
> WaveToyFreeF90, checking the keyword parameter "bound" in the inner
> loop. The relevant parts of the profile on my notebook (Intel P3, 1200
> MHz) read
>
> Flat profile:
>
> Each sample counts as 0.01 seconds.
> % cumulative self self total
> time seconds seconds calls s/call s/call name
> 27.24 11.92 5.54 1200 0.00 0.01
> wavetoyfreef90_evolution_
> 15.31 15.04 3.12 26346003 0.00 0.00 Util_StrMemCmpi
> 12.05 17.48 2.45 26346003 0.00 0.00 cctk_equals_
>
> When I check a pre-decoded keyword, this becomes:
>
> Flat profile:
>
> Each sample counts as 0.01 seconds.
> % cumulative self self total
> time seconds seconds calls s/call s/call name
> 34.85 11.01 4.60 1200 0.00 0.00
> wavetoyfreef90_evolution_
>
> The time spend in checking the keyword parameter is 2.1e-7 seconds per
> call, equivalent to about 250 cycles, however many instructions these
> are on my processor.
>
> The physicist is interested in knowing that this slows down the
> evolution by more than a factor of two. Other evolution systems are
> more expensive, so that the keyword checking is, relatively seen, less
> expensive, but other evolution systems may also want to check multiple
> keyword parameters.
>
> -erik
>
>
More information about the Developers
mailing list