Dear all,
I am writing to try to clarify a few issues that I've been facing regarding the schedule options "global loop-local" and "local" for an analysis thorn.
I have a thorn with a group scheduled as
schedule GROUP UAv_Analysis_Group at ANALYSIS after AHFinderDirect_maybe_do_masks
In this group, a function is dedicated to computing some grid functions:
schedule UAv_Analysis_gfs in UAv_Analysis_Group { LANG: Fortran SYNC: dE_gf_volume SYNC: dJ_gf_volume SYNC: quadrupole_gf_volume SYNC: density_rho SYNC: density_p } "Calculate grid functions"
I encounter some issue (described below) when using, in this schedule block, the option
OPTIONS: global loop-local
instead of the default "local". I was wondering about the "global loop-local" option because, in thorn ADMMass, it seems like the way to go (the schedule.ccl file contains comments about it). Using "local" yields the expected behavior, at least in the configurations which I have experimented with. Since I don't have a fine understanding of these options and how they affect the schedule, I'm willing to keep "local", and yearn to understand how to choose properly.
The problem that I'm facing with "global loop-local" is the following (all other things identical). I'm using a parameter file with Carpet, having 1 center and some refinement levels. My UAv_Analysis_gfs function contains an initial if statement that returns directly if cctk_iteration is not a multiple of a parameter do_analysis_every. The function sets a grid function called density_rho.
At the initial time, only the finest refinement level has initialized values. For later iterations, if do_analysis_every = 2^N, then for the output of density_rho, the finest level is initialized, the next N levels are uninitialized, and the remaining levels are initialized.
For instance, with CarpetRegrid2::num_levels_1 = 9 and do_analysis_every = 8, level 8 has values, levels 7, 6 and 5 don't, and levels 4 to 0 have values (except at iteration 0). In the extreme case do_analysis_every = 1, all levels have values. In the extreme case do_analysis_every = 256 (i.e every coarse level time step), only level 8 has values.
These issues do not occur with option "local".
Thank you for the insight and explanations that you can provide. I'm at your disposal for more information or details that could be useful.
Sincerely,
Jordan Nicoules
Hello Jordan,
instead of the default "local". I was wondering about the "global loop-local" option because, in thorn ADMMass, it seems like the way to go (the schedule.ccl file contains comments about it). Using "local" yields the expected behavior, at least in the configurations which I have experimented with. Since I don't have a fine understanding of these options and how they affect the schedule, I'm willing to keep "local", and yearn to understand how to choose properly.
Short answer: it's (mostly) only the output that is wrong (if you were to look at the data on the grid chances are it would look correct). But the data will never be exactly correct unless you compute things in EVOL.
Very long answer:
Scheduling with AMR and subcycling in time is fairly complicated.
As a general rule (there are very few exemptions, and ANALYSIS is not one of time):
* for each Cactus schedule bin (INITIAL, EVOL, POSTSTEP, ANALYSIS plus some others) the full schedule is executed for each iteration and each refinement level
* coarse refinement levels are executed *first* with finer refinement levels next
* scheduled functions with "OPTION: global" are executed exactly once for each iteration, either along with the coarsest refinement level for this iteration (early, forced by using global-early instead of global) or with the finest level (late, forced by using global-late instead of global) and skipped in the other traversals of the schedule, In ANALYSIS and POSTSTEP "global" is equivalent to "global-late" ie a scheduled routine marked as "global" will execute along with the "local" scheduled routines on the finest level.
* "loop-local" means that there will be an explicit loop over the refinement levels and the scheduled function will be called on each refinement level (and each grid component), in a similar manner to a "local" routine (but this will all happen at the same time as the *single* refinement level that "global" attaches to executes its scheduled functions)
* there's one more subtlety involved, namely there's a difference between EVOL and ANALYSIS concerning which refinement levels are considered eligible for execution. Basically speaking in EVOL a refinement level executes its scheduled grid functions if it is possible to evaluate the RHS of the equation of motion, while in ANALYSIS a grid function executes once evolution for that time has finished. In practise this means that for iteration=1 one evaluates the RHS for refinement level 0, 1, 2, ..., N since they all can evaluate the RHS (and the result is actually needed for boundary conditions for the finer levels), while *only* the finest level, refinement level N will have finished its evolution step at iteration 1 some only it will run in ANALYSIS.
So what ADMMass does (see the comments in there) is having to ensure some fixed ordering between functions that are global and those that need to access grid functions.
Specifically there is ADMMass_SetLoopCounter which is "global", so executes along with the *last* refinement level. Without the "global loop-local" the ADMMass_Surface scheduled function would run for each refinement level and thus would run on levels 0, 1, 2... before ADMMass_SetLoopCounter (which is "global" so runs at the same time as the finest level) has had a chance of running.
It's complicated.
The problem that I'm facing with "global loop-local" is the following (all other things identical). I'm using a parameter file with Carpet, having 1 center and some refinement levels. My UAv_Analysis_gfs function contains an initial if statement that returns directly if cctk_iteration is not a multiple of a parameter do_analysis_every. The function sets a grid function called density_rho.
At the initial time, only the finest refinement level has initialized values. For later iterations, if do_analysis_every = 2^N, then for the output of density_rho, the finest level is initialized, the next N levels are uninitialized, and the remaining levels are initialized.
For instance, with CarpetRegrid2::num_levels_1 = 9 and do_analysis_every = 8, level 8 has values, levels 7, 6 and 5 don't, and levels 4 to 0 have values (except at iteration 0). In the extreme case do_analysis_every = 1, all levels have values. In the extreme case do_analysis_every = 256 (i.e every coarse level time step), only level 8 has values.
Hmm, this should compute the correct values for most of the grid points. However my suspicion is that when you say that is does not contain the expected values then that is based on what you see in output files if you add some sort of `out_var = "dE_gf_volume"` to the parameter files, yes?
In that case you will indeed see bad data in output. Namely looking at the description above notice that "global" in ANALYSYS is "global-late" i.e. executes with the last refinement level (the finest one). However *output* is also done level by level, that is output for refinement level 0 is done first, along with all the scheduled functions for refinement level 0. So since your calculation with "global loop-local" runs *last*, things are not yet computed and you see old or garbage data in the output files.
These issues do not occur with option "local".
Correct (well at least nothing obviously wrong is output), in this case the data is computed just before it is output (but continue reading for some subtle errors).
*If* your calculations are all pointwise (not derivatives etc.) and you have only a *single* time level active for the grid functions that you compute *then* (and only then) can you compute things in ANALYSIS.
If your do_analysis_every variable is set such that things are *only* computed (and output, or otherwise used) when all refinement levels are in sync (ie every_coarse) then you can do a SYNC (but you still don't need more than 1 timelevel) without pulling in bad data. However your answer in parts of the grid will be wrong since there will not be any restriction of the data computed on a fine grid to the coarse grid (which happens only when going from EVOL to POSTSTEP). This matters only for stencil operations but not for operations that are pointwise local (since they'd compute the same value either way). This will (mostly...) not effect any interpolation results and will not (I think) affect reductions (min, max, norm2 whatnot). But ... this is very tricky.
The safest strategy is to compute everything in EVOL (not POSTSTEP), in particular if it involves stencil operations (in which case it is almost a requirement). You will need 3 timelevels though, at least if you plan on doing interpolations or reduction output at times other than every_coarse (and you need to compute at every iteration, or your are on very very thin ice).
Your schedule statement makes me suspect that your operation is not fully pointwise and does instead involve a stencil operation. In that case, the best you can achieve is making sure that there is only 1 time level for the variables and that you compute only when all refinement levels are in sync in time (so every coarse). Note that you will still get incorrect results in the regions of the coarse grid that are overlaid by the fine grid (no restriction so you are left with the result computed on the coarse grid), but that may not matter much to you.
Thank you for the insight and explanations that you can provide. I'm at your disposal for more information or details that could be useful.
If you could provide the actual schedule.ccl and param.ccl files this would be helpful. Right now I am at least partially guessing.
Yours, Roland
Dear Roland,
Thank you very much for your reply! It does help me understanding the situation better and making sense of what I see! I am attaching the schedule.ccl and param.ccl files. Please be aware that I'm not starting from scratch and that some portions have probably been inspired by other thorns, so I'm fully open to suggestions or corrections.
I have a few follow-up comments and questions. Unfortunately, I can't tune in to today's weekly meeting, but maybe eventually it will be easier to interact more directly through this means.
Short answer: it's (mostly) only the output that is wrong (if you were to look at the data on the grid chances are it would look correct). But the data will never be exactly correct unless you compute things in EVOL.
Hmm, this should compute the correct values for most of the grid points. However my suspicion is that when you say that is does not contain the expected values then that is based on what you see in output files if you add some sort of `out_var = "dE_gf_volume"` to the parameter files, yes?
By looking at the data on the grid, you mean like using a print in the code? Or is there another way through the parameter file? Indeed, what I was referring to was 'out_var = "density_rho"' in the parameter file.
*If* your calculations are all pointwise (not derivatives etc.) and you have only a *single* time level active for the grid functions that you compute *then* (and only then) can you compute things in ANALYSIS.
If your do_analysis_every variable is set such that things are *only* computed (and output, or otherwise used) when all refinement levels are in sync (ie every_coarse) then you can do a SYNC (but you still don't need more than 1 timelevel) without pulling in bad data. However your answer in parts of the grid will be wrong since there will not be any restriction of the data computed on a fine grid to the coarse grid (which happens only when going from EVOL to POSTSTEP). This matters only for stencil operations but not for operations that are pointwise local (since they'd compute the same value either way). This will (mostly...) not effect any interpolation results and will not (I think) affect reductions (min, max, norm2 whatnot). But ... this is very tricky.
The safest strategy is to compute everything in EVOL (not POSTSTEP), in particular if it involves stencil operations (in which case it is almost a requirement). You will need 3 timelevels though, at least if you plan on doing interpolations or reduction output at times other than every_coarse (and you need to compute at every iteration, or your are on very very thin ice).
Your schedule statement makes me suspect that your operation is not fully pointwise and does instead involve a stencil operation. In that case, the best you can achieve is making sure that there is only 1 time level for the variables and that you compute only when all refinement levels are in sync in time (so every coarse). Note that you will still get incorrect results in the regions of the coarse grid that are overlaid by the fine grid (no restriction so you are left with the result computed on the coarse grid), but that may not matter much to you.
To clarify: The density_rho and density_p grid functions are computed for output purposes. The variables dE_gf_volume, ... are auxiliary grid functions which are used to compute total_energy, ... through a sum reduction. So those only really make sense every coarse time step, thus do_analysis_every should indeed be a multiple of every_coarse. I used a smaller one only for debugging and understanding purposes. By the way, is "every_coarse" an actual parameter that I could call, for instance in a ParamCheck function, to ensure that do_analysis_every is well-chosen indeed? Or is that ultimately up to the user to properly design the parameter file?
All operations are indeed pointwise, there are no derivatives involved. Even though the GF variables are defined with 3 time levels, it feels to me that only one is necessary indeed (unless I'm missing something, but these are not evolved variables). Do I understand correctly then, that in that case I will not get incorrect results in the regions of the coarse grid that are overlaid by the fine grid? In particular, as I compute the sum reduction of dE_gf_volume to get the integral total_energy, the result I get is very sensible. I was wondering if the reduction operation was somehow "magically" navigating the finer levels behind the scenes, but from what you say, it really does only the reduction on the coarser level, doesn't it?
I'm also not sure about the SYNC then. In the routine UAv_Analysis_gfs, the loop actually excludes ghost zones, in the fashion of do k = 1+cctk_nghostzones(3), cctk_lsh(3)-cctk_nghostzones(3) so it may seem pointless, except for visualization purposes, right? (for instance, in VisIt)
Given the properties and goals of the quantities I'm using, and what you said, it sounds like I could leave that in ANALYSIS. But you seemed to favor EVOL. What would now be your advice, with the additional information? I still need to get the mask from AHFinderDirect, and from my understanding of the param.ccl of this thorn, it's at best run at POSTSTEP, isn't it?
Many thanks once again!
Best,
Jordan
Hello Jordan,
By looking at the data on the grid, you mean like using a print in the code? Or is there another way through the parameter file? Indeed, what I was referring to was 'out_var = "density_rho"' in the parameter file.
Yes, if you were to add a printf (or so) statement then you would see the data on the grid eg during the next iteration (or in another `global loop-local` routine in ANALYS, but not in a `local` routine in ANALYSIS which would have the same issue as output).
To clarify: The density_rho and density_p grid functions are computed for output purposes. The variables dE_gf_volume, ... are auxiliary grid functions which are used to compute total_energy, ... through a sum reduction. So those only really make sense every coarse time step, thus do_analysis_every should indeed be a multiple of every_coarse. I used a smaller one only for debugging and understanding purposes. By the way, is "every_coarse" an actual parameter that I could call, for instance in a ParamCheck function, to ensure that do_analysis_every is well-chosen indeed?
No, there is not predefined such variable. It is just a "speaking" variable name.
Or is that ultimately up to the user to properly design the parameter file?
It is up to the user. You can define some helper variables if you like in parameter files eg like so:
$every_coarse = 2**(Carpet::max_num_levels - 1)
assuming all your time_refinement_factors are 2. It is up to the user to ensure that this is correct though.
All operations are indeed pointwise, there are no derivatives involved. Even though the GF variables are defined with 3 time levels, it feels to me that only one is necessary indeed (unless I'm missing something, but these are not evolved variables).
The 3 time levels would be used for interpolation in time if you ask for reduction output at timesteps that are not coarse time steps.
Do I understand correctly then, that in that case I will not get incorrect results in the regions of the coarse grid that are overlaid by the fine grid? In particular, as I compute the sum reduction of dE_gf_volume to get the integral total_energy, the result I get is very sensible. I was wondering if the reduction operation was somehow "magically" navigating the finer levels behind the scenes, but from what you say, it really does only the reduction on the coarser level, doesn't it?
It does navigate the finer levels. The "sum" reduction computes a Riemann sum taking the (relative) volume of grid cells on the refinement levels into account. It also takes care of removing double-counting due to the overlapping fine / coarse grids.
In your case, purely pointwise calculation, all will be fine and the answer will be correct.
For non-pointwise operations there is one point where you fill get very slightly different answer than what would be most correct: at the last fine grid point, where the grid transitions to the coarse grid the data will be slightly wrong since for that one location both the coarse and the fine grid contribute half a grid cell each but the coarse grid data has not been updated via restriction from the fine, so will result in slightly different answers than expected.
Basically if I try and draw this and give the weight that is used for each grid cell then this is what things look like:
transition v
fine level : x x x x x weight: 1/2 1 1 1 1/2 cell boundary: ^ ^ ^ ^ ^ ^ integration: |***************|
coarse level: x x x x x weight 1 1/2 0 1/2 1 cell boundary: ^ ^ ^ ^ ^ integration: **************| |******************
So you can see that for the cell that I have marked with "transition" when it comes to the Riemann sum, half the contribution should come from the fine grid (the right hand half of the fine cell centered at that location) and half from the coarse grid (the left hand half of the coarse cell centered at that same location).
Without the restriction the answer computed on the coarse grid for the grid point marked by the "transition" marker, will be slightly different (since the grid spacing is larger, the neighbouring values are different) than on the fine grid. For a purely pointwise calculation the same number will be computed on the fine and one the coarse grid.
I'm also not sure about the SYNC then. In the routine UAv_Analysis_gfs, the loop actually excludes ghost zones, in the fashion of do k = 1+cctk_nghostzones(3), cctk_lsh(3)-cctk_nghostzones(3) so it may seem pointless, except for visualization purposes, right? (for instance, in VisIt)
A SYNC will fill in values for the ghost zones and mesh refinement boundaries. Those are indeed used by visualization. They are skipped by reductions.
Note that by using
k = 1+cctk_nghostzones(3),cctk_lsh(3)-cctk_nghostzones(3)
you are also skipping a layer of ghost points at the outer (physical) boundaries, and those *will* be used by the reduction (or at least the innermost boundary point will be used, with a weight of 1/2).
Given the properties and goals of the quantities I'm using, and what you said, it sounds like I could leave that in ANALYSIS.
For just output you are fine. You cannot use anything computed in ANALYSIS in EVOL though (or at least it may not be what you expect it to be).
But you seemed to favor EVOL.
EVOL is safer since it can be used both in EVOL and in ANALYSIS / POSTSTEP, and is the only option for anything involving derivatives. So if you ask which option to choose and I do not want / cannot safely give you the detailed reasoning above / actually verify that things work as I think they should, I'll err on the side of caution. Note that CCTK_POSTSTEP and MoL_PostStep are very different.
What would now be your advice, with the additional information? I still need to get the mask from AHFinderDirect, and from my understanding of the param.ccl of this thorn, it's at best run at POSTSTEP, isn't it?
AHFinderDirect sets the mask in either ANALSYIS or POSTSTEP (depending on parameters). For modern codes ANALYSIS and POSTSTEP are identical (scheduled routines in ANALYSIS could use a TRIGGER but that one runs into the same problems I warned you about so it is not used nowadays anymore).
AHFidnerDirect reads variables that were set in EVOL (ADMBase variables) and then can set variables (ahmask, the spherical surfaces) that are usable in ANALYSIS / POSTSTEP (the mask). Using the mask (or spherical surface for that matter) in EVOL can be tricky, it will only kind of work if there is only one time level in which case the previous value of the mask will be used in EVOL.
Yours, Roland
Hi Roland,
Thank you very much once again for the detailed answer!
In the meantime, I had a look at CarpetReduce's reduce.cc. Without going into full details, I could understand that reductions would indeed go through the various levels, with the correct multiplicative factor, as I first thought. But your explanation adds another layer of understanding.
While I'm at it, I would like to ask another question that came up during this experimentation process, regarding ghost points.
I could notice that at the first iteration which completes a time step for a given level - for instance, level N at iteration 1, level N-1 at iteration 2, level N-2 at iteration 4... - some points of density_rho at the edge of the refinement level were still uninitialized. I can see that this doesn't happen for evolved variables, or when UAv_Analysis_group is scheduled in EVOL (drawing inspiration from mclachlan's ML_ADMConstraints, I put it in MoL_PseudoEvolution after MoL_PostStep for experimentation).
While I assumed that there would be ghost_size such points, some quick experiments rather seemed to indicate ~3*ghost_size points. I could notice that the last points with actual values, correspond to points with coordinates \pm CarpetRegrid2::radius_1[i], where the proper end of the grid corresponds to the grid structure given in the standard output (and recovered with Kuibit, VisIt).
For example, with
CoordBase::dx = 1.0
driver::ghost_size = 3
CarpetRegrid2::radius_1[1] = 24.0
then level 1 extends up to 28.5, which is 9 points away from x=24.
Now, since UAv_Analysis variables focus on output at least every_coarse iterations, I was not too worried by this specifically. However, I have also noticed this pattern when looking at LeanBSSNMoL::ham for instance. I can see constraint violations related to level boundaries, which I expected. But they match with CarpetRegrid::radius_1[i], and not with the grid structure, a feature which I found puzzling. I can see that at iteration 0 already.
Would you have some more explanation about this please?
Best,
Jordan
________________________________ From: Roland Haas rhaas@illinois.edu Sent: Friday, September 27, 2024 21:53 To: Jordan Nicoules Cc: users@einsteintoolkit.org Subject: Re: [Users] Schedule options and uninitialized refinement levels
Hello Jordan,
By looking at the data on the grid, you mean like using a print in the code? Or is there another way through the parameter file? Indeed, what I was referring to was 'out_var = "density_rho"' in the parameter file.
Yes, if you were to add a printf (or so) statement then you would see the data on the grid eg during the next iteration (or in another `global loop-local` routine in ANALYS, but not in a `local` routine in ANALYSIS which would have the same issue as output).
To clarify: The density_rho and density_p grid functions are computed for output purposes. The variables dE_gf_volume, ... are auxiliary grid functions which are used to compute total_energy, ... through a sum reduction. So those only really make sense every coarse time step, thus do_analysis_every should indeed be a multiple of every_coarse. I used a smaller one only for debugging and understanding purposes. By the way, is "every_coarse" an actual parameter that I could call, for instance in a ParamCheck function, to ensure that do_analysis_every is well-chosen indeed?
No, there is not predefined such variable. It is just a "speaking" variable name.
Or is that ultimately up to the user to properly design the parameter file?
It is up to the user. You can define some helper variables if you like in parameter files eg like so:
$every_coarse = 2**(Carpet::max_num_levels - 1)
assuming all your time_refinement_factors are 2. It is up to the user to ensure that this is correct though.
All operations are indeed pointwise, there are no derivatives involved. Even though the GF variables are defined with 3 time levels, it feels to me that only one is necessary indeed (unless I'm missing something, but these are not evolved variables).
The 3 time levels would be used for interpolation in time if you ask for reduction output at timesteps that are not coarse time steps.
Do I understand correctly then, that in that case I will not get incorrect results in the regions of the coarse grid that are overlaid by the fine grid? In particular, as I compute the sum reduction of dE_gf_volume to get the integral total_energy, the result I get is very sensible. I was wondering if the reduction operation was somehow "magically" navigating the finer levels behind the scenes, but from what you say, it really does only the reduction on the coarser level, doesn't it?
It does navigate the finer levels. The "sum" reduction computes a Riemann sum taking the (relative) volume of grid cells on the refinement levels into account. It also takes care of removing double-counting due to the overlapping fine / coarse grids.
In your case, purely pointwise calculation, all will be fine and the answer will be correct.
For non-pointwise operations there is one point where you fill get very slightly different answer than what would be most correct: at the last fine grid point, where the grid transitions to the coarse grid the data will be slightly wrong since for that one location both the coarse and the fine grid contribute half a grid cell each but the coarse grid data has not been updated via restriction from the fine, so will result in slightly different answers than expected.
Basically if I try and draw this and give the weight that is used for each grid cell then this is what things look like:
transition v
fine level : x x x x x weight: 1/2 1 1 1 1/2 cell boundary: ^ ^ ^ ^ ^ ^ integration: |***************|
coarse level: x x x x x weight 1 1/2 0 1/2 1 cell boundary: ^ ^ ^ ^ ^ integration: **************| |******************
So you can see that for the cell that I have marked with "transition" when it comes to the Riemann sum, half the contribution should come from the fine grid (the right hand half of the fine cell centered at that location) and half from the coarse grid (the left hand half of the coarse cell centered at that same location).
Without the restriction the answer computed on the coarse grid for the grid point marked by the "transition" marker, will be slightly different (since the grid spacing is larger, the neighbouring values are different) than on the fine grid. For a purely pointwise calculation the same number will be computed on the fine and one the coarse grid.
I'm also not sure about the SYNC then. In the routine UAv_Analysis_gfs, the loop actually excludes ghost zones, in the fashion of do k = 1+cctk_nghostzones(3), cctk_lsh(3)-cctk_nghostzones(3) so it may seem pointless, except for visualization purposes, right? (for instance, in VisIt)
A SYNC will fill in values for the ghost zones and mesh refinement boundaries. Those are indeed used by visualization. They are skipped by reductions.
Note that by using
k = 1+cctk_nghostzones(3),cctk_lsh(3)-cctk_nghostzones(3)
you are also skipping a layer of ghost points at the outer (physical) boundaries, and those *will* be used by the reduction (or at least the innermost boundary point will be used, with a weight of 1/2).
Given the properties and goals of the quantities I'm using, and what you said, it sounds like I could leave that in ANALYSIS.
For just output you are fine. You cannot use anything computed in ANALYSIS in EVOL though (or at least it may not be what you expect it to be).
But you seemed to favor EVOL.
EVOL is safer since it can be used both in EVOL and in ANALYSIS / POSTSTEP, and is the only option for anything involving derivatives. So if you ask which option to choose and I do not want / cannot safely give you the detailed reasoning above / actually verify that things work as I think they should, I'll err on the side of caution. Note that CCTK_POSTSTEP and MoL_PostStep are very different.
What would now be your advice, with the additional information? I still need to get the mask from AHFinderDirect, and from my understanding of the param.ccl of this thorn, it's at best run at POSTSTEP, isn't it?
AHFinderDirect sets the mask in either ANALSYIS or POSTSTEP (depending on parameters). For modern codes ANALYSIS and POSTSTEP are identical (scheduled routines in ANALYSIS could use a TRIGGER but that one runs into the same problems I warned you about so it is not used nowadays anymore).
AHFidnerDirect reads variables that were set in EVOL (ADMBase variables) and then can set variables (ahmask, the spherical surfaces) that are usable in ANALYSIS / POSTSTEP (the mask). Using the mask (or spherical surface for that matter) in EVOL can be tricky, it will only kind of work if there is only one time level in which case the previous value of the mask will be used in EVOL.
Yours, Roland
-- My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from http://pgp.mit.edu .
Hello Jordan,
I could notice that at the first iteration which completes a time step for a given level - for instance, level N at iteration 1, level N-1 at iteration 2, level N-2 at iteration 4... - some points of density_rho at the edge of the refinement level were still uninitialized. I can see that this doesn't happen for evolved variables, or when UAv_Analysis_group is scheduled in EVOL (drawing inspiration from mclachlan's ML_ADMConstraints, I put it in MoL_PseudoEvolution after MoL_PostStep for experimentation).
That is likely due to having more than 1 refinement level, running in ANALYSIS/POSTSTEP, and not computing everywhere and instead using SYNC.
Since the data required for interpolation into the edge layer of a refinement level is coming from the next coarser level and that one is not computed in time in the ANALYSIS/POSTSTEP bin (but is in the EVOL bin).
While I assumed that there would be ghost_size such points, some quick experiments rather seemed to indicate ~3*ghost_size points. I could notice that the last points with actual values, correspond to points with coordinates \pm CarpetRegrid2::radius_1[i], where the proper end of the grid corresponds to the grid structure given in the standard output (and recovered with Kuibit, VisIt).
Should be 4 times actually. At least if you use RK4 with 4 substeps. The SYNC can only fill in those points after the full RK4 timestep and not during the RK substeps. Thus with 4 substeps it needs to fill in 4*ghost_size points. It cannot fill in during each substep without losing convergence order in time.
then level 1 extends up to 28.5, which is 9 points away from x=24.
If you look at HDF5 output and ask to not have ghosts output then you may be missing 3 points from the output file.
Now, since UAv_Analysis variables focus on output at least every_coarse iterations, I was not too worried by this specifically.
ok.
However, I have also noticed this pattern when looking at LeanBSSNMoL::ham for instance. I can see constraint violations related to level boundaries, which I expected. But they match with CarpetRegrid::radius_1[i], and not with the grid structure, a feature which I found puzzling. I can see that at iteration 0 already.
See above. The extra points outside of radius_1 are buffer points and a layer of ghost points (all of which are filled in via interpolation from the next coarsest).
See the Carpet paper https://arxiv.org/abs/gr-qc/0310042 section section C.
Would you have some more explanation about this please?
Please let me know if the above is sufficient.
Yours, Roland
Hi Roland,
Thank you again for your reply, for the explanation and the paper. I was not aware of the use of buffer points related to time integration substeps.
then level 1 extends up to 28.5, which is 9 points away from x=24.
If you look at HDF5 output and ask to not have ghosts output then you may be missing 3 points from the output file.
I am looking at HDF5 output, and I have the default "yes" for IOHDF5::output_ghost_zones. I tried to change it to "no" but this did not change this feature of the output.
Please let me know if the above is sufficient.
I think it is, thank you! I'm still a bit puzzled by the fact that I don't get 4*ghost_size points as you explained, but for now, I think it is enough for me to understand where these "extra" points come from.
Best,
Jordan
Hello Jordan,
If you look at HDF5 output and ask to not have ghosts output then you may be missing 3 points from the output file.
I am looking at HDF5 output, and I have the default "yes" for IOHDF5::output_ghost_zones. I tried to change it to "no" but this did not change this feature of the output.
Hmm, odd. Not quite sure what is going on here.
Please let me know if the above is sufficient.
I think it is, thank you! I'm still a bit puzzled by the fact that I don't get 4*ghost_size points as you explained, but for now, I think it is enough for me to understand where these "extra" points come from.
ok. Glad to have been able to help.
Yours, Roland
users@lists.einsteintoolkit.org