Static (no-run) GPU memory footprint formulas for the CUDA backend.
Byte-exact sizes for the field, halo, and cuFFT/cuFFTMp spectral-array terms, mirroring the allocate statements in src/allocator.f90, src/backend/cuda/backend.f90, and src/backend/cuda/poisson_fft.f90. These formulas were originally written and tested inside tests/ as part of a runtime memory probe, since merged into src/memcheck.f90's --build Tier 3 path; they live here so both that real build measurement and the static, no build Tiers 1-2 estimate can share them instead of duplicating them.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=i8), | public, | parameter | :: | fft_xtdesc_step_bytes | = | 512_i8*1024_i8**2 |
The xtdesc buffer grows the heap in steps of about 0.5 GiB. |
| integer(kind=i8), | public, | parameter | :: | fft_probe_margin_bytes | = | 1024_i8**3 |
The free memory the full-grid FFT probe keeps beyond the predicted heap. The probe context and the libraries that stay after cufftDestroy use it. |
Cell count of one padded field at dims (x, y padded to sz, z untouched). i8 so callers can multiply by field count/nbytes without overflow, as the allocator's own int32 ngrid does for very large grids.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | dims(3) | |||
| integer, | intent(in) | :: | sz |
Bytes of ONE complex spectral array (waves_dev, and c_dev on the plain-cuFFT fallback path) of the shape n_spec. n_spec comes from cuda_fft_spectral_dims in src/backend/cuda/poisson_fft.f90, the routine the solver init calls, so the shape per BC class and per number of ranks is the solver's. Whether a decomposition is valid is checked by cuda_fft_decomp_reason, not here.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n_spec(3) |
The smallest multiple of step_bytes that is at least n_bytes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=i8), | intent(in) | :: | n_bytes | |||
| integer(kind=i8), | intent(in) | :: | step_bytes |
The NVSHMEM heap of the forward and backward cuFFTMp plans with the workspace allocated and without the xtdesc buffer: the plan memory plus the workspace rounded up to 1 GiB. This is the definition of the measured heap of the normal FFT workspace query.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=i8), | intent(in) | :: | plan_bytes | |||
| integer(kind=i8), | intent(in) | :: | worksize_bytes |
100-case multi rank only mirror/exchange buffers, zero at num_gpus<=1 - matches the nproc>1 guard at src/backend/cuda/poisson_fft.f90:332-349: c_mirror_dev + c_slab_send_dev: (nx_spec, ny_spec, nz_spec) x2 c_plane_send_dev + c_plane_recv_dev: (nx_spec, nz_spec) x2 all complex(dp). n_spec is the spectral shape of the 100 case.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n_spec(3) | |||
| integer, | intent(in) | :: | num_gpus |
110-case bytes on top of the waves_dev slab (never runs at num_gpus>1 in this solver): a SECOND complex array of the same spectral shape n_spec, c_dev (src/backend/cuda/poisson_fft.f90:416-418), plus a real, globally-shaped transposed workspace r_dev_110 (:414), which has the same total element count as cdims, just permuted.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n_spec(3) | |||
| integer, | intent(in) | :: | cdims(3) |
010-case, non-uniform y-stretching Poisson coefficient matrices, src/poisson_fft.f90:176-186 (only 010 sets stretched_y, and only at num_gpus=1 since 010 error-stops at nproc>1) and :320-323,424-428 (allocation shapes), copied to the device at src/backend/cuda/poisson_fft.f90:390-411: 'bottom': a_re, a_im, shape (nx_spec, ny_spec, nz_spec, 5), real(dp) otherwise ('centred', 'top-bottom'): a_odd_re/im, a_even_re/im, shape (nx_spec, ny_spec/2, nz_spec, 5), real(dp) doubled by the store_a_*_dev copies when lowmem_fft is .false. (the default).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| logical, | intent(in) | :: | bc_is_010 | |||
| character(len=*), | intent(in) | :: | stretching_y | |||
| logical, | intent(in) | :: | lowmem_fft | |||
| integer, | intent(in) | :: | n_spec(3) |
CUDA-backend halo-exchange buffer bytes. Mirrors the 24 allocate statements in src/backend/cuda/backend.f90:128-152: 12 arrays shaped (sz, n_halo, n_groups) for u/v/w send/recv start/end, plus 12 more shaped (sz, 1, n_groups) for du/dud/d2u send/recv start/end - all real(dp). n_groups is the max over X/Y/Z of ny_pnz_p/sz, nx_pnz_p/ sz, nx_pny_p/sz (src/allocator.f90:81-83, allocator_t% n_groups_dir/get_n_groups), where _p are the sz-padded dims (x/y padded via padded_dim, z untouched, same rule padded_cells uses).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | padded_dims(3) |
[nx_padded, ny_padded, nz_padded] |
||
| integer, | intent(in) | :: | sz | |||
| integer, | intent(in) | :: | n_halo |
halo_bytes for a local block of local_dims cells: pads x and y to sz (z untouched) the way the allocator does, then sizes the halo-exchange buffers of those padded dims.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | local_dims(3) | |||
| integer, | intent(in) | :: | sz | |||
| integer, | intent(in) | :: | n_halo |
Device memory the GPU-aware ADIOS2 write path (src/io/adios2/io.f90, write_device_field_adios2) holds on top of the solver's own peak: a single reused staging buffer (file_handle%device_staging), sized to one unpadded LOCAL field in whichever precision that write uses. The buffer is grown, never shrunk (see write_device_field_adios2), so its steady-state size is the LARGEST single write it is asked to hold: the build precision whenever a checkpoint is enabled (always native, and always at least as large as a single-precision snapshot), otherwise whatever precision the snapshot uses.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | local_dims(3) | |||
| type(checkpoint_config_t), | intent(in) | :: | checkpoint_cfg | |||
| logical, | intent(in) | :: | device_write |
Static estimate of the allocator's work-field high-water mark (allocator_t%next_id after one substep - see src/allocator.f90), evaluated purely from config flags, no build/run required.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | flow_case_name | |||
| character(len=3), | intent(in) | :: | time_intg | |||
| integer, | intent(in) | :: | n_species | |||
| logical, | intent(in) | :: | les_on | |||
| logical, | intent(in) | :: | ibm_on | |||
| logical, | intent(in) | :: | output_vorticity | |||
| logical, | intent(in) | :: | output_qcriterion | |||
| logical, | intent(in) | :: | lowmem_transeq |
Which writes can take the device path: a snapshot only at unit stride (striding falls back to the host path in snapshot_manager.f90), a checkpoint never strides. Shared by gpu_io_staging_bytes and the x3d2-memcheck report.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(checkpoint_config_t), | intent(in) | :: | checkpoint_cfg | |||
| logical, | intent(out) | :: | snapshot_dev | |||
| logical, | intent(out) | :: | checkpoint_dev |