Skip to content

fundal_mpih_object

MPI handler classs definition.

Source: src/lib/fundal_mpih_object.F90

Dependencies

Contents

Derived Types

mpih_object

MPI handler class.

Components

NameTypeAttributesDescription
errorinteger(kind=I4P)Error traping flag.
myrankinteger(kind=I4P)MPI ID process.
procs_numberinteger(kind=I4P)Number of MPI processes.
hos_memory_availinteger(kind=I8P)Host (CPU) memory available (GB) for each process.
timingreal(kind=R8P)Tic toc timing.
tictocinteger(kind=I4P)Next is tic or toc?
req_send_recvinteger(kind=I4P)allocatableMPI request receive flags.
devs_numberinteger(kind=I4P)pointerNumber of devices.
dev_memory_availinteger(kind=I8P)pointerDevice memory available (GB).
mydevinteger(kind=I4P)pointerDevice ID.
local_comminteger(kind=I4P)pointerLocal communicator.
myhosinteger(kind=I4P)pointerHost ID.
devtypeinteger(kind=IDk)pointerDevice type (currently used only for OpenACC backend).
myrankstrcharacter(len=:)allocatableMPI ID stringified.

Type-Bound Procedures

NameAttributesDescription
abortpass(self)Handy MPI abort wrapper.
barrierpass(self)Handy MPI barrier wrapper.
descriptionpass(self)Return pretty-printed object description.
error_stoppass(self)Stop run with error output.
finalizepass(self)Handy MPI finalize wrapper.
initializepass(self)Initialize MPI handler data.
print_messagepass(self)Print a message on stdout with rank prefix.
tictoc_timingpass(self)Return the last tic toc timing.
ticpass(self)Start a tic toc timing.
tocpass(self)Stop a tic toc timing.

Interfaces

str

Stringify integer functions overloading.

Module procedures: str_I4P, str_I8P

Subroutines

abort

Handy MPI abort wrapper.

fortran
subroutine abort(self, error_code, msg)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inoutMPI handler.
error_codeinteger(kind=I4P)inoptionalAbort error code.
msgcharacter(len=*)inoptionalError message.

barrier

Handy MPI barrier wrapper.

fortran
subroutine barrier(self, tictoc, timing, single)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inoutMPI handler.
tictoclogicalinoptionalActivate tic toc timing between 2 barrier calls.
timingreal(kind=R8P)outoptionalCurrent timing.
singlelogicalinoptionalSingle tictoc for one-shot timing.

error_stop

Stop run with error output.

fortran
subroutine error_stop(self, msg)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inoutMPI handler.
msgcharacter(len=*)inoptionalError message.

Call graph

finalize

Handy MPI finalize wrapper.

fortran
subroutine finalize(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inoutMPI handler.

Call graph

initialize

Initialize MPI handler.

fortran
subroutine initialize(self, do_mpi_init, do_device_init, myrankstr_char_length, verbose)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)outMPI handler.
do_mpi_initlogicalinoptionalFlag to activate MPI init call.
do_device_initlogicalinoptionalFlag to activate device init call (used by backends).
myrankstr_char_lengthinteger(kind=I4P)inoptionalMPI ID string length.
verboselogicalinoptionalTrigger verbose output.

Call graph

Print a message on stdout with rank prefix.

fortran
subroutine print_message(self, msg)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inMPI handler.
msgcharacter(len=*)inMessage to print.

Call graph

tic

Start a tic toc timing.

fortran
subroutine tic(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inoutMPI handler.

get_host_memory_info

Get the current CPU-memory status.

fortran
subroutine get_host_memory_info(mem_free, mem_total)

Arguments

NameTypeIntentAttributesDescription
mem_freeinteger(kind=I8P)outFree memory.
mem_totalinteger(kind=I8P)outTotal memory.

Call graph

Functions

description

Return a pretty-formatted object description.

Attributes: pure

Returns: character(len=:)

fortran
function description(self) result(desc)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inMPI handler.

Call graph

tictoc_timing

Return the last tic toc timing.

Returns: real(kind=R8P)

fortran
function tictoc_timing(self) result(timing)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inMPI handler.

Call graph

toc

Stop a tic toc timing.

Returns: real(kind=R8P)

fortran
function toc(self) result(timing)

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inoutMPI handler.

Call graph

cton

Convert string to integer.

Returns: integer(kind=I8P)

fortran
function cton(str, knd, pref, error) result(n)

Arguments

NameTypeIntentAttributesDescription
strcharacter(len=*)inString containing input number.
kndinteger(kind=I8P)inNumber kind.
prefcharacter(len=*)inoptionalPrefixing string.
errorinteger(kind=I4P)outoptionalError trapping flag: 0 no errors, >0 error occurs.

str_I4P

Return integer cast to string (I4P kind).

Attributes: elemental

Returns: character(len=11)

fortran
function str_I4P(n)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I4P)inInteger to be converted.

str_I8P

Return integer cast to string (I8P kind).

Attributes: elemental

Returns: character(len=20)

fortran
function str_I8P(n)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I8P)inInteger to be converted.

strz

Return integer cast to string, prefixing with the right number of zeros.

Attributes: elemental

Returns: character(len=11)

fortran
function strz(n, nz_pad)

Arguments

NameTypeIntentAttributesDescription
ninteger(kind=I4P)inInteger to be converted.
nz_padinteger(kind=I4P)inoptionalNumber of zeros padding.

Call graph