[Carpet] when does Carpet call scheduled routines?

Erik Schnetter schnetter at cct.lsu.edu
Sun May 7 00:14:21 CEST 2006


On May 6, 2006, at 15:33:12, Jonathan Thornburg wrote:

> Hi, Erik,
>
>> Correct.  This is, in fact, the surprising part, namely that the  
>> schedule
>> (including its before, after, and while statements) only refer to  
>> other
>> schedule items at the same level; what happens between levels is  
>> governed by
>> the Berger-Oliger scheme, not by the schedule.
> [[...]]
>> The dependencies between schedule items refer only to other schedule
>> items at the same refinement levels.  A schedule dependency "A before
>> B" means that, on a level L, A is executed before B.  However, at the
>> same iteration, A on level L+1 can also occur after B on level L.
>
> Ok, I think I now understand your point here.
>
>
> I'm still unclear about just *why* Carpet does some of the Berger- 
> Oliger
> algorithm the way it does:  For definiteness, suppose I have 1  
> mglevel,
> 3 reflevels (coarse, medium, and fine), 1 map in each reflevel, and
> 1 component in each map.
>
> I've used a test thorn (which just schedules a dummy print-a-message
> routine in each bin) to determine the actual order in which Carpet  
> walks
> the schedule bins for the initial-data setup, and it's this:
>
>       1          BASEGRID (coarse)
>       2          INITIAL  (coarse)
>       3          Regrid
>       4          POSTREGRID (coarse)
>       5                          BASEGRID (medium)
>       6                          INITIAL  (medium)
>       7                          Regrid
>       8                          POSTREGRID (medium)
>       9                                          BASEGRID (fine)
>      10                                          INITIAL  (fine)
>      11                                          Regrid
>      12                                          POSTREGRID (fine)
>      13          POSTRESTRICTINITIAL (coarse)
>      14          POSTINITIAL (coarse)
>      15          POSTSTEP    (coarse)
>      16                          POSTRESTRICTINITIAL (medium)
>      17                          POSTINITIAL (medium)
>      18                          POSTSTEP    (medium)
>      19                                          POSTINITIAL (fine)
>      20                                          POSTSTEP    (fine)
>
> Why are POSTRESTRICTINITIAL, POSTINITIAL, and POSTSTEP walked in the
> direction coarse --> fine, rather than fine --> coarse as would be
> the case for a purely recursive algorithm?

People may need to apply boundary conditions.  Prolongation  
boundaries interpolate from coarser grids, hence the coarser grids  
need to be treated first.  In a truly recursive scheme, people would  
have to sort out their routines to not apply any boundary conditions  
as they move up the hierarchy -- this is very cumbersome in practice  
(and also not necessary).

> I have a similar question for the time-evolution loop.  Here, for a
> single coarse-grid time step my test thorn gives the order:
>
>       1          Regrid
>       2          POSTREGRID (t=0, coarse)
>       3                          Regrid
>       4                          POSTREGRID (t=0, medium)
>       5                                          Regrid
>       6                                          POSTREGRID (t=0,  
> fine)
>       7          POSTSTEP (t=0, coarse)
>       8                          POSTSTEP (t=0, medium)
>       9                                          POSTSTEP (t=0, fine)
> ----- entering evolution loop -----
>      10          PRESTEP (t=1, coarse)
>      11          EVOL    (t=1, coarse)
>      12                          PRESTEP (t=0.5, medium)
>      13                          EVOL    (t=0.5, medium)
>      14                                          PRESTEP (t=0.25,  
> fine)
>      15                                          EVOL    (t=0.25,  
> fine)
>      16                                          POSTSTEP(t=0.25,  
> fine)
>      17                                          PRESTEP (t=0.5 ,  
> fine)
>      18                                          EVOL    (t=0.5 ,  
> fine)
>      19                          POSTRESTRICT (t=0.5, medium)
>      20                          POSTSTEP(t=0.5, medium)
>      21                                          POSTSTEP(t=0.25,  
> fine)
>      22                          PRESTEP (t=1.0, medium)
>      23                          EVOL    (t=1.0, medium)
>      24                                          PRESTEP (t=0.75,  
> fine)
>      25                                          EVOL    (t=0.75,  
> fine)
>      26                                          POSTSTEP(t=0.75,  
> fine)
>      27                                          PRESTEP (t=1.0 ,  
> fine)
>      28                                          EVOL    (t=1.0 ,  
> fine)
>      29          POSTRESTRICT (t=1, coarse)
>      30          POSTSTEP     (t=1, coarse)
>      31                          POSTRESTRICT (t=1, medium)
>      32                          POSTSTEP     (t=1, medium)
>      33                                          POSTSTEP(t=1   ,  
> fine)
>
> Why are POSTRESTRICT and POSTSTEP walked in the direction coarse -- 
> > fine
> (eg why are 19-20 done ahead of 21, and similarly 29-30 before 31-32
> before 33), rather than fine --> coarse (as I had expected for a  
> purely
> recursive Berger-Oliger step)?

Same as above; boundary conditions require that the coarse grid comes  
first.

-erik

-- 
Erik Schnetter <schnetter at cct.lsu.edu>

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : /archives/developers/attachments/20060506/16aa5739/attachment.pgp 


More information about the developers mailing list