Yet Another eXchange Tool  DO_NOT_EDIT_HERE
xt_exchanger.h
Go to the documentation of this file.
1 
13 /*
14  * Keywords:
15  * Maintainer: Jörg Behrens <behrens@dkrz.de>
16  * Moritz Hanke <hanke@dkrz.de>
17  * Thomas Jahns <jahns@dkrz.de>
18  * URL: https://doc.redmine.dkrz.de/yaxt/html/
19  *
20  * Redistribution and use in source and binary forms, with or without
21  * modification, are permitted provided that the following conditions are
22  * met:
23  *
24  * Redistributions of source code must retain the above copyright notice,
25  * this list of conditions and the following disclaimer.
26  *
27  * Redistributions in binary form must reproduce the above copyright
28  * notice, this list of conditions and the following disclaimer in the
29  * documentation and/or other materials provided with the distribution.
30  *
31  * Neither the name of the DKRZ GmbH nor the names of its contributors
32  * may be used to endorse or promote products derived from this software
33  * without specific prior written permission.
34  *
35  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
36  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
37  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
38  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
39  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
40  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
41  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
42  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
43  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
44  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
45  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46  */
47 #ifndef XT_EXCHANGER_H
48 #define XT_EXCHANGER_H
49 
50 #ifdef HAVE_CONFIG_H
51 #include <config.h>
52 #endif
53 
54 #include <mpi.h>
55 
56 #include "xt/xt_core.h"
57 #include "xt_redist_internal.h"
58 
62 typedef struct Xt_exchanger_ *Xt_exchanger;
63 
66  void (*delete)(Xt_exchanger);
67  void (*s_exchange)(Xt_exchanger, const void *, void *);
69  MPI_Datatype (*get_MPI_Datatype)(Xt_exchanger, int, enum xt_msg_direction);
70 };
71 
72 struct Xt_exchanger_ {
74 };
75 
81 extern Xt_exchanger
82 (*xt_exchanger_default_constructor)(int nsend, int nrecv,
83  struct Xt_redist_msg * send_msgs,
84  struct Xt_redist_msg * recv_msgs,
85  MPI_Comm comm, int tag_offset);
86 
87 void xt_exchanger_s_exchange(Xt_exchanger exchanger, const void * src_data,
88  void * dst_data);
89 
90 Xt_exchanger
91 xt_exchanger_copy(Xt_exchanger orig, MPI_Comm new_comm, int new_tag_offset);
92 
93 void xt_exchanger_delete(Xt_exchanger);
94 
95 void xt_exchanger_internal_optimize(size_t n, void * msgs, size_t msg_type_size,
96  MPI_Comm comm);
97 
98 MPI_Datatype
99 xt_exchanger_get_MPI_Datatype(Xt_exchanger exchanger,
100  int rank, enum xt_msg_direction direction);
101 
102 int
103 xt_exchanger_get_msg_ranks(Xt_exchanger exchanger,
104  enum xt_msg_direction direction,
105  int **ranks);
106 
107 #endif // XT_EXCHANGER_H
108 /*
109  * Local Variables:
110  * c-basic-offset: 2
111  * coding: utf-8
112  * indent-tabs-mode: nil
113  * show-trailing-whitespace: t
114  * require-trailing-newline: t
115  * End:
116  */
void(* s_exchange)(Xt_exchanger, const void *, void *)
Definition: xt_exchanger.h:67
base definitions header file
void xt_exchanger_delete(Xt_exchanger)
Definition: xt_exchanger.c:70
xt_msg_direction
struct Xt_exchanger_ * Xt_exchanger
Definition: xt_exchanger.h:62
redistribution of data, non-public declarations
MPI_Datatype(* get_MPI_Datatype)(Xt_exchanger, int, enum xt_msg_direction)
Definition: xt_exchanger.h:69
int(* get_msg_ranks)(Xt_exchanger, enum xt_msg_direction, int **)
Definition: xt_exchanger.h:68
Xt_exchanger xt_exchanger_copy(Xt_exchanger orig, MPI_Comm new_comm, int new_tag_offset)
Definition: xt_exchanger.c:65
Xt_exchanger(* xt_exchanger_default_constructor)(int nsend, int nrecv, struct Xt_redist_msg *send_msgs, struct Xt_redist_msg *recv_msgs, MPI_Comm comm, int tag_offset)
Definition: xt_exchanger.c:59
void xt_exchanger_s_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data)
Definition: xt_exchanger.c:75
Xt_exchanger(* copy)(Xt_exchanger, MPI_Comm, int)
Definition: xt_exchanger.h:65
MPI_Datatype xt_exchanger_get_MPI_Datatype(Xt_exchanger exchanger, int rank, enum xt_msg_direction direction)
Definition: xt_exchanger.c:128
struct xt_exchanger_vtable * vtable
Definition: xt_exchanger.h:73
void xt_exchanger_internal_optimize(size_t n, void *msgs, size_t msg_type_size, MPI_Comm comm)
Definition: xt_exchanger.c:87
int MPI_Comm
Definition: core.h:64
int xt_exchanger_get_msg_ranks(Xt_exchanger exchanger, enum xt_msg_direction direction, int **ranks)
Definition: xt_exchanger.c:120