Opened 6 years ago

#1386 new defect

LocalInterp contains unneeded tests in the innermost interpolation loop

Reported by: Roland Haas Owned by:
Priority: optional Milestone:
Component: Cactus Version: development version
Keywords: LocalInterp Cc:


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
              "Datatype for input and/or output array with index %d "
              "is invalid", a);
  myretval = UTIL_ERROR_BAD_INPUT;

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.

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
as new The ticket will remain with no owner.
Next status will be 'review'.
as The resolution will be set.
to The owner will be changed from (none) to the specified user.
Next status will be 'confirmed'.
The owner will be changed from (none) to anonymous.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.