UpdateDevice_MappedScalar3D Subroutine

public 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.

Arguments

TypeIntentOptionalAttributesName
class(MappedScalar3D), intent(inout) :: this

Calls

proc~~updatedevice_mappedscalar3d~~CallsGraph proc~updatedevice_mappedscalar3d UpdateDevice_MappedScalar3D proc~updatedevice_scalar3d UpdateDevice_Scalar3D proc~updatedevice_mappedscalar3d->proc~updatedevice_scalar3d interface~hipmemcpy hipMemcpy proc~updatedevice_scalar3d->interface~hipmemcpy proc~gpucheck gpuCheck proc~updatedevice_scalar3d->proc~gpucheck

Contents


Source Code

  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