[ET Trac] [Einstein Toolkit] #1386: LocalInterp contains unneeded tests in the innermost interpolation loop
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Tue Jun 18 22:47:47 CDT 2013
#1386: LocalInterp contains unneeded tests in the innermost interpolation loop
-------------------------+--------------------------------------------------
Reporter: rhaas | Owner:
Type: defect | Status: new
Priority: optional | Milestone:
Component: Cactus | Version: development version
Keywords: LocalInterp |
-------------------------+--------------------------------------------------
in lines 584 ff of Interpolate.c the code tests:
{{{
/* check for valid input and output array type */
if (in_types[a] < 0 || out_types[a] < 0)
{
#pragma omp critical
CCTK_VWarn (1, __LINE__, __FILE__, CCTK_THORNSTRING,
"Datatype for input and/or output array with index %d "
"is invalid", a);
myretval = UTIL_ERROR_BAD_INPUT;
continue;
}
}}}
for each point. However test needs only be done once for each input array
so could be moved outside of the innermost loop. There are several similar
tests further down in the file that could be moved outside of the loop
over points. Similarly one could replace the if() on variable types by C++
tmeplates on the type (and order of interpolation) which would also only
be worhtwhile for very heavy uses of the interpolator.
Only really an issue for a client thorn that does very many
interpolations.
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1386>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list