Uitlity functions for creation of distributed directories.
More...
#include <stdbool.h>
#include "xt/xt_idxlist.h"
#include "xt/xt_xmap_intersection.h"
Go to the source code of this file.
|
#define | MIN(a, b) (((a)<(b))?(a):(b)) |
|
#define | MAX(a, b) (((a)>(b))?(a):(b)) |
|
|
void | xt_xmdd_free_dist_dir (struct dist_dir *dist_dir) |
|
int | xt_com_list_rank_cmp (const void *a_, const void *b_) |
|
Xt_idxlist | xt_xmap_dist_dir_get_bucket (const struct bucket_params *bucket_params, struct Xt_stripe **stripes_, size_t *stripes_array_size, int dist_dir_rank) |
| generates the buckets of the distributed directory More...
|
|
struct Xt_xmdd_txstat | xt_xmap_dist_dir_send_intersections (void *restrict send_buffer, size_t send_size_asize, size_t send_size_entry, int tag, MPI_Comm comm, int rank_lim, MPI_Request requests[], const int send_size[rank_lim][send_size_asize]) |
| initiate sends of packed index lists More...
|
|
int | xt_xmdd_cmp_isect_src_rank (const void *a_, const void *b_) |
|
int | xt_xmdd_cmp_isect_dst_rank (const void *a_, const void *b_) |
|
size_t | xt_xmap_dist_dir_match_src_dst (const struct dist_dir *src_dist_dir, const struct dist_dir *dst_dist_dir, struct isect **src_dst_intersections) |
|
size_t | xt_xmap_dist_dir_pack_intersections (enum xt_xmdd_direction target, size_t num_intersections, const struct isect *restrict src_dst_intersections, bool isect_idxlist_delete, size_t send_size_asize, size_t send_size_idx, int(*send_size)[send_size_asize], unsigned char *buffer, size_t buf_size, size_t *ofs, MPI_Comm comm) |
|
void | xt_xmap_dist_dir_same_rank_merge (struct dist_dir **dist_dir_results) |
|
◆ MAX
#define MAX |
( |
|
a, |
|
|
|
b |
|
) |
| (((a)>(b))?(a):(b)) |
◆ MIN
#define MIN |
( |
|
a, |
|
|
|
b |
|
) |
| (((a)<(b))?(a):(b)) |
◆ xt_xmdd_direction
◆ xt_com_list_rank_cmp()
int xt_com_list_rank_cmp |
( |
const void * |
a_, |
|
|
const void * |
b_ |
|
) |
| |
◆ xt_xmap_dist_dir_get_bucket()
Xt_idxlist xt_xmap_dist_dir_get_bucket |
( |
const struct bucket_params * |
bucket_params, |
|
|
struct Xt_stripe ** |
stripes_, |
|
|
size_t * |
stripes_array_size, |
|
|
int |
dist_dir_rank |
|
) |
| |
generates the buckets of the distributed directory
The buckets of the distributed directory are computed as follows:
- compute sum of the sizes of all src_idxlist's and round to next multiple of comm_size -> global_interval
- local_interval_size = global_interval / comm_size
- local_interval_start = rank * local_interval_size
- local_interval_end = (rank + 1) * local_interval_size
- local_interval = $[local_interval_start,local_interval_end)$
- bucket of each rank is the set of stripes that is defined as: stripe[i].start = start + rank*local_interval_start + i*global_interval stripe[i].stride = 1; stripe[i].nstrides = (int)local_interval; with i in [0,num_stripes) bucket[rank] = xt_idxstripes_new(stripes, num_stripes);
- num_stripes and start are choosen such that: start + local_interval > get_min_idxlist_index(src_idxlist, dst_idxlist) (which implies for rank 0 stripe[0].start <= get_min_idxlist_index(src_idxlist, dst_idxlist)) where start = global_interval * k, k is minimal and start + num_stripes*global_interval > get_max_idxlist_index(src_idxlist, dst_idxlist); i.e. local_interval is replicated modulo global_interval for the whole range of indices.
- Parameters
-
[in] | bucket_params | the parameters |
[out] | stripes_ | pointer to pointer of array of the stripes describing the bucket for rank dist_dir_rank. Must point to a pointer allocated by malloc or related and will be resized if necessary. |
[in,out] | stripes_array_size | number of stripes stored in stripes_ |
[in] | dist_dir_rank | rank for which to compute bucket |
- Returns
- newly created bucket. The bucket must not be longer lived than the dynamic memory referenced by stripes_ .
Definition at line 116 of file xt_xmap_dist_dir_common.c.
◆ xt_xmap_dist_dir_match_src_dst()
size_t xt_xmap_dist_dir_match_src_dst |
( |
const struct dist_dir * |
src_dist_dir, |
|
|
const struct dist_dir * |
dst_dist_dir, |
|
|
struct isect ** |
src_dst_intersections |
|
) |
| |
◆ xt_xmap_dist_dir_pack_intersections()
size_t xt_xmap_dist_dir_pack_intersections |
( |
enum xt_xmdd_direction |
target, |
|
|
size_t |
num_intersections, |
|
|
const struct isect *restrict |
src_dst_intersections, |
|
|
bool |
isect_idxlist_delete, |
|
|
size_t |
send_size_asize, |
|
|
size_t |
send_size_idx, |
|
|
int(*) |
send_size[send_size_asize], |
|
|
unsigned char * |
buffer, |
|
|
size_t |
buf_size, |
|
|
size_t * |
ofs, |
|
|
MPI_Comm |
comm |
|
) |
| |
◆ xt_xmap_dist_dir_same_rank_merge()
void xt_xmap_dist_dir_same_rank_merge |
( |
struct dist_dir ** |
dist_dir_results | ) |
|
◆ xt_xmap_dist_dir_send_intersections()
struct Xt_xmdd_txstat xt_xmap_dist_dir_send_intersections |
( |
void *restrict |
send_buffer, |
|
|
size_t |
send_size_asize, |
|
|
size_t |
send_size_entry, |
|
|
int |
tag, |
|
|
MPI_Comm |
comm, |
|
|
int |
rank_lim, |
|
|
MPI_Request |
requests[], |
|
|
const int |
send_size[rank_lim][send_size_asize] |
|
) |
| |
initiate sends of packed index lists
- Parameters
-
send_buffer | pointer to buffer of packed index lists |
send_size_asize | number of per-rank entries in send_size |
send_size_entry | index of send_size to act on |
tag | tag to use in MPI_Isend |
comm | communicator to use |
rank_lim | iterate over rank from 0 to rank_lim - 1 when investigating send_size[rank][send_size_entry] |
requests | the resulting MPI requests from the issued MPI_Isend calls are stored here, size must be at least number of greater-than-zero entries in send_size column send_size_entry |
send_size | 2-dimensional array of individual message sizes |
◆ xt_xmdd_cmp_isect_dst_rank()
int xt_xmdd_cmp_isect_dst_rank |
( |
const void * |
a_, |
|
|
const void * |
b_ |
|
) |
| |
◆ xt_xmdd_cmp_isect_src_rank()
int xt_xmdd_cmp_isect_src_rank |
( |
const void * |
a_, |
|
|
const void * |
b_ |
|
) |
| |
◆ xt_xmdd_free_dist_dir()
void xt_xmdd_free_dist_dir |
( |
struct dist_dir * |
dist_dir | ) |
|