<div dir="ltr">Jens<div><br></div><div>A global reduction operations accesses data on grid function from all levels and all processes. You thus need to make sure that all such data is calculated before, and that the respective grid functions still have storage. Reduction operations might also access boundary data, so you should also apply proper boundary conditions to the reduced variables beforehand. A schedule tag "option: global-late" might be required to ensure this, in addition to the respective "after" schedule modifiers.</div><div><br></div><div>Also, since you are calculating an average: In what sense do you want this average to be defined? Are you interested in the average over all respective grid points, or should the average be scaled with the volume of grid cells (which are much larger on coarse cells)? How do you expect the average to change if you change the resolution? How do you expect it to change if part of the domain is refined? Do you view the average as a quantity that is fundamentally only defined in the discrete, or is it a discretized approximation of an underlying quantity defined in the continuous, i.e. via an integral? These questions will help us decide whether "average" is the right reduction operation, or whether "iaverage" or a combination of several reduction operations would be more appropriate.</div><div><br></div><div>-erik</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 1, 2018 at 6:51 AM, Jens Mahlmann <span dir="ltr"><<a href="mailto:jensmahl@alumni.uv.es" target="_blank">jensmahl@alumni.uv.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Dear all,</p>
<p>I am currently trying to use the results of a global reduction
operation (average) during runtime for the derivation of source
terms.</p>
<p>Especially, I run <br>
</p>
<p><b><font size="-1"> if (CCTK_Reduce(cctkGH, -1,
CCTK_ReductionHandle("average"<wbr>), 1,<br>
CCTK_VARIABLE_REAL,<br>
magvaravg, 1,<br>
CCTK_VarIndex("FFEvolve::<wbr>magvar")))<br>
CCTK_WARN(0, "Error while reducing FFEvolve::magvaravg");</font></b></p>
<p>with OPTION:GLOBAL prior to my source term derivation (especially
not in the Analysis schedule block). However, this basically gives
me NaNs during runtime. Still, when I produce output of the
respective quantities, everything works fine - it seems that only
the quantity storing the average value is not available for all
processes during runtime.</p>
<p>Maybe you have a hint for me - I am sure I am missing something
basic.</p>
<p>Thank you very much for your input and my best from Valencia</p><span class="HOEnZb"><font color="#888888">
<p>Jens<br>
</p>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@einsteintoolkit.org">Users@einsteintoolkit.org</a><br>
<a href="http://lists.einsteintoolkit.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.einsteintoolkit.<wbr>org/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Erik Schnetter <<a href="mailto:schnetter@gmail.com" target="_blank">schnetter@gmail.com</a>></div><div><a href="http://www.perimeterinstitute.ca/personal/eschnetter/" target="_blank">http://www.perimeterinstitute.ca/personal/eschnetter/</a><br></div><div><br></div></div></div></div></div>
</div>