Re: small bug during restart

From: Volker Springel <volker_at_MPA-Garching.MPG.DE>
Date: Sat, 19 Mar 2011 09:05:17 +0100

Dear Yves,

Thank you very much for pointing this out! Thanks also for your very clear explanation and solution, which I agree with. (In fact, I have now updated the public gadget2 version accordingly, in version 2.0.7)

In investigating this, I noticed that I actually had discovered this little problem a long time ago, in my own development version of gadget2, and later gadget3, see my change log entry below... Annoyingly, I somehow missed to fix it in the public Gadget2 version as well.

Thanks again,
Volker

------------------------------------------------------------------------
r1731 | volker | 2005-07-09 13:10:21 +0200 (Sat, 09 Jul 2005) | 4 lines

fixed a problem with the new tree-update scheme and restarts: Since
NTopleaves hadn't been stored in the restart-files, a dynamic tree
update after a restart wasn't working correctly.

------------------------------------------------------------------------




On Mar 17, 2011, at 4:27 PM, Yves Revaz wrote:

>
> Dear Gadget list,
>
> I've found what looks like a little bug in version <=2.0.6 of Gadget.
> Fortunately, it has absolutly no impact on the physics. It is however important
> to be corrected.
>
> In some conditions, when restarting a simulation from the restart files
> (using option 1 in the command line), on can end up with different results,
> compared to the one we would obtain if the simulation was not stopped.
>
> This problem can be easily tested with the example "gassphere" or probably with
> any other example where the parameter TreeDomainUpdateFrequency is different from 0.
>
>
> After a deep investigation, the origin of the problem is the following :
>
> If, when a simulation is restarted, during the first step the domain
> decomposition is not performed, the tree is updated dynamically in the routine "move_particles":
>
> if (All.NumForcesSinceLastDomainDecomp < All.TotNumPart * All.TreeDomainUpdateFrequency)
> ...
>
> At this point, "force_update_pseudoparticles()" is called which in turn calls
> "force_treeupdate_pseudos()". In this latter routine, a loop over
> all Topleaves is performed using the variable NTopleaves.
> Unfortunately, the value of NTopleaves is set to 0 (undefined) when restarting
> from the restart files, because the tree has not been created and because
> NTopleaves is not stored in the restart files.
>
> In this case, "force_treeupdate_pseudos()" does nothing while it should normally slightly
> move the centers of the tree-cells.
>
> This generates a small difference (compared to the simulation that has not been stopped)
> that propagates and amplifies with time.
>
> In the other case, if, when a simulation is restarted, during the first step the domain decomposition
> is performed, NTopleaves is set correctly and no differences are observed.
>
>
> I think a simple solution to this problem will be to store NTopleaves in the
> restart files.
>
>
> With best regards,
>
> yves revaz
>
>
> --
> (o o)
> --------------------------------------------oOO--(_)--OOo-------
> Dr. Yves Revaz
> Laboratory of Astrophysics
> Ecole Polytechnique Fédérale de Lausanne (EPFL)
> Observatoire de Sauverny Tel : ++ 41 22 379 24 28
> 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05
> 1290 Sauverny e-mail : Yves.Revaz_at_epfl.ch
> SWITZERLAND Web : http://www.lunix.ch/revaz/
> ----------------------------------------------------------------
>
>
>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> minimalist_at_MPA-Garching.MPG.de with a subject of: unsubscribe gadget-list
> A web-archive of this mailing list is available here:
> http://www.mpa-garching.mpg.de/gadget/gadget-list
Received on 2011-03-19 09:05:18

This archive was generated by hypermail 2.3.0 : 2022-09-01 14:03:42 CEST