[ET Trac] #2653: Carpet PreSync triggering syncs for all refinement levels unnecessarily

Samuel Cupp trac-noreply at einsteintoolkit.org
Wed Oct 5 14:11:37 CDT 2022


#2653: Carpet PreSync triggering syncs for all refinement levels unnecessarily

 Reporter: Samuel Cupp
   Status: new
Milestone: 
  Version: 
     Type: bug
 Priority: major
Component: Carpet

Comment (by Samuel Cupp):

I attempted to put in some logic to check whether it should actually call SyncProlongateBoundaries. Leaving the recursion loop unchanged, I have

```
  std::vector<int> check_groups;
  std::set<int> tmpgroups;
  for (int g = 0; g < pre_groups.size(); g++) {
    int gi = pre_groups[g];
    for (int vi = 0; vi < CCTK_NumVarsInGroupI(gi); vi++) {
      int const map0 = 0;
      ggf *const ff = arrdata.AT(gi).AT(map0).data.AT(vi);
      assert(ff);
      int const valid = ff->valid(mglevel, reflevel, timelevel);
      if (not is_set(valid, CCTK_VALID_EVERYWHERE)) {
        tmpgroups.insert(gi);
        break;
      }
    }
  }
  check_groups.assign(tmpgroups.begin(), tmpgroups.end());
  if(!check_groups.empty()) {
  // ask Carpet to do the SYNC, this will apply BC as well
  SyncProlongateGroups(cctkGH, check_groups, attribute);
  }
```

This loops over the groups in pre\_groups. It then loops over the variables in each group and checks if they are valid everywhere. If not, then the group is added to tmpgroups and the loops are cycled to the next group. At the end, the vector check\_groups is assigned all the group indices that need to be passed on. I mimicked what is done in the PreCheckValid function, so all of this should be fine.

I did this here because it will be a bit more complicated to do it in SyncProlongateBoundaries because we will have to do it separately for syncs and BC application. There’s also a ProlongateBoundaries call that I don’t know what logic I would need to use.

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2653/carpet-presync-triggering-syncs-for-all
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/trac/attachments/20221005/1bfc6860/attachment.html 


More information about the Trac mailing list