<div dir="ltr">Hi Roland,<br><div><br></div><div>Thanks for your response, which made me realize that the conformal factor is not </div><div>checkpointed, so the error makes perfect sense. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Also POST_RECOVER_VARIABLES only runs the scheduled function on<br>timelevel 0 (ie current time) and not any past timelevels so if there<br>are multiple time levels to the constraint variables, only tl=0 will be<br>initialized.</blockquote><div><br></div><div>In this specific case, I can either turn on checkpointing for the BSSN variables<br></div><div>in ProcaEvolve, or I can recompute them from the ADM ones after recovery.</div><div><div>What is the correct way to re-initialize a derived variable after recovery?</div><br class="gmail-Apple-interchange-newline"></div><div>Thanks,</div><div>Gabriele</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 3, 2022 at 2:13 PM Roland Haas &lt;<a href="mailto:rhaas80@gmail.com">rhaas80@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Gabriele,<br>
<br>
I seem to have trouble sending email to the ET mailing list server<br>
using my regular UIUC email address, so maybe using GMail will work<br>
better.<br>
<br>
Yours,<br>
Roland<br>
<br>
Begin forwarded message:<br>
<br>
Date: Sat, 1 Jan 2022 10:36:00 -0500<br>
From: Roland Haas &lt;<a href="mailto:rhaas@illinois.edu" target="_blank">rhaas@illinois.edu</a>&gt;<br>
To: Gabriele Bozzola &lt;<a href="mailto:bozzola.gabriele@gmail.com" target="_blank">bozzola.gabriele@gmail.com</a>&gt;<br>
Cc: Einstein Toolkit Users &lt;<a href="mailto:users@einsteintoolkit.org" target="_blank">users@einsteintoolkit.org</a>&gt;<br>
Subject: Re: [Users] PreSync and recovery from checkpoint<br>
<br>
<br>
Hello Gabriele,<br>
<br>
&gt; I have a fork of ProcaEvolve (<br>
&gt; <a href="https://urldefense.com/v3/__https://bitbucket.org/Sbozzolo/proca/src/master/__;!!DZ3fjg!oMcQru84TKsWMoY2YFsLTkLW7WfZuSfD9TnxLZdhbUwY8BR_fjy2ZykIwaXVaVGa$" rel="noreferrer" target="_blank">https://urldefense.com/v3/__https://bitbucket.org/Sbozzolo/proca/src/master/__;!!DZ3fjg!oMcQru84TKsWMoY2YFsLTkLW7WfZuSfD9TnxLZdhbUwY8BR_fjy2ZykIwaXVaVGa$</a> )<br>
&gt; where I added the READS/WRITES statements for<br>
&gt; PreSync and other features. One of such features<br>
&gt; is computing the constraint, but I found out that there<br>
&gt; is some problem when PreSync is running with<br>
&gt; `mixed-error`.  <br>
hmm.<br>
<br>
&gt; I have a write statement for chi in CCTK_INITIAL, which<br>
&gt; is not called when restarting a simulation. Nonetheless,<br>
&gt; chi should be available everywhere because it is read<br>
&gt; from a checkpoint. What is the correct thing to do in<br>
&gt; this scenario?  <br>
When grid functions are read in from a checkpoint then they are marked<br>
as being valid everywhere. This is done in CarpetIOHDF5/src/Input.cc in<br>
the Recover function in the block that starts with <br>
<br>
// check that all variables have been read completely on this<br>
mglevel/reflevel<br>
<br>
specifically in line 793 of that file:<br>
<br>
gf-&gt;set_valid(mglevel, reflevel, tl, CCTK_VALID_EVERYWHERE);<br>
<br>
If these variables are not checkpointed (likely, given that they are<br>
only constraints and thus not usually considered &quot;important&quot; to<br>
checkpoint) then you would have to add code to say<br>
POST_RECOVER_VARIABLES to initialize them (eg to 0). This is a good<br>
idea to do even without considering PreSync since it avoids having<br>
random junk data (or poison) in the constraint output for a couple of<br>
steps (depending on mesh refinement details) after recovery.<br>
<br>
Something like:<br>
<br>
schedule Proca_ClearConstraints AT POST_RECOVER_VARIABLES<br>
{<br>
  LANG: Fortran<br>
} &quot;Initialize constraint values after recovery&quot;<br>
<br>
You can also try to to Proca_Constraints in post-recover variables but,<br>
since the constraints require derivatives and those cannot be<br>
(correctly) computed in post-recover-variables, the constraints for the<br>
checkpointed timestep will (possibly I would have to think about<br>
exactly how checkpointing, prolongation and time stepping<br>
interact) differ before and after recovery. <br>
<br>
Also POST_RECOVER_VARIABLES only runs the scheduled function on<br>
timelevel 0 (ie current time) and not any past timelevels so if there<br>
are multiple time levels to the constraint variables, only tl=0 will be<br>
initialized.<br>
<br>
Yours,<br>
Roland<br>
<br>
-- <br>
My email is as private as my paper mail. I therefore support encrypting<br>
and signing email messages. Get my PGP key from <a href="http://keys.gnupg.net" rel="noreferrer" target="_blank">http://keys.gnupg.net</a>.<br>
<br>
<br>
-- <br>
My email is as private as my paper mail. I therefore support encrypting<br>
and signing email messages. Get my PGP key from <a href="http://keys.gnupg.net" rel="noreferrer" target="_blank">http://keys.gnupg.net</a>.<br>
</blockquote></div>