Restructure grid hierarchy properties

Create issue
Issue #442 closed
Erik Schnetter created an issue

Some time ago, someone (can't find the email right now) reported problems with CarpetRegrid2, where the grid structure may be inconsistent. I have restructured the code, but since this is a fairly invasive change I would like this to be thoroughly tested before committing it.

This change may lead to Carpet using a (slightly) different grid structure than before. The differences are not "important"; what potentially changes is the order in which consistency conditions are applied. I expect that, in most cases, there will be no differences. The list of consistency conditions is:

  • ensure proper nesting (level must be larger than next finer level)
  • add buffer zones (only once, not really a consistency condition)
  • combine regions into a single box (if this is efficient)
  • apply rotating 90/180 symmetry (if requested)
  • clip at outer boundary (so that boxes that are too large or are outside are cut off)

I attach a patch and four new files that implement this restructuring. Give it a try if you are interested.

Keyword:

Comments (7)

  1. Ian Hinder
    • removed comment

    The above files are not in a convenient form for applying to the repository. I am attaching a Mercurial patch file containing the changes instead.

  2. Ian Hinder
    • removed comment

    The original problem report might have been #419.

    I have tried the patches with an up-to-date Carpet with the qc0-mclachlan.par parameter file from the Einstein Toolkit "par" directory. I get the following fatal errors:

    cactus_timers: /home/ianhin/Cactus/llama/arrangements/CarpetHGTimers/CarpetRegrid2/src/property.cc:40: void CarpetRegrid2::property::enforce(const gh &, const dh &, const CarpetRegrid2:: level_boundary &, std::vector<bboxset<int, 3>, std::allocator<bboxset<int, 3>>> &, int): Assertion `test(hh, dd, bnd, regions, rl)' failed.

    The backtrace is

    Backtrace from rank 0 pid 12424: 1. /lib64/libc.so.6(gsignal+0x35) [0x2b1560b7d265] 2. /lib64/libc.so.6(abort+0x110) [0x2b1560b7ed10] 3. /lib64/libc.so.6(assert_fail+0xf6) [0x2b1560b766e6] 4. CarpetRegrid2::property::enforce(gh const&, dh const&, CarpetRegrid2::level_boundary const&, std::vector<bboxset<int, 3>, std::allocator<bboxset<int, 3> > >&, int)(./SIMFACTORY/cactus _timers) 5. CarpetRegrid2::Regrid(_cGH const*, std::vector<std::vector<region_t, std::allocator<region_t> >, std::allocator<std::vector<region_t, std::allocator<region_t> > > >&)(./SIMFACTORY/cac tus_timers) 6. ./SIMFACTORY/cactus_timers(CarpetRegrid2_RegridMaps+0x7d4) [0xe4fc44] 7. ./SIMFACTORY/cactus_timers(Carpet_RegridMaps+0x30) [0x65f850] 8. Carpet::Regrid(_cGH const*, bool, bool)(./SIMFACTORY/cactus_timers) 9. ./SIMFACTORY/cactus_timers [0x1388a0e] a. ./SIMFACTORY/cactus_timers [0x138b8fc] b. Carpet::Initialise(tFleshConfig*)(./SIMFACTORY/cactus_timers) c. ./SIMFACTORY/cactus_timers(main+0x99) [0x4d88c9] d. /lib64/libc.so.6(libc_start_main+0xf4) [0x2b1560b6a994] e. ./SIMFACTORY/cactus_timers [0x4d85e9]

    Before the patch, I got non-fatal warnings

    WARNING level 1 in thorn CarpetReduce processor 0 host kop151.datura.admin (line 120 of /home/ianhin/Cactus/llama/arrangements/CarpetHGTimers/CarpetReduce/src/mask_test.c): -> Simulation domain volume and reduction weight sum differ INFO (CarpetReduce): Simulation domain volume: 432000 INFO (CarpetReduce): Reduction weight sum: 431999.997947693

    but the run proceeded without crashing.

  3. Erik Schnetter reporter
    • removed comment

    The failing assertion means that the code attempts to enforce a property that is already holding. This should not happen.

    Unfortunately, the error does not indicate which property this is. I will have to update the patch to output something like typeid(*this).name() when there is an error.

  4. Erik Schnetter reporter
    • removed comment

    My analysis was wrong. The problem is that one of the properties doesn't hold after being enforced.

  5. Log in to comment