Copy the host arrays to the device, then mark the static halo traces as stale.
The parent upload overwrites extboundary_gpu with the host extBoundary. On rank-shared faces the host copy holds whatever the host last saw (zeros after Init, or older values), not the traces carried by the device halo exchange. Once halo_static_done is set, SideExchangeStart(mesh,nactive) re-sends only the leading nactive (stepped) variables, so without this reset the static variables (nactive+1:nvar) would keep the uploaded host values on every rank-cut face for the rest of the run (FluidNumerics/SELF#201).
Clearing the flag makes the next exchange carry all nvar variables once. The cost is one full-width exchange (and one rebuild of the persistent requests) per upload; uploads happen at initialization, pickup, and regrid, not inside the time-stepping loop.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(MappedScalar3D), | intent(inout) | :: | this |
subroutine UpdateDevice_MappedScalar3D(this)
!! Copy the host arrays to the device, then mark the static halo traces as stale.
!!
!! The parent upload overwrites extboundary_gpu with the host extBoundary. On rank-shared
!! faces the host copy holds whatever the host last saw (zeros after Init, or older values),
!! not the traces carried by the device halo exchange. Once halo_static_done is set,
!! SideExchangeStart(mesh,nactive) re-sends only the leading nactive (stepped) variables, so
!! without this reset the static variables (nactive+1:nvar) would keep the uploaded host
!! values on every rank-cut face for the rest of the run (FluidNumerics/SELF#201).
!!
!! Clearing the flag makes the next exchange carry all nvar variables once. The cost is one
!! full-width exchange (and one rebuild of the persistent requests) per upload; uploads
!! happen at initialization, pickup, and regrid, not inside the time-stepping loop.
implicit none
class(MappedScalar3D),intent(inout) :: this
call UpdateDevice_Scalar3D(this)
this%halo_static_done = .false.
endsubroutine UpdateDevice_MappedScalar3D