Yet Another eXchange Tool  0.9.0
xt_xmap_dist_dir_common.h
Go to the documentation of this file.
1 
14 /*
15  * Keywords:
16  * Maintainer: Jörg Behrens <behrens@dkrz.de>
17  * Moritz Hanke <hanke@dkrz.de>
18  * Thomas Jahns <jahns@dkrz.de>
19  * URL: https://doc.redmine.dkrz.de/yaxt/html/
20  *
21  * Redistribution and use in source and binary forms, with or without
22  * modification, are permitted provided that the following conditions are
23  * met:
24  *
25  * Redistributions of source code must retain the above copyright notice,
26  * this list of conditions and the following disclaimer.
27  *
28  * Redistributions in binary form must reproduce the above copyright
29  * notice, this list of conditions and the following disclaimer in the
30  * documentation and/or other materials provided with the distribution.
31  *
32  * Neither the name of the DKRZ GmbH nor the names of its contributors
33  * may be used to endorse or promote products derived from this software
34  * without specific prior written permission.
35  *
36  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
37  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
38  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
39  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
40  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
41  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
42  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
43  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
44  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
45  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
46  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47  */
48 #ifndef XT_XMAP_DIST_DIR_COMMON_H
49 #define XT_XMAP_DIST_DIR_COMMON_H
50 
51 #ifdef HAVE_CONFIG_H
52 #include <config.h>
53 #endif
54 
55 #include <stdbool.h>
56 
57 #include "xt/xt_idxlist.h"
59 
60 #define MIN(a,b) (((a)<(b))?(a):(b))
61 #define MAX(a,b) (((a)>(b))?(a):(b))
62 
63 struct dist_dir {
65  struct Xt_com_list entries[];
66 };
67 
68 void
70 
71 int
72 xt_com_list_rank_cmp(const void *a_, const void *b_);
73 
74 struct bucket_params {
77 };
78 
81  struct Xt_stripe **stripes_,
82  size_t *stripes_array_size,
83  int dist_dir_rank);
84 
86  size_t bytes, num_msg;
87 };
88 
103 struct Xt_xmdd_txstat
105  void *restrict send_buffer,
106  size_t send_size_asize, size_t send_size_entry,
107  int tag, MPI_Comm comm, int rank_lim,
108  MPI_Request requests[],
109  const int send_size[rank_lim][send_size_asize]);
110 
111 
115 };
116 
117 struct isect
118 {
119  int rank[2];
121 };
122 
123 int
124 xt_xmdd_cmp_isect_src_rank(const void *a_, const void *b_);
125 int
126 xt_xmdd_cmp_isect_dst_rank(const void *a_, const void *b_);
127 
128 
129 size_t
130 xt_xmap_dist_dir_match_src_dst(const struct dist_dir *src_dist_dir,
131  const struct dist_dir *dst_dist_dir,
132  struct isect **src_dst_intersections);
133 
134 size_t
136  enum xt_xmdd_direction target,
137  size_t num_intersections,
138  const struct isect *restrict src_dst_intersections,
139  bool isect_idxlist_delete,
140  size_t send_size_asize, size_t send_size_idx,
141  int (*send_size)[send_size_asize],
142  unsigned char *buffer, size_t buf_size, size_t *ofs, MPI_Comm comm);
143 
144 
145 void
146 xt_xmap_dist_dir_same_rank_merge(struct dist_dir **dist_dir_results);
147 
148 
149 #endif
150 
151 /*
152  * Local Variables:
153  * c-basic-offset: 2
154  * coding: utf-8
155  * indent-tabs-mode: nil
156  * show-trailing-whitespace: t
157  * require-trailing-newline: t
158  * End:
159  */
int MPI_Comm
Definition: core.h:64
struct Xt_com_list entries[]
Xt_idxlist idxlist
XT_INT Xt_int
Definition: xt_core.h:68
index list declaration
int xt_com_list_rank_cmp(const void *a_, const void *b_)
int xt_xmdd_cmp_isect_src_rank(const void *a_, const void *b_)
@ xt_xmdd_direction_dst
@ xt_xmdd_direction_src
void xt_xmdd_free_dist_dir(struct dist_dir *dist_dir)
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)
int xt_xmdd_cmp_isect_dst_rank(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
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
void xt_xmap_dist_dir_same_rank_merge(struct dist_dir **dist_dir_results)
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)