Skip to content

adam_mpih_object ​

ADAM, MPI handler class definition.

Source: src/lib/common/adam_mpih_object.F90

Dependencies

Contents ​

Derived Types ​

mpih_object ​

MPI handler class.

Inheritance

Components ​

NameTypeAttributesDescription
myrankinteger(kind=I4P)MPI rank process.
myrankstrcharacter(len=:)allocatableMPI rank process stringified.
procs_numberinteger(kind=I4P)Number of MPI processes (MPI_COMM_WORLD).
node_comminteger(kind=I4P)Node-local (shared-memory) communicator.
node_procs_numberinteger(kind=I4P)Number of MPI processes sharing THIS node's RAM.
memory_availreal(kind=R8P)CPU memory available (GB) for each process.
errorinteger(kind=I4P)Error traping flag.
timingreal(kind=R8P)Tic toc timing.
tictocinteger(kind=I4P)Next is tic or toc?

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 ​

c_usleep ​

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.

Call graph

error_stop ​

Stop the run with error output, aborting every rank.

The error may be rank-local (a check only some ranks evaluate): MPI_ABORT on MPI_COMM_WORLD terminates all the ranks. MPI_FINALIZE would block the failing rank until the others finalize, while they block forever in their next collective (issue #43). The message is flushed first and the rank sleeps 0.5 s before the abort, so the launcher forwards it (Open MPI kills the ranks at once, and output not yet forwarded is lost: measured). Without MPI (not yet initialized, or already finalized) the process stops alone.

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 data.

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

Arguments

NameTypeIntentAttributesDescription
selfclass(mpih_object)inoutMPI 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.

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