Skip to content

adam_fnl_field_object

ADAM, field class definition, FNL backend.

Source: src/lib/fnl/adam_fnl_field_object.F90

Dependencies

Contents

Derived Types

field_fnl_object

Field class, FNL backend.

Components

NameTypeAttributesDescription
mapstype(maps_fnl_object)Maps handler.
fec_1_6_array_gpuinteger(kind=I4P)pointerMapping fec1-26 to fec1-6 for boundaries (GPU).
x_cell_gpureal(kind=R8P)pointerCells x coordinates on GPU [nb,1-ngc:ni+ngc].
y_cell_gpureal(kind=R8P)pointerCells y coordinates on GPU [nb,1-ngc:nj+ngc].
z_cell_gpureal(kind=R8P)pointerCells z coordinates on GPU [nb,1-ngc:nk+ngc].
dxyz_gpureal(kind=R8P)pointerDelta cells GPU [nb,3].
ngcinteger(kind=I4P)pointerNumber of ghost cells.
niinteger(kind=I4P)pointerNumber of cells in i direction.
njinteger(kind=I4P)pointerNumber of cells in j direction.
nkinteger(kind=I4P)pointerNumber of cells in k direction.
nbinteger(kind=I4P)pointerTotal blocks number for MPI.
blocks_numberinteger(kind=I4P)pointerActual blocks number.
nvinteger(kind=I4P)pointerNumber of variables in q vector.

Type-Bound Procedures

NameAttributesDescription
compute_q_gradientpass(self)Compute maximum gradient module of q element of a block.
copy_cpu_gpupass(self)Copy data from realm-local CPU field/maps to (field_fnl_object) GPU.
initializepass(self)Initialize field from realm-local CPU grid/field/maps.
update_ghost_local_gpupass(self)Update ghosts locally.
update_ghost_mpi_gpupass(self)Update ghosts MPI.

Subroutines

compute_q_gradient

Compute gradient (module) over q elements.

fortran
subroutine compute_q_gradient(self, b, ivar, dx, dy, dz, q_gpu, gradient)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_fnl_object)inThe field.
binteger(kind=I4P)inBlock index.
ivarinteger(kind=I4P)inIndex of q variable.
dxreal(kind=R8P)inX space step of block b (caller supplies realm field dxyz(1,b)).
dyreal(kind=R8P)inY space step of block b (caller supplies realm field dxyz(2,b)).
dzreal(kind=R8P)inZ space step of block b (caller supplies realm field dxyz(3,b)).
q_gpureal(kind=R8P)inField component to which apply gradient.
gradientreal(kind=R8P)outMaximum gradient of q(ivar).

Call graph

copy_cpu_gpu

Copy data from the (realm-local) CPU field/maps to this (field_fnl_object) GPU.

fortran
subroutine copy_cpu_gpu(self, field, maps, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_fnl_object)inoutThe field.
fieldtype(field_object)inRealm-local CPU field (cell coords, dxyz); was the field
mapstype(maps_object)inRealm-local CPU maps (ghost buffers); was the maps singleton.
verboselogicalinoptionalFlag to activate verbose mode.

Call graph

copy_transpose_cpu_gpu

Copy transposed data from CPU to GPU. This routine is called by equation typically passing either q_gpu or q_aux_gpu.

fortran
subroutine copy_transpose_cpu_gpu(self, nv, q_cpu, q_t, q_gpu)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_fnl_object)inoutThe field.
nvinteger(kind=I4P)inNumber of varibales.
q_cpureal(kind=R8P)inConservative variables on CPU.
q_treal(kind=R8P)inoutTransposed conservative variables on CPU.
q_gpureal(kind=R8P)inoutConservative variables on GPU.

Call graph

copy_transpose_gpu_cpu

Copy transposed data from GPU to CPU. This routine is called by equation typically passing either q_gpu or q_aux_gpu.

fortran
subroutine copy_transpose_gpu_cpu(self, nv, q_gpu, q_t_gpu, q_cpu)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_fnl_object)inoutThe field.
nvinteger(kind=I4P)inNumber of varibales.
q_gpureal(kind=R8P)inConservative variables on GPU.
q_t_gpureal(kind=R8P)inoutTransposed conservative variables on GPU.
q_cpureal(kind=R8P)inoutConservative variables on CPU.

Call graph

initialize

Initialize field from the (realm-local) CPU grid, field and maps. Requires mpih_fnl (adam_fnl_mpih_global) initialized and the passed CPU objects populated before calling.

fortran
subroutine initialize(self, grid, field, maps, nv_aux, q_gpu, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_fnl_object)inoutThe field.
gridtype(grid_object)intargetRealm-local CPU grid (ngc, ni/nj/nk); was the grid
fieldtype(field_object)intargetRealm-local CPU field (nb, nv, coords); was the field
mapstype(maps_object)inRealm-local CPU maps (ghost buffers/maps); was the maps
nv_auxinteger(kind=I4P)inoptionalNumber of auxiliary variables.
q_gpureal(kind=R8P)inoutpointer, optionalField cell centered variables.
verboselogicalinoptionalFlag to activate verbose mode.

Call graph

update_ghost_local_gpu

Update (local) ghost cells.

fortran
subroutine update_ghost_local_gpu(self, q_gpu)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_fnl_object)inThe field.
q_gpureal(kind=R8P)inoutField component to be updated.

Call graph

update_ghost_mpi_gpu

Update ghost cells within other processes.

GPU-direct path: the device-resident send/recv buffers are handed straight to MPI_Isend/MPI_Irecv. On a healthy CUDA-aware MPI stack (real InfiniBand + GPUDirect RDMA) this is the fast path.

The per-rank pointer/offset maps (comm_map_send_ptr_ghost/comm_map_recv_ptr_ghost) are the caller's realm-local CPU maps (e.g. self%adam%maps%comm_map_*_ptr_ghost), passed in rather than read off a global singleton — so a multi-realm caller exchanges with its own decomposition, never the last-bound realm's.

fortran
subroutine update_ghost_mpi_gpu(self, comm_map_send_ptr_ghost, comm_map_recv_ptr_ghost, q_gpu, step)

Arguments

NameTypeIntentAttributesDescription
selfclass(field_fnl_object)inoutThe field.
comm_map_send_ptr_ghostinteger(kind=I4P)inPer-rank send offsets (realm-local CPU map).
comm_map_recv_ptr_ghostinteger(kind=I4P)inPer-rank recv offsets (realm-local CPU map).
q_gpureal(kind=R8P)inoutField component to be updated.
stepinteger(kind=I4P)inoptionalStep to be perfordmed in asyncronous comp.

Call graph