$darkmode
mpi_sync_clocks
|
This is the public API for mpi_sync_clocks, the library to get a clock consistently synchronized accross MPI processes. More...
Modules | |
functions to deal with local clocks. | |
Clock backends are defined here. | |
sync clocks with generic backend. | |
mpi_sync_clocks may use different backends for synchronization. | |
typedef struct sync_clocks_generic_s * | mpi_sync_clocks_t |
opaque type for MPI sync clocks More... | |
static mpi_sync_clocks_t | mpi_sync_clocks_init (MPI_Comm comm) |
create an MPI sync clock object on the given communicator (collective operation) More... | |
static void | mpi_sync_clocks_shutdown (mpi_sync_clocks_t p_clocks) |
destroy the given clock More... | |
static double | mpi_sync_clocks_get_time_usec (mpi_sync_clocks_t p_clocks) |
get local time, in usec. More... | |
static double | mpi_sync_clocks_get_time_origin_usec (sync_clocks_generic_t p_clocks) |
get origin of local time, in usec. More... | |
static double | mpi_sync_clocks_local_to_global (mpi_sync_clocks_t p_clocks, double local_time) |
convert local time to global time More... | |
static double | mpi_sync_clocks_remote_to_global (mpi_sync_clocks_t p_clocks, int rank, double remote_time) |
convert remote local time to global time More... | |
static double | mpi_sync_clocks_global_to_local (mpi_sync_clocks_t p_clocks, double global_time) |
convert global time to local time More... | |
static void | mpi_sync_clocks_synchronize (mpi_sync_clocks_t p_clocks) |
synchronize clocks (collective operation); must have been called before any clock conversion More... | |
static int | mpi_sync_clocks_barrier (mpi_sync_clocks_t p_clocks, double *barrier_local_time) |
a barrier with precise synchronization; return 0 in case of success, -1 if we missed the deadline; barrier_local_time returns the local time at which barrier was supposed to take place More... | |
This is the public API for mpi_sync_clocks, the library to get a clock consistently synchronized accross MPI processes.
It is able to interpolate clocks, extrapolated, and perform a synchronized barrier: a barrier where all process are guaranteed to exit at the same time so as to be used for distributed performance measures such as MPI collective benchmark.
Usage is as follows:
mpi_sync_clocks_init()
. It returns an object of type mpi_sync_clocks_t
which represents the instantiation of mpi_sync_clocks.mpi_sync_clocks_get_time_usec()
. It returns a clock that is local to the process, with time origin at init time.mpi_sync_clocks_synchronize()
. This is a blocking collective operation. It is required before any clock computation may be performed.compute syncnronized times with mpi_sync_clocks_local_to_global()
to convert local time stamps to global time stamps.
For a synchronized barrier, call mpi_sync_clocks_barrier()
.
Steps 3 & 4 may be repeated as needed.
mpi_sync_clocks_shutdown()
See example bellow (from mpi_sync_clocks_basic.c):
typedef struct sync_clocks_generic_s* mpi_sync_clocks_t |
opaque type for MPI sync clocks
Definition at line 72 of file mpi_sync_clocks.h.
|
inlinestatic |
a barrier with precise synchronization; return 0 in case of success, -1 if we missed the deadline; barrier_local_time returns the local time at which barrier was supposed to take place
Definition at line 205 of file mpi_sync_clocks.h.
References sync_clocks_generic_barrier().
|
inlinestatic |
get origin of local time, in usec.
Definition at line 175 of file mpi_sync_clocks.h.
References sync_clocks_generic_tick2usec(), and sync_clocks_generic_s::time_orig.
|
inlinestatic |
get local time, in usec.
Definition at line 170 of file mpi_sync_clocks.h.
References sync_clocks_generic_get_time_usec().
|
inlinestatic |
convert global time to local time
Definition at line 190 of file mpi_sync_clocks.h.
References sync_clocks_generic_global_to_local().
|
inlinestatic |
create an MPI sync clock object on the given communicator (collective operation)
Definition at line 143 of file mpi_sync_clocks.h.
References sync_clocks_generic_s::backend, sync_clocks_generic_s::backend_data, mpi_sync_clocks_data_s::comm, sync_clocks_generic_s::comm_size, mpi_sync_clocks_bcast(), mpi_sync_clocks_gather(), mpi_sync_clocks_mpi_barrier(), mpi_sync_clocks_recv(), mpi_sync_clocks_send(), sync_clocks_generic_s::rank, sync_clocks_backend_s::send, and sync_clocks_generic_init().
|
inlinestatic |
convert local time to global time
Definition at line 185 of file mpi_sync_clocks.h.
References sync_clocks_generic_local_to_global().
|
inlinestatic |
convert remote local time to global time
Definition at line 180 of file mpi_sync_clocks.h.
References sync_clocks_generic_remote_to_global().
|
inlinestatic |
destroy the given clock
Definition at line 163 of file mpi_sync_clocks.h.
References sync_clocks_generic_s::backend_data, mpi_sync_clocks_data_s::comm, and sync_clocks_generic_shutdown().
|
inlinestatic |
synchronize clocks (collective operation); must have been called before any clock conversion
Definition at line 200 of file mpi_sync_clocks.h.
References sync_clocks_generic_synchronize().