Yet Another eXchange Tool  0.9.0
yaxt_f2c.c
Go to the documentation of this file.
1 
12 /*
13  * Keywords:
14  * Maintainer: Jörg Behrens <behrens@dkrz.de>
15  * Moritz Hanke <hanke@dkrz.de>
16  * Thomas Jahns <jahns@dkrz.de>
17  * URL: https://doc.redmine.dkrz.de/yaxt/html/
18  *
19  * Redistribution and use in source and binary forms, with or without
20  * modification, are permitted provided that the following conditions are
21  * met:
22  *
23  * Redistributions of source code must retain the above copyright notice,
24  * this list of conditions and the following disclaimer.
25  *
26  * Redistributions in binary form must reproduce the above copyright
27  * notice, this list of conditions and the following disclaimer in the
28  * documentation and/or other materials provided with the distribution.
29  *
30  * Neither the name of the DKRZ GmbH nor the names of its contributors
31  * may be used to endorse or promote products derived from this software
32  * without specific prior written permission.
33  *
34  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
35  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
36  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
37  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
38  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
39  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
40  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
41  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
42  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
43  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45  */
46 
47 #ifdef HAVE_CONFIG_H
48 #include "config.h"
49 #endif
50 
51 #include <assert.h>
52 #include <mpi.h>
53 
54 #include "core/core.h"
55 #include "core/ppm_xfuncs.h"
56 #if defined __clang__
57 #pragma GCC diagnostic push
58 #pragma GCC diagnostic ignored "-Wreserved-id-macro"
59 #pragma GCC diagnostic ignored "-Wstrict-prototypes"
60 #endif
61 #include "cfortran.h"
62 #if defined __clang__
63 #pragma GCC diagnostic pop
64 #endif
65 
66 #include "xt/xt_mpi.h"
67 #include "xt/xt_idxlist.h"
68 #include "xt/xt_idxvec.h"
69 #include "xt/xt_idxstripes.h"
70 #include "xt/xt_idxmod.h"
71 #include "xt/xt_xmap.h"
73 #include "xt/xt_xmap_all2all.h"
74 #include "xt/xt_xmap_dist_dir.h"
76 #include "xt/xt_redist.h"
77 #include "xt/xt_redist_p2p.h"
81 #include "xt/xt_sort.h"
82 
83 #include "xt_config_internal.h"
84 
85 struct xt_idxlist_f {
87 };
88 
89 struct xt_xmap_f {
91 };
92 
93 struct xt_config_f {
95 };
96 
97 struct xt_redist_f {
99 };
100 
103 };
104 
105 struct xt_request_f {
107 };
108 
109 /* These functions are meant to be called from Fortran and don't need
110  * an interface declaration in a C header */
111 #if (defined __GNUC__ && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))\
112  || (defined __clang__)
113 #pragma GCC diagnostic push
114 #pragma GCC diagnostic ignored "-Wmissing-prototypes"
115 #endif
116 
117 void xt_initialize_f(MPI_Fint *comm_f) {
118  MPI_Comm comm_c;
119  comm_c = MPI_Comm_f2c(*comm_f);
120  xt_initialize(comm_c);
121 }
122 
124 {
125  return MPI_Comm_c2f(Xt_default_comm);
126 }
127 
128 void xt_abort_f(MPI_Fint comm_f, const char *msg, const char *source,
129  int line) __attribute__((noreturn));
130 void xt_abort_f(MPI_Fint comm_f, const char *msg, const char *source,
131  int line) {
132  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
133  Xt_abort(comm_c, msg, source, line);
134 }
135 
136 void xt_sort_int_f2c(int *a, size_t n)
137 {
138  xt_sort_int(a, n);
139 }
140 
141 void xt_sort_index_f2c(Xt_int *a, int n, int *idx, int reset_index)
142 {
143  xt_sort_index(a, n, idx, reset_index);
144 }
145 
146 void xt_sort_idxpos_f2c(idxpos_type *a, size_t n)
147 {
148  xt_sort_idxpos(a, n);
149 }
150 
151 void xt_sort_int_permutation_f2c(int *a, size_t n, int *permutation)
152 {
153  xt_sort_int_permutation(a, n, permutation);
154 }
155 
157 {
158  return p->cptr;
159 }
160 
162 {
163  return p->cptr;
164 }
165 
167 {
168  return p->cptr;
169 }
170 
172 {
173  return p->cptr;
174 }
175 
177 {
178  return p->cptr;
179 }
180 
181 
183  MPI_Fint comm_f)
184 {
185  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
186  size_t size = xt_idxlist_get_pack_size(idxlist->cptr, comm_c);
187  if (size > XT_MPI_FINT_MAX)
188  Xt_abort(comm_c, "pack size too large", __FILE__, __LINE__);
189  return (MPI_Fint)size;
190 }
191 
192 static void
193 xt_idxlist_pack_f2c(struct xt_idxlist_f *idxlist, void *buffer,
194  MPI_Fint buffer_size, MPI_Fint *position, MPI_Fint comm_f)
195 {
196  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
197  xt_idxlist_pack(idxlist->cptr, buffer, (int)buffer_size, position,
198  comm_c);
199 }
200 
202  PVOID, PVOID, INT, PINT, INT)
203 
204 static void
205 xt_idxlist_unpack_f2c(struct xt_idxlist_f *idxlist, void *buffer,
206  MPI_Fint buffer_size, MPI_Fint *position,
207  MPI_Fint comm_f)
208 {
209  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
210  idxlist->cptr = xt_idxlist_unpack(buffer, (int)buffer_size, position, comm_c);
211 }
212 
213 FCALLSCSUB5(xt_idxlist_unpack_f2c, XT_IDXLIST_UNPACK_F, xt_idxlist_unpack_f,
214  PVOID, PVOID, INT, PINT, INT)
215 
216 Xt_xmap xt_xmap_all2all_new_f(struct xt_idxlist_f *src_idxlist_f,
217  struct xt_idxlist_f *dst_idxlist_f,
218  MPI_Fint comm_f) {
219  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
220  return xt_xmap_all2all_new(src_idxlist_f->cptr, dst_idxlist_f->cptr, comm_c);
221 }
222 
224  struct xt_idxlist_f *dst_idxlist_f,
225  MPI_Fint comm_f) {
226  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
227  return xt_xmap_dist_dir_new(src_idxlist_f->cptr, dst_idxlist_f->cptr, comm_c);
228 }
229 
230 Xt_xmap
232  struct xt_idxlist_f *dst_idxlist_f,
233  MPI_Fint inter_comm_f, MPI_Fint intra_comm_f)
234 {
235  MPI_Comm inter_comm_c = MPI_Comm_f2c(inter_comm_f),
236  intra_comm_c = MPI_Comm_f2c(intra_comm_f);
237  return xt_xmap_dist_dir_intercomm_new(src_idxlist_f->cptr,
238  dst_idxlist_f->cptr,
239  inter_comm_c, intra_comm_c);
240 }
241 
243  int *src_block_offsets,
244  int *src_block_sizes,
245  int src_block_num,
246  int *dst_block_offsets,
247  int *dst_block_sizes,
248  int dst_block_num,
249  MPI_Fint datatype_f) {
250  MPI_Datatype datatype_c = MPI_Type_f2c(datatype_f);
251 
252  return xt_redist_p2p_blocks_off_new(xmap_f->cptr,
253  src_block_offsets, src_block_sizes,
254  src_block_num,
255  dst_block_offsets, dst_block_sizes,
256  dst_block_num,
257  datatype_c);
258 }
259 
260 Xt_redist
262  int *src_block_offsets,
263  int *src_block_sizes,
264  int src_block_num,
265  int *dst_block_offsets,
266  int *dst_block_sizes,
267  int dst_block_num,
268  MPI_Fint datatype_f,
269  struct xt_config_f *config)
270 {
271  MPI_Datatype datatype_c = MPI_Type_f2c(datatype_f);
272 
274  xmap_f->cptr, src_block_offsets, src_block_sizes, src_block_num,
275  dst_block_offsets, dst_block_sizes, dst_block_num, datatype_c,
276  config->cptr);
277 }
278 
280  int *src_block_sizes, int src_block_num,
281  int *dst_block_sizes, int dst_block_num,
282  MPI_Fint datatype_f) {
283  MPI_Datatype datatype_c = MPI_Type_f2c(datatype_f);
284 
286  xmap_f->cptr, src_block_sizes, src_block_num,
287  dst_block_sizes, dst_block_num, datatype_c);
288 }
289 
290 Xt_redist
292  int *src_block_sizes, int src_block_num,
293  int *dst_block_sizes, int dst_block_num,
294  MPI_Fint datatype_f,
295  struct xt_config_f *config)
296 {
297  MPI_Datatype datatype_c = MPI_Type_f2c(datatype_f);
298 
300  xmap_f->cptr, src_block_sizes, src_block_num,
301  dst_block_sizes, dst_block_num, datatype_c, config->cptr);
302 }
303 
304 Xt_redist
306  int num_src_ext, struct Xt_offset_ext src_extents[],
307  int num_dst_ext, struct Xt_offset_ext dst_extents[],
308  MPI_Fint datatype_f)
309 {
310  return xt_redist_p2p_ext_new(*xmap, num_src_ext, src_extents,
311  num_dst_ext, dst_extents,
312  MPI_Type_f2c(datatype_f));
313 }
314 
315 Xt_redist
317  Xt_xmap *xmap,
318  int num_src_ext, struct Xt_offset_ext src_extents[],
319  int num_dst_ext, struct Xt_offset_ext dst_extents[],
320  MPI_Fint datatype_f, struct xt_config_f *config)
321 {
322  return xt_redist_p2p_ext_custom_new(*xmap, num_src_ext, src_extents,
323  num_dst_ext, dst_extents,
324  MPI_Type_f2c(datatype_f), config->cptr);
325 }
326 
327 Xt_redist
329  MPI_Fint *src_offsets, MPI_Fint *dst_offsets,
330  MPI_Fint datatype_f) {
331  MPI_Datatype datatype_c = MPI_Type_f2c(datatype_f);
332  assert(sizeof (MPI_Fint) == sizeof (int));
333 
334  return xt_redist_p2p_off_new(xmap_f->cptr, src_offsets, dst_offsets,
335  datatype_c);
336 }
337 
338 Xt_redist
340  MPI_Fint *src_offsets, MPI_Fint *dst_offsets,
341  MPI_Fint datatype_f, struct xt_config_f *config)
342 {
343  MPI_Datatype datatype_c = MPI_Type_f2c(datatype_f);
344  assert(sizeof (MPI_Fint) == sizeof (int));
345 
346  return xt_redist_p2p_off_custom_new(xmap_f->cptr, src_offsets, dst_offsets,
347  datatype_c, config->cptr);
348 }
349 
350 Xt_redist
351 xt_redist_p2p_new_f(struct xt_xmap_f *xmap_f, MPI_Fint datatype_f) {
352  MPI_Datatype datatype_c = MPI_Type_f2c(datatype_f);
353 
354  return xt_redist_p2p_new(xmap_f->cptr, datatype_c);
355 }
356 
357 Xt_redist
358 xt_redist_p2p_custom_new_f(struct xt_xmap_f *xmap_f, MPI_Fint datatype_f,
359  struct xt_config_f *config) {
360  MPI_Datatype datatype_c = MPI_Type_f2c(datatype_f);
361 
362  return xt_redist_p2p_custom_new(xmap_f->cptr, datatype_c, config->cptr);
363 }
364 
365 Xt_redist
367  MPI_Aint *src_displacements,
368  MPI_Aint *dst_displacements,
369  MPI_Fint comm_f)
370 {
371 #if XT_MPI_FINT_MAX != INT_MAX
372  assert((long long)num_redists <= (long long)INT_MAX);
373 #endif
374  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
375  if (num_redists < 1)
376  Xt_abort(comm_c, "bad case: (num_redists < 1)", __FILE__, __LINE__);
377 
379  redists, (int)num_redists, src_displacements, dst_displacements, comm_c);
380 }
381 
382 Xt_redist
384  Xt_redist *redists, MPI_Fint num_redists,
385  MPI_Aint *src_displacements, MPI_Aint *dst_displacements,
386  MPI_Fint comm_f, struct xt_config_f *config)
387 {
388 #if XT_MPI_FINT_MAX != INT_MAX
389  assert((long long)num_redists <= (long long)INT_MAX);
390 #endif
391  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
392  if (num_redists < 1)
393  Xt_abort(comm_c, "bad case: (num_redists < 1)", __FILE__, __LINE__);
394 
396  redists, (int)num_redists, src_displacements, dst_displacements,
397  comm_c, config->cptr);
398 }
399 
400 Xt_redist
402  MPI_Fint cache_size, MPI_Fint comm_f)
403 {
404 #if XT_MPI_FINT_MAX != INT_MAX
405  assert((long long)num_redists <= (long long)INT_MAX
406  && (long long)cache_size <= (long long)INT_MAX);
407 #endif
408  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
409  if (num_redists < 1)
410  Xt_abort(comm_c, "bad case: (num_redists < 1)", __FILE__, __LINE__);
411  return xt_redist_collection_new(redists, (int)num_redists,
412  (int)cache_size, comm_c);
413 }
414 
415 Xt_redist
417  MPI_Fint cache_size, MPI_Fint comm_f,
418  struct xt_config_f *config)
419 {
420 #if XT_MPI_FINT_MAX != INT_MAX
421  assert((long long)num_redists <= (long long)INT_MAX
422  && (long long)cache_size <= (long long)INT_MAX);
423 #endif
424  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
425  if (num_redists < 1)
426  Xt_abort(comm_c, "bad case: (num_redists < 1)", __FILE__, __LINE__);
427  return xt_redist_collection_custom_new(redists, (int)num_redists,
428  (int)cache_size, comm_c, config->cptr);
429 }
430 
431 static void
432 xt_slice_c_loc_f2c(void *a, void **p)
433 {
434  *p = a;
435 }
436 
437 FCALLSCSUB2(xt_slice_c_loc_f2c,XT_SLICE_C_LOC,xt_slice_c_loc,PVOID,PVOID)
438 
439 MPI_Fint
441 {
442  MPI_Comm comm = xt_redist_get_MPI_Comm(*redist);
443  return MPI_Comm_c2f(comm);
444 }
445 
446 MPI_Fint
448 {
449  MPI_Datatype dt = xt_redist_get_recv_MPI_Datatype(*redist, (int)rank);
450  return MPI_Type_c2f(dt);
451 }
452 
453 MPI_Fint
455 {
456  MPI_Datatype dt = xt_redist_get_send_MPI_Datatype(*redist, (int)rank);
457  return MPI_Type_c2f(dt);
458 }
459 
460 void *
462  int nsend, int nrecv, const struct xt_redist_msg_f *send_msgs_f,
463  const struct xt_redist_msg_f *recv_msgs_f, MPI_Fint comm_f,
464  struct xt_config_f *config)
465 {
466  assert(nsend >= 0 && nrecv >= 0);
467  MPI_Comm comm_c = MPI_Comm_f2c(comm_f);
468  struct Xt_redist_msg *send_msgs_c
469  = xmalloc(((size_t)nsend + (size_t)nrecv) * sizeof(*send_msgs_c)),
470  *recv_msgs_c = send_msgs_c + nsend;
471  for (int i = 0; i < nsend; ++i) {
472  send_msgs_c[i].rank = send_msgs_f[i].rank;
473  send_msgs_c[i].datatype = MPI_Type_f2c(send_msgs_f[i].datatype);
474  }
475  for (int i = 0; i < nrecv; ++i) {
476  recv_msgs_c[i].rank = recv_msgs_f[i].rank;
477  recv_msgs_c[i].datatype = MPI_Type_f2c(recv_msgs_f[i].datatype);
478  }
480  nsend, nrecv, send_msgs_c, recv_msgs_c, comm_c, config->cptr);
481  free(send_msgs_c);
482  return redist;
483 }
484 
485 void *
487  const struct xt_redist_msg_f *send_msgs_f,
488  const struct xt_redist_msg_f *recv_msgs_f,
489  MPI_Fint comm_f)
490 {
492  nsend, nrecv, send_msgs_f, recv_msgs_f, comm_f,
493  &(struct xt_config_f){ (Xt_config)&xt_default_config });
494 }
495 
496 void *
498  int num_src_intersections,
499  const struct Xt_com_list src_com[num_src_intersections],
500  int num_dst_intersections,
501  const struct Xt_com_list dst_com[num_dst_intersections],
502  void *src_idxlist, void *dst_idxlist, MPI_Fint comm)
503 {
504  return xt_xmap_intersection_new(num_src_intersections, src_com,
505  num_dst_intersections, dst_com,
506  src_idxlist, dst_idxlist, MPI_Comm_f2c(comm));
507 }
508 
509 void *
511  int num_src_intersections, const void *src_com,
512  int num_dst_intersections, const void *dst_com,
513  void *src_idxlist, void *dst_idxlist, MPI_Fint comm)
514 {
516  num_src_intersections, src_com, num_dst_intersections, dst_com,
517  src_idxlist, dst_idxlist, MPI_Comm_f2c(comm));
518 }
519 
520 void *
522  int num_src_msg, const void *src_com, int num_dst_msg, const void *dst_com,
523  MPI_Fint comm)
524 {
526  num_src_msg, src_com, num_dst_msg, dst_com, MPI_Comm_f2c(comm));
527 }
528 
529 #ifndef HAVE_FC_IS_CONTIGUOUS
530 int
531 xt_com_list_contiguous(const struct Xt_com_list *p_com_a,
532  const struct Xt_com_list *p_com_b)
533 {
534  return (p_com_a + 1 == p_com_b);
535 }
536 
537 int
539  const struct xt_redist_msg_f *p_msgs_b)
540 {
541  return (p_msgs_a + 1 == p_msgs_b);
542 }
543 #endif
544 
545 void
547  xt_mpi_comm_mark_exclusive(MPI_Comm_f2c(*comm));
548 }
549 #if (defined __GNUC__ && __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))\
550  || (defined __clang__)
551 #pragma GCC diagnostic pop
552 #endif
553 
554 /*
555  * Local Variables:
556  * c-basic-offset: 2
557  * coding: utf-8
558  * indent-tabs-mode: nil
559  * show-trailing-whitespace: t
560  * require-trailing-newline: t
561  * End:
562  */
int MPI_Fint
Definition: core.h:68
int MPI_Comm
Definition: core.h:64
#define __attribute__(x)
Definition: core.h:82
external, public xt_slice_c_loc
Definition: xt_core_f.f90:146
external, public xt_idxlist_unpack_f
external, public xt_idxlist_pack_f
add versions of standard API functions not returning on error
#define xmalloc(size)
Definition: ppm_xfuncs.h:70
MPI_Datatype datatype
Definition: xt_redist.h:69
Xt_config cptr
Definition: yaxt_f2c.c:94
Xt_idxlist cptr
Definition: yaxt_f2c.c:86
Xt_redist cptr
Definition: yaxt_f2c.c:98
MPI_Fint rank
Definition: yaxt_f2c.c:102
MPI_Fint datatype
Definition: yaxt_f2c.c:102
Xt_request cptr
Definition: yaxt_f2c.c:106
Xt_xmap cptr
Definition: yaxt_f2c.c:90
struct Xt_config_ xt_default_config
Definition: xt_config.c:65
struct Xt_config_ * Xt_config
Definition: xt_config.h:56
implementation of configuration object
void xt_initialize(MPI_Comm default_comm)
Definition: xt_init.c:70
XT_INT Xt_int
Definition: xt_core.h:68
index list declaration
Xt_idxlist xt_idxlist_unpack(void *buffer, int buffer_size, int *position, MPI_Comm comm)
void xt_idxlist_pack(Xt_idxlist idxlist, void *buffer, int buffer_size, int *position, MPI_Comm comm)
Definition: xt_idxlist.c:85
size_t xt_idxlist_get_pack_size(Xt_idxlist idxlist, MPI_Comm comm)
Definition: xt_idxlist.c:79
utility routines for MPI
void xt_mpi_comm_mark_exclusive(MPI_Comm comm)
Definition: xt_mpi.c:881
redistribution of data
MPI_Datatype xt_redist_get_recv_MPI_Datatype(Xt_redist redist, int rank)
Definition: xt_redist.c:112
MPI_Comm xt_redist_get_MPI_Comm(Xt_redist redist)
Definition: xt_redist.c:123
MPI_Datatype xt_redist_get_send_MPI_Datatype(Xt_redist redist, int rank)
Definition: xt_redist.c:107
Xt_redist xt_redist_collection_new(Xt_redist *redists, int num_redists, int cache_size, MPI_Comm comm)
Xt_redist xt_redist_collection_custom_new(Xt_redist *redists, int num_redists, int cache_size, MPI_Comm comm, Xt_config config)
Xt_redist xt_redist_collection_static_new(Xt_redist *redists, int num_redists, const MPI_Aint src_displacements[num_redists], const MPI_Aint dst_displacements[num_redists], MPI_Comm comm)
Xt_redist xt_redist_collection_static_custom_new(Xt_redist *redists, int num_redists, const MPI_Aint src_displacements[num_redists], const MPI_Aint dst_displacements[num_redists], MPI_Comm comm, Xt_config config)
Xt_redist xt_redist_p2p_custom_new(Xt_xmap xmap, MPI_Datatype datatype, Xt_config config)
Xt_redist xt_redist_p2p_off_new(Xt_xmap xmap, const int *src_offsets, const int *dst_offsets, MPI_Datatype datatype)
Xt_redist xt_redist_p2p_blocks_custom_new(Xt_xmap xmap, const int *src_block_sizes, int src_block_num, const int *dst_block_sizes, int dst_block_num, MPI_Datatype datatype, Xt_config config)
Xt_redist xt_redist_p2p_new(Xt_xmap xmap, MPI_Datatype datatype)
Xt_redist xt_redist_p2p_off_custom_new(Xt_xmap xmap, const int *src_offsets, const int *dst_offsets, MPI_Datatype datatype, Xt_config config)
Xt_redist xt_redist_p2p_blocks_off_custom_new(Xt_xmap xmap, const int *src_block_offsets, const int *src_block_sizes, int src_block_num, const int *dst_block_offsets, const int *dst_block_sizes, int dst_block_num, MPI_Datatype datatype, Xt_config config)
Xt_redist xt_redist_p2p_ext_new(Xt_xmap xmap, int num_src_ext, const struct Xt_offset_ext src_extents[], int num_dst_ext, const struct Xt_offset_ext dst_extents[], MPI_Datatype datatype)
Xt_redist xt_redist_p2p_blocks_off_new(Xt_xmap xmap, const int *src_block_offsets, const int *src_block_sizes, int src_block_num, const int *dst_block_offsets, const int *dst_block_sizes, int dst_block_num, MPI_Datatype datatype)
Xt_redist xt_redist_p2p_blocks_new(Xt_xmap xmap, const int *src_block_sizes, int src_block_num, const int *dst_block_sizes, int dst_block_num, MPI_Datatype datatype)
Xt_redist xt_redist_p2p_ext_custom_new(Xt_xmap xmap, int num_src_ext, const struct Xt_offset_ext src_extents[], int num_dst_ext, const struct Xt_offset_ext dst_extents[], MPI_Datatype datatype, Xt_config config)
Xt_redist xt_redist_single_array_base_custom_new(int nsend, int nrecv, const struct Xt_redist_msg send_msgs[], const struct Xt_redist_msg recv_msgs[], MPI_Comm comm, Xt_config config)
void(* xt_sort_int_permutation)(int a[], size_t n, int permutation[])
Definition: xt_sort.c:58
void(* xt_sort_index)(Xt_int *a, int n, int *idx, int reset_index)
Definition: xt_sort.c:55
void(* xt_sort_idxpos)(idxpos_type *v, size_t n)
Definition: xt_sort.c:57
void(* xt_sort_int)(int *a, size_t n)
Definition: xt_sort.c:53
exchange map declarations
Xt_xmap xt_xmap_all2all_new(Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm comm)
Xt_xmap xt_xmap_dist_dir_new(Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm comm)
Xt_xmap xt_xmap_dist_dir_intercomm_new(Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm inter_comm, MPI_Comm intra_comm)
Xt_xmap xt_xmap_intersection_ext_new(int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm comm)
Xt_xmap xt_xmap_intersection_pos_new(int num_src_msg, const struct Xt_com_pos src_com[num_src_msg], int num_dst_msg, const struct Xt_com_pos dst_com[num_dst_msg], MPI_Comm comm)
Xt_xmap xt_xmap_intersection_new(int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], Xt_idxlist src_idxlist, Xt_idxlist dst_idxlist, MPI_Comm comm)
Xt_redist xt_redist_f2c(struct xt_redist_f *p)
Definition: yaxt_f2c.c:161
Xt_request xt_request_f2c(struct xt_request_f *p)
Definition: yaxt_f2c.c:171
void xt_abort_f(MPI_Fint comm_f, const char *msg, const char *source, int line) __attribute__((noreturn))
Definition: yaxt_f2c.c:130
void * xt_redist_single_array_base_new_c2f(int nsend, int nrecv, const struct xt_redist_msg_f *send_msgs_f, const struct xt_redist_msg_f *recv_msgs_f, MPI_Fint comm_f)
Definition: yaxt_f2c.c:486
MPI_Fint xt_idxlist_get_pack_size_f2c(struct xt_idxlist_f *idxlist, MPI_Fint comm_f)
Definition: yaxt_f2c.c:182
MPI_Fint xt_get_default_comm_f(void)
Definition: yaxt_f2c.c:123
Xt_redist xt_redist_collection_static_new_f(Xt_redist *redists, MPI_Fint num_redists, MPI_Aint *src_displacements, MPI_Aint *dst_displacements, MPI_Fint comm_f)
Definition: yaxt_f2c.c:366
Xt_redist xt_redist_collection_static_custom_new_f(Xt_redist *redists, MPI_Fint num_redists, MPI_Aint *src_displacements, MPI_Aint *dst_displacements, MPI_Fint comm_f, struct xt_config_f *config)
Definition: yaxt_f2c.c:383
Xt_redist xt_redist_p2p_off_custom_new_f(struct xt_xmap_f *xmap_f, MPI_Fint *src_offsets, MPI_Fint *dst_offsets, MPI_Fint datatype_f, struct xt_config_f *config)
Definition: yaxt_f2c.c:339
void * xt_xmap_intersection_ext_new_f2c(int num_src_intersections, const void *src_com, int num_dst_intersections, const void *dst_com, void *src_idxlist, void *dst_idxlist, MPI_Fint comm)
Definition: yaxt_f2c.c:510
Xt_redist xt_redist_p2p_blocks_new_f(struct xt_xmap_f *xmap_f, int *src_block_sizes, int src_block_num, int *dst_block_sizes, int dst_block_num, MPI_Fint datatype_f)
Definition: yaxt_f2c.c:279
Xt_redist xt_redist_p2p_blocks_custom_new_f(struct xt_xmap_f *xmap_f, int *src_block_sizes, int src_block_num, int *dst_block_sizes, int dst_block_num, MPI_Fint datatype_f, struct xt_config_f *config)
Definition: yaxt_f2c.c:291
static void xt_slice_c_loc_f2c(void *a, void **p)
Definition: yaxt_f2c.c:432
Xt_redist xt_redist_p2p_off_new_f(struct xt_xmap_f *xmap_f, MPI_Fint *src_offsets, MPI_Fint *dst_offsets, MPI_Fint datatype_f)
Definition: yaxt_f2c.c:328
Xt_redist xt_redist_p2p_blocks_off_custom_new_f(struct xt_xmap_f *xmap_f, int *src_block_offsets, int *src_block_sizes, int src_block_num, int *dst_block_offsets, int *dst_block_sizes, int dst_block_num, MPI_Fint datatype_f, struct xt_config_f *config)
Definition: yaxt_f2c.c:261
void xt_sort_int_f2c(int *a, size_t n)
Definition: yaxt_f2c.c:136
int xt_com_list_contiguous(const struct Xt_com_list *p_com_a, const struct Xt_com_list *p_com_b)
Definition: yaxt_f2c.c:531
void * xt_xmap_intersection_pos_new_f2c(int num_src_msg, const void *src_com, int num_dst_msg, const void *dst_com, MPI_Fint comm)
Definition: yaxt_f2c.c:521
Xt_xmap xt_xmap_dist_dir_intercomm_new_f(struct xt_idxlist_f *src_idxlist_f, struct xt_idxlist_f *dst_idxlist_f, MPI_Fint inter_comm_f, MPI_Fint intra_comm_f)
Definition: yaxt_f2c.c:231
FCALLSCSUB5(xt_idxlist_pack_f2c, XT_IDXLIST_PACK_F, xt_idxlist_pack_f, PVOID, PVOID, INT, PINT, INT)
Definition: yaxt_f2c.c:201
Xt_redist xt_redist_p2p_custom_new_f(struct xt_xmap_f *xmap_f, MPI_Fint datatype_f, struct xt_config_f *config)
Definition: yaxt_f2c.c:358
Xt_redist xt_redist_p2p_ext_custom_new_c2f(Xt_xmap *xmap, int num_src_ext, struct Xt_offset_ext src_extents[], int num_dst_ext, struct Xt_offset_ext dst_extents[], MPI_Fint datatype_f, struct xt_config_f *config)
Definition: yaxt_f2c.c:316
Xt_redist xt_redist_collection_custom_new_f(Xt_redist *redists, MPI_Fint num_redists, MPI_Fint cache_size, MPI_Fint comm_f, struct xt_config_f *config)
Definition: yaxt_f2c.c:416
void xt_sort_index_f2c(Xt_int *a, int n, int *idx, int reset_index)
Definition: yaxt_f2c.c:141
Xt_redist xt_redist_p2p_new_f(struct xt_xmap_f *xmap_f, MPI_Fint datatype_f)
Definition: yaxt_f2c.c:351
Xt_redist xt_redist_p2p_ext_new_c2f(Xt_xmap *xmap, int num_src_ext, struct Xt_offset_ext src_extents[], int num_dst_ext, struct Xt_offset_ext dst_extents[], MPI_Fint datatype_f)
Definition: yaxt_f2c.c:305
Xt_redist xt_redist_p2p_blocks_off_new_f(struct xt_xmap_f *xmap_f, int *src_block_offsets, int *src_block_sizes, int src_block_num, int *dst_block_offsets, int *dst_block_sizes, int dst_block_num, MPI_Fint datatype_f)
Definition: yaxt_f2c.c:242
static void xt_idxlist_pack_f2c(struct xt_idxlist_f *idxlist, void *buffer, MPI_Fint buffer_size, MPI_Fint *position, MPI_Fint comm_f)
Definition: yaxt_f2c.c:193
void xt_initialize_f(MPI_Fint *comm_f)
Definition: yaxt_f2c.c:117
void xt_sort_int_permutation_f2c(int *a, size_t n, int *permutation)
Definition: yaxt_f2c.c:151
Xt_idxlist xt_idxlist_f2c(struct xt_idxlist_f *p)
Definition: yaxt_f2c.c:156
Xt_redist xt_redist_collection_new_f(Xt_redist *redists, MPI_Fint num_redists, MPI_Fint cache_size, MPI_Fint comm_f)
Definition: yaxt_f2c.c:401
MPI_Fint xt_redist_get_recv_MPI_Datatype_c2f(Xt_redist *redist, MPI_Fint rank)
Definition: yaxt_f2c.c:447
void * xt_redist_single_array_base_custom_new_c2f(int nsend, int nrecv, const struct xt_redist_msg_f *send_msgs_f, const struct xt_redist_msg_f *recv_msgs_f, MPI_Fint comm_f, struct xt_config_f *config)
Definition: yaxt_f2c.c:461
Xt_xmap xt_xmap_f2c(struct xt_xmap_f *p)
Definition: yaxt_f2c.c:176
MPI_Fint xt_redist_get_mpi_comm_c2f(Xt_redist *redist)
Definition: yaxt_f2c.c:440
void xt_mpi_comm_mark_exclusive_f2c(MPI_Fint *comm)
Definition: yaxt_f2c.c:546
MPI_Fint xt_redist_get_send_MPI_Datatype_c2f(Xt_redist *redist, MPI_Fint rank)
Definition: yaxt_f2c.c:454
int xt_redist_msg_contiguous(const struct xt_redist_msg_f *p_msgs_a, const struct xt_redist_msg_f *p_msgs_b)
Definition: yaxt_f2c.c:538
void xt_sort_idxpos_f2c(idxpos_type *a, size_t n)
Definition: yaxt_f2c.c:146
void * xt_xmap_intersection_new_f2c(int num_src_intersections, const struct Xt_com_list src_com[num_src_intersections], int num_dst_intersections, const struct Xt_com_list dst_com[num_dst_intersections], void *src_idxlist, void *dst_idxlist, MPI_Fint comm)
Definition: yaxt_f2c.c:497
Xt_xmap xt_xmap_dist_dir_new_f(struct xt_idxlist_f *src_idxlist_f, struct xt_idxlist_f *dst_idxlist_f, MPI_Fint comm_f)
Definition: yaxt_f2c.c:223
Xt_config xt_config_f2c(struct xt_config_f *p)
Definition: yaxt_f2c.c:166