Kranc's Differencing.h fails to compile if KRANC_DIFF_FUNCTIONS is defined

Create issue
Issue #1514 closed
Roland Haas created an issue

the error is not passing the correct number of arguments:

In file included from /mnt/data/rhaas/postdoc/gr/ET_trunk/configs/sim/build/ML_BSSN/ML_BSSN_Advect.cc:14:0:
/mnt/data/rhaas/postdoc/gr/ET_trunk/arrangements/McLachlan/ML_BSSN/src/Differencing.h: In function 'double PDupwindNthfdOrder23_impl(const double*, double, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t)':
/mnt/data/rhaas/postdoc/gr/ET_trunk/arrangements/McLachlan/ML_BSSN/src/Differencing.h:1043:56: error: too few arguments to function 'double PDupwindNthfdOrder22_impl(const double*, double, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t, ptrdiff_t)'
   return PDupwindNthfdOrder22_impl(u, pm1o2dz, cdk, cdj);
                                                        ^
/mnt/data/rhaas/postdoc/gr/ET_trunk/arrangements/McLachlan/ML_BSSN/src/Differencing.h:884:18: note: declared here
 static CCTK_REAL PDupwindNthfdOrder22_impl(const CCTK_REAL* restrict const u, const CCTK_REAL pm1o2dy, const ptrdiff_t cdj, const ptrdiff_t cdk, const ptrdiff_t dir1, const ptrdiff_t dir2, const ptrdiff_t dir3)
                  ^

which indeed does not pass any of dir1 -- dir3.

Nothing currently uses KRANC_DIFF_FUNCTIONS however so this is a bug in unused code.

To reproduce disable UseVectors in McLachlan_BSSN.m and add

#define KRANC_DIFF_FUNCTIONS

at the top of arrangements/McLachlan/ML_BSSN/src/Differencing.h once Kranc finishes.

Keyword:

Comments (3)

  1. Erik Schnetter
    • removed comment

    KRANC_DIFF_FUNCTIONS is used by thorn Vectors. For historic reasons, the decision whether to inline Kranc's derivative operators (speed) or not (reduce code size) is made by thorn Vectors. On systems with a small CPU cache (e.g. Intel CPUs, and the new AMD CPUs), not inlining can greatly improve performance.

    In fact, the default for inlining is no, which should lead to KRANC_DIFF_FUNCTIONS being defined. This should happen e.g. on Bethe (Caltech).

  2. Roland Haas reporter
    • changed status to resolved
    • removed comment

    The bug requires UseVectors = False in McLachlan_BSSN.m. However UseVectors is currently hard-coded to "True" in the Mathematica script. I only turned it off since I wanted readable C code to try some low-level changes on the generated code before trying to understand how Kranc generates Differencing.h. So as far as I can tell the bug should not occur on with any unmodified Mathematica script. Actually, come to think of it: this is a Kranc bug and should be reported on github. Moving there...

  3. Log in to comment