Appearance
adam_mpih_nvf_object
ADAM, MPI handler class definition, NVF backend.
Extend common mpih class adding NVF features.
Source: src/lib/nvf/adam_mpih_nvf_object.F90
Dependencies
Contents
- mpih_nvf_object
- initialize
- check_cuda_error
- load_from_file
- print_device_properties
- set_cuda_dimensions
- description
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
CUDA_SILENT_ERR | integer(kind=I4P) | parameter | CUDA silent error code. |
INI_SECTION_NAME | character(len=4) | parameter | INI (config) file section name containing configs. |
Derived Types
mpih_nvf_object
MPI handler class, NVF backend.
Inheritance
Extends: mpih_object
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
myrank | integer(kind=I4P) | MPI rank process. | |
myrankstr | character(len=:) | allocatable | MPI rank process stringified. |
procs_number | integer(kind=I4P) | Number of MPI processes. | |
memory_avail | real(kind=R8P) | CPU memory available (GB) for each process. | |
error | integer(kind=I4P) | Error traping flag. | |
timing | real(kind=R8P) | Tic toc timing. | |
tictoc | integer(kind=I4P) | Next is tic or toc? | |
req_send_recv | integer(kind=I4P) | allocatable | MPI request receive flags. |
mydev | integer(kind=I4P) | My GPU rank. | |
local_comm | integer(kind=I4P) | Local communicator. | |
iercuda | integer(kind=I4P) | Error trapping flag for CUDAFortran. | |
cblk | integer(kind=I4P) | Default CUDA block dimensions. | |
grid | type(dim3) | CUDA grid and block. | |
tBlock | type(dim3) | CUDA grid and block. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
abort | pass(self) | Handy MPI abort wrapper. |
barrier | pass(self) | Handy MPI barrier wrapper. |
error_stop | pass(self) | Stop run with error output. |
finalize | pass(self) | Handy MPI finalize wrapper. |
print_message | pass(self) | Print a message on stdout with rank prefix. |
tictoc_timing | pass(self) | Return the last tic toc timing. |
tic | pass(self) | Start a tic toc timing. |
toc | pass(self) | Stop a tic toc timing. |
initialize | pass(self) | Initialize MPI handler data. |
check_cuda_error | pass(self) | Check if CUDA error occurs and abort in case. |
description | pass(self) | Return pretty-printed object description. |
load_from_file | pass(self) | Load config from file. |
print_device_properties | pass(self) | Pretty print device properties. |
set_cuda_dimensions | pass(self) | Compute CUDA grid dimensions for GPU parallel computations. |
Subroutines
initialize
Initialize MPI handler data.
fortran
subroutine initialize(self, do_mpi_init, do_device_init, myrankstr_char_length, verbose)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(mpih_nvf_object) | inout | MPI handler. | |
do_mpi_init | logical | in | optional | Flag to activate MPI init call. |
do_device_init | logical | in | optional | Flag to activate device init call. |
myrankstr_char_length | integer(kind=I4P) | in | optional | MPI ID string length. |
verbose | logical | in | optional | Trigger verbose output. |
Call graph
check_cuda_error
Check if CUDA error occurs and abort in case.
fortran
subroutine check_cuda_error(self, error_code, msg)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(mpih_nvf_object) | inout | MPI handler. | |
error_code | integer(kind=I4P) | in | optional | Abort error code. |
msg | character(len=*) | in | optional | Error message. |
Call graph
load_from_file
Load config from file.
fortran
subroutine load_from_file(self, file_parameters, go_on_fail)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(mpih_nvf_object) | inout | MPI handler. | |
file_parameters | type(file_ini) | in | Simulation parameters ini file handler. | |
go_on_fail | logical | in | optional | Go on if load fails. |
Call graph
print_device_properties
Pretty print device properties.
fortran
subroutine print_device_properties(self, device_properties)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(mpih_nvf_object) | in | MPI handler. | |
device_properties | type(cudadeviceprop) | in | Device properties. |
Call graph
set_cuda_dimensions
Compute CUDA grid dimensions for GPU parallel computations.
fortran
subroutine set_cuda_dimensions(self, cgrd, cblk)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(mpih_nvf_object) | inout | MPI handler. | |
cgrd | integer(kind=I4P) | in | CUDA grid dimensions. | |
cblk | integer(kind=I4P) | in | optional | CUDA block dimensions. |
Call graph
Functions
description
Return a pretty-formatted object description.
Attributes: pure
Returns: character(len=:)
fortran
function description(self) result(desc)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(mpih_nvf_object) | in | MPI handler. |
Call graph