Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Return cell-centre positions from the device to the host.
fill_geometry_device builds a block's geometry on the GPU and leaves it
there. Positions are the part host code asks for most often - the initial
condition, the user hooks and the output all read ps(igrid)%x - but it
asks rarely compared to how often blocks are (re)allocated, so the copy
back does not belong in alloc_node: with AMR that would pay for it on
every regrid, for blocks nothing on the host is going to look at.
Call this instead immediately before host code that reads ps(igrid)%x,
passing igrid when it is about to read a single block. Every such site is
listed in CLAUDE.md; a missed one reads whatever the host copy held for
the block that previously occupied that slot.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
subroutine sync_positions_host(igrid)use mod_global_parametersinteger,intent(in),optional::igridinteger::iigridif(present(igrid))then else do iigrid=1,igridstailend do end if end subroutine sync_positions_host