cuda_memcheck_device_t Derived Type

type, public :: cuda_memcheck_device_t


Inherits

type~~cuda_memcheck_device_t~~InheritsGraph type~cuda_memcheck_device_t cuda_memcheck_device_t type~probe_result_t probe_result_t type~cuda_memcheck_device_t->type~probe_result_t probe

Inherited by

type~~cuda_memcheck_device_t~~InheritedByGraph type~cuda_memcheck_device_t cuda_memcheck_device_t type~memcheck_ctx_t memcheck_ctx_t type~memcheck_ctx_t->type~cuda_memcheck_device_t device

Components

Type Visibility Attributes Name Initial
type(probe_result_t), public :: probe

The probe whose context and heap the estimate uses.

logical, public :: full_failed = .false.

The full-grid probe returned a failure status, and that status. The small-grid result then stays in place.

integer, public :: full_failed_stat = 0
integer(kind=i8), public :: plan_need_bytes = 0_i8

The memory the FFT plans of the full grid need, from the query-only mode (see query_plan_need). For cuFFTMp it is the predicted heap plus the xtdesc buffer rounded up to 0.5 GiB.

logical, public :: heap_predicted = .false.

The estimate takes the heap and the xtdesc buffer from the two sizes above instead of the probe that ran (see use_predicted_heap).


Type-Bound Procedures

procedure, public :: init

  • private subroutine init(self, ok, msg)

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(inout) :: self
    logical, intent(out) :: ok
    character(len=*), intent(out) :: msg

procedure, public :: mem_info

  • private subroutine mem_info(self, total_bytes, free_bytes)

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self
    integer(kind=i8), intent(out) :: total_bytes
    integer(kind=i8), intent(out) :: free_bytes

procedure, public :: context_bytes

  • private function context_bytes(self) result(nbytes8)

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self

    Return Value integer(kind=i8)

procedure, public :: sz => pencil_size

  • private function pencil_size(self) result(n)

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self

    Return Value integer

procedure, public :: overhead_floor_bytes

  • private function overhead_floor_bytes(self, num_gpus, bc_is_110) result(nbytes8)

    The formula overhead at num_gpus GPUs: the context plus, unless the BC is 110 (plain cuFFT), the heap over num_gpus, both from the probe that ran.

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self
    integer, intent(in) :: num_gpus
    logical, intent(in) :: bc_is_110

    Return Value integer(kind=i8)

procedure, public :: overhead_query_bytes

  • private function overhead_query_bytes(self, num_gpus) result(nbytes8)

    The overhead at num_gpus GPUs from the full-grid probe, once probe_ran.

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self
    integer, intent(in) :: num_gpus

    Return Value integer(kind=i8)

procedure, public :: probe_ran

  • private function probe_ran(self) result(ran)

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self

    Return Value logical

procedure, public :: ensure_probe

  • private subroutine ensure_probe(self, bc_is_100, bc_is_110, cdims, try_full)

    Runs the FFT probe in this process. The probe on a 32^3 grid runs first, in every mode, and gives the context and the heap. When try_full is set, the probe on the cell dimensions cdims runs once after it. A full-grid probe that returns a failure status leaves the small-grid result in place and sets full_failed. A plan that does not fit aborts inside the library, so the caller sets try_full only when the plan fits. Stops the program when the small-grid probe fails. Each probe measures its own context just before its query.

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(inout) :: self
    logical, intent(in) :: bc_is_100
    logical, intent(in) :: bc_is_110
    integer, intent(in) :: cdims(3)
    logical, intent(in) :: try_full

procedure, public :: query_plan_need

  • private subroutine query_plan_need(self, bc_is_100, bc_is_110, cdims, xtdesc_bytes, stat)

    Runs the query-only mode of the FFT workspace query on the cell dimensions cdims. It allocates no workspace and no xtdesc buffer, so the plan cannot abort for lack of memory. xtdesc_bytes is the size of the xtdesc buffer, which the caller knows from the spectral slab. Sets plan_need_bytes when stat is zero.

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(inout) :: self
    logical, intent(in) :: bc_is_100
    logical, intent(in) :: bc_is_110
    integer, intent(in) :: cdims(3)
    integer(kind=i8), intent(in) :: xtdesc_bytes
    integer, intent(out) :: stat

procedure, public :: use_predicted_heap

  • private subroutine use_predicted_heap(self)

    Makes the estimate take the heap predicted by query_plan_need, for the case that the full-grid probe does not run. A plain cuFFT plan has no heap, so it stays as it is.

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(inout) :: self

procedure, public :: heap_bytes

  • private function heap_bytes(self) result(nbytes8)

    The NVSHMEM heap the estimate uses: the predicted heap when heap_predicted is set, else the heap of the probe that ran. Both are without the xtdesc buffer.

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self

    Return Value integer(kind=i8)

procedure, public :: capture_solver_info

  • private subroutine capture_solver_info(self, flow_case)

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(inout) :: self
    class(base_case_t), intent(in) :: flow_case

procedure, public :: footprint_bytes

  • private function footprint_bytes(self, free_end_bytes) result(nbytes8)

    The card memory held at the end of the real build: the context at the start plus the fall of the free memory since then.

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self
    integer(kind=i8), intent(in) :: free_end_bytes

    Return Value integer(kind=i8)

procedure, public :: fft_path_known

  • private function fft_path_known(self) result(known)

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self

    Return Value logical

procedure, public :: uses_distributed_fft

  • private function uses_distributed_fft(self) result(distributed)

    Arguments

    Type IntentOptional Attributes Name
    class(cuda_memcheck_device_t), intent(in) :: self

    Return Value logical