![]() |
ScalES-PPM
|
Distributed data structure of multiple global arrays. More...
Classes | |
struct | PPM_global_array_desc |
Enumerations | |
enum | { PPM_dma_max_rank = 7 } |
enum | PPM_dma_sync_mode { PPM_dma_sync_mode_passive_target , PPM_dma_sync_mode_active_target , PPM_dma_sync_mode_local_only } |
enum | PPM_dma_transfer_mode { PPM_dma_transfer_mode_struct = 0 , PPM_dma_transfer_mode_bytes = 1 } |
Functions | |
struct PPM_dist_mult_array * | PPM_dist_mult_array_new (size_t num_sub_arrays, const struct PPM_global_array_desc *sub_arrays, const struct PPM_extent *local_chunk, MPI_Comm comm, size_t cache_size, enum PPM_dma_sync_mode sync_mode) |
create distributed multi-array data structure More... | |
void | PPM_dist_mult_array_delete (struct PPM_dist_mult_array *dm_array) |
destroy dist_mult_array data type More... | |
struct PPM_dist_mult_array * | PPM_dist_mult_array_copy (struct PPM_dist_mult_array *dm_array) |
destroy dist_mult_array data type More... | |
void | PPM_dist_mult_array_expose (struct PPM_dist_mult_array *dm_array) |
make local data available to other ranks More... | |
void | PPM_dist_mult_array_unexpose (struct PPM_dist_mult_array *dm_array) |
wait for all ranks to finish queries in current exposure epoch More... | |
void | PPM_dist_mult_array_rma_sync (struct PPM_dist_mult_array *dm_array) |
synchronize RMA updates only, ignore local updates More... | |
int | PPM_dist_mult_array_get_sync_mode (struct PPM_dist_mult_array *dm_array) |
query distributed array synchronization protocol More... | |
void | PPM_dist_mult_array_set_sync_mode (struct PPM_dist_mult_array *dm_array, enum PPM_dma_sync_mode sync_mode, size_t cache_size) |
switch distributed array to different synchronization protocol More... | |
void * | PPM_dist_mult_array_local_ptr (struct PPM_dist_mult_array *dm_array, size_t sub_array_idx) |
void | PPM_dist_mult_array_get (struct PPM_dist_mult_array *dm_array, size_t sub_array, int32_t coord[], void *v_out) |
Get value out of distributed multi-array, independent of rank the data resides on. More... | |
unsigned | PPM_dist_mult_array_a_rank (struct PPM_dist_mult_array *dm_array, size_t sub_array_idx) |
void | PPM_dist_mult_array_rank_rect (struct PPM_dist_mult_array *dm_array, size_t sub_array_idx, int rank, struct PPM_extent *rect) |
MPI_Comm | PPM_dist_mult_array_comm (struct PPM_dist_mult_array *dm_array) |
void | PPM_dist_mult_array_set_transfer_mode (struct PPM_dist_mult_array *dm_array, int mode) |
int | PPM_dist_mult_array_get_transfer_mode (struct PPM_dist_mult_array *dm_array) |
Distributed data structure of multiple global arrays.
enum PPM_dma_sync_mode |
unsigned PPM_dist_mult_array_a_rank | ( | struct PPM_dist_mult_array * | dm_array, |
size_t | sub_array_idx | ||
) |
Query array rank for sub-array of distributed multi-array.
[in] | dm_array | distributed multiple arrays to query |
sub_array_idx | index of sub-array to query |
struct PPM_dist_mult_array* PPM_dist_mult_array_copy | ( | struct PPM_dist_mult_array * | dm_array | ) |
destroy dist_mult_array data type
[in] | dm_array | distributed multi-array to delete |
void PPM_dist_mult_array_delete | ( | struct PPM_dist_mult_array * | dm_array | ) |
destroy dist_mult_array data type
[in,out] | dm_array | distributed multi-array to delete |
void PPM_dist_mult_array_expose | ( | struct PPM_dist_mult_array * | dm_array | ) |
make local data available to other ranks
This call is collective for all ranks in the communicator used to create dm_array note: this enters an exposure epoch on the data shared via RMA local data must not be changed while the array is in exposed state
void PPM_dist_mult_array_get | ( | struct PPM_dist_mult_array * | dm_array, |
size_t | sub_array, | ||
int32_t | coord[], | ||
void * | v_out | ||
) |
Get value out of distributed multi-array, independent of rank the data resides on.
For example, to query the data assigned in the example for dist_mult_array_local_ptr, use a query like this:
In case dma was initialized with sync_mode=sync_mode_active_target, the value of i5 must not be accessed before calling a synchronizing routine, either
or
int PPM_dist_mult_array_get_sync_mode | ( | struct PPM_dist_mult_array * | dm_array | ) |
query distributed array synchronization protocol
dm_array | distributed multiple arrays to query sync mode for |
int PPM_dist_mult_array_get_transfer_mode | ( | struct PPM_dist_mult_array * | dm_array | ) |
get mode to transfer data for a distributed multi-array using synchronization mode PPM_dma_sync_mode_passive_target.
[in] | dm_array | distributed multiple arrays to get mode for |
struct PPM_dist_mult_array* PPM_dist_mult_array_new | ( | size_t | num_sub_arrays, |
const struct PPM_global_array_desc * | sub_arrays, | ||
const struct PPM_extent * | local_chunk, | ||
MPI_Comm | comm, | ||
size_t | cache_size, | ||
enum PPM_dma_sync_mode | sync_mode | ||
) |
create distributed multi-array data structure
The resulting data type represents a number of arrays distributed over the ranks of the communicator passed to this function.
num_sub_arrays | number of distributed arrays |
sub_arrays | contains array ranks, data types and bounds of each distributed global array. The bounds are represented by an extent type that stores start and size. |
local_chunk | points to array of extents with dimensions [num_sub_arrays][MAX(sub_arrays[].a_rank)] where local_chunk[j][i] describes for dimension i of sub_array j of the global arrays the local part available on this MPI rank.Only contiguous local parts are possible. |
comm | MPI communicator for which this data structure is collectively created |
cache_size | number of ranks to cache remote local parts of or automatically determined if 0 |
sync_mode | switch synchronization modes, either PPM_sync_mode_passive_target or sync_mode_active_target_mode. For sync_mode==PPM_dma_sync_mode_active_target_mode, execution of RMA is deferred until the next synchronizing call (dist_mult_array_unexpose or dist_mult_array_rma_sync). (see PPM_dist_mult_array_get for example) |
void PPM_dist_mult_array_rank_rect | ( | struct PPM_dist_mult_array * | dm_array, |
size_t | sub_array_idx, | ||
int | rank, | ||
struct PPM_extent * | rect | ||
) |
Query bounds of sub-array in distributed multi-array.
[in] | dm_array | distributed multiple arrays to query |
sub_array_idx | index of sub-array to query | |
rank | MPI rank on communicator of dm_array to query chunk for, own rank if less than 0 | |
[out] | rect | this array of size PPM_dist_mult_array_a_rank(dm_array, sub_array_idx) is set to the local chunk size of rank |
void PPM_dist_mult_array_rma_sync | ( | struct PPM_dist_mult_array * | dm_array | ) |
synchronize RMA updates only, ignore local updates
This call is collective for all ranks in the communicator used to create dm_array. Also dm_array must be in exposed state.
dm_array | distributed multiple arrays to synchronize all RMA for |
void PPM_dist_mult_array_set_sync_mode | ( | struct PPM_dist_mult_array * | dm_array, |
enum PPM_dma_sync_mode | sync_mode, | ||
size_t | cache_size | ||
) |
switch distributed array to different synchronization protocol
This call is collective for all ranks in the communicator used to create dm_array
note: this ends an exposure epoch on the data shared via RMA note: in case the current sync mode is PPM_dma_sync_mode_passive_target, the cache_size can still be changed without actually switching the mode
dm_array | distributed multiple arrays to change access/sync mode for |
sync_mode | new sync mode to set |
cache_size | in case sync_mode is PPM_dma_sync_mode_passive_target, the number of ranks to cache data for is set to this value (or determined automatically if 0) |
void PPM_dist_mult_array_set_transfer_mode | ( | struct PPM_dist_mult_array * | dm_array, |
int | mode | ||
) |
set mode to transfer data for a distributed multi-array using synchronization mode PPM_dma_sync_mode_passive_target.
[in,out] | dm_array | distributed multiple arrays to set mode for |
[in] | mode | transfer data as struct or contiguous array of bytes (the latter usually only works for MPI implementations on homogeneous systems which don't feature different endianness or alignments but is also often faster and this type of platform is also the most common). |
void PPM_dist_mult_array_unexpose | ( | struct PPM_dist_mult_array * | dm_array | ) |
wait for all ranks to finish queries in current exposure epoch
This call is collective for all ranks in the communicator used to create dm_array
note: local data can only be changed after the distributed array was initially created or dist_mult_array_unexpose has been called
Das diesem Bericht zugrundeliegende Vorhaben wurde mit Mitteln des Bundesministeriums für Bildung, und Forschung unter dem Förderkennzeichen 01IH08004E gefördert. Die Verantwortung für den Inhalt dieser Veröffentlichung liegt beim Autor.