parameter file parser does not use correct value for parameters in equations

Issue #1328 closed
Roland Haas created an issue

The attached (three line) parfile fails with:

WARNING level 0 in thorn Cactus processor 0 host horizon.tapir.caltech.edu
  (line 201 of /mnt/data/rhaas/postdoc/gr/Zelmani/src/main/ProcessParameterDatabase.c): 
  -> CCTKi_SetParameterSetMask: 1 major error in parameter file

ie it does not properly use the just set value "2" of carpet::ghost_zone and instead uses the default of "-1".

I attach parfile and test output. This is very unfortunate since it means that the code silently (if the default ghost_size had been valid input for boundary_x_size_lower) uses wrong parameter values.

Keyword:

Comments (6)

  1. Steven R. Brandt
    • removed comment

    The attached patch will actually fix tickets #1290, #1328, and #1324 together.

    It contains the fix already attached to #1290, plus another one. Previously, I was maintaining a cache of values set by the parser and using them to get old values rather than ParameterGet. This strategy fails the moment one uses an impl name to set a par value and a thorn name to get it (as in the attached). It was probably a bad idea anyway. In the process of changing this I corrected a variable initialization problem which was the result of Roland's core dump.

    A side effect of this fix was my discovery that I'd committed a bad test to the TestPar thorn. TestPar::bool1[3] should evaluate to 0/False.

    TestPar::int2[3] = -12*(23%11 + 17) TestPar::bool1[3] = TestPar::int2[3]>0 || -1 >= 10

  2. Log in to comment