Optimise calls to CCTK_VarDataPtr

Issue #1143 closed
Erik Schnetter created an issue

Cactus calls CCTK_VarDataPtr each time DECLARE_CCTK_ARGUMENTS is executed for each grid function. This routine performs string looks and is thus unreasonably expensive.

The attached patch remembers variable indices in static variables.

Keyword:

Comments (4)

  1. Steven R. Brandt
    • changed status to open
    • removed comment

    Changes the previous method of doing hundreds of string compares on each function invocation to finding and caching the variable index in a static variable.

  2. Log in to comment