<html>#2639: CarpetLib internal error with PreSync and analysis thorns
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Samuel Cupp</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td>development version</td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Carpet</td></tr>
</table>

<p>Comment (by Samuel Cupp):</p>
<p>I’ve made some progress in tracking down the source of this error. The if(time within times min/max) statement tracks back to checking if</p>
<div class="codehilite"><pre><span></span><span>const CCTK_REAL time = cctkGH-&gt;cctk_time                                 (carpet/Carpet/src/Comm.cc:253)</span>
</pre></div>


<p>is inside</p>
<div class="codehilite"><pre><span></span><span>times.AT(i) = t.get_time(ml2, rl2, tl2s.AT(i))    (carpet/CarpetLib/src/ggf.cc:540)</span>
</pre></div>


<p>which has the length of</p>
<div class="codehilite"><pre><span></span><span class="n">tl2s</span><span class="o">:</span> <span class="n">tl2s</span><span class="o">.</span><span class="na">resize</span><span class="o">(</span><span class="n">prolongation_order_time</span> <span class="o">+</span> <span class="mi">1</span><span class="o">)</span>    <span class="o">(</span><span class="n">carpet</span><span class="sr">/CarpetLib/src/gg</span><span class="n">f</span><span class="o">.</span><span class="na">cc</span><span class="o">:</span><span class="mi">379</span><span class="o">)</span>
</pre></div>


<p>In this parfile, the first several reflevels are not subcycling, so they should all step at the same iterations. I’m printing out a lot of stuff since its inside these functions, so the first times I’m seeing for reflevel 0 are 0.15, and 0.3 (presumably its also running at the rk4 half-step, which is why i’m getting two times for each iteration on a single level). If I run it with PreSync off, I see these same times appear for all the ones moving in lockstep, and it then goes into smaller time discretizations once it reaches the subcycled reflevels.</p>
<p>However, this does not happen with PreSync. Instead, when it gets to reflevel 1, cctk_time returns a value of 1 instead of 0.15, which is not inside the bounds of that vector of times, causing the error. So somehow PreSync is affecting what <code>cctkGH-&gt;cctk_time</code> is.</p>
<p>I’m going to try to construct a simpler test case that still reproduces this now that I 
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2639/carpetlib-internal-error-with-presync-and'>https://bitbucket.org/einsteintoolkit/tickets/issues/2639/carpetlib-internal-error-with-presync-and</a></p>
</html>