Yet Another eXchange Tool  0.9.0
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/xt_request.h"
58 #include "xt_redist_internal.h"
59 
63 typedef struct Xt_exchanger_ *Xt_exchanger;
64 
67  void (*delete)(Xt_exchanger);
68  void (*s_exchange)(Xt_exchanger, const void *, void *);
69  void (*a_exchange)(Xt_exchanger, const void *, void *, Xt_request *request);
70  int (*get_msg_ranks)(Xt_exchanger, enum xt_msg_direction, int *restrict *);
71  MPI_Datatype (*get_MPI_Datatype)(Xt_exchanger, int, enum xt_msg_direction);
72 };
73 
74 struct Xt_exchanger_ {
76 };
77 
84 void xt_exchanger_s_exchange(Xt_exchanger exchanger, const void * src_data,
85  void * dst_data);
86 
94  const void * src_data, void * dst_data,
95  Xt_request *request);
96 
104 xt_exchanger_copy(Xt_exchanger orig, MPI_Comm new_comm, int new_tag_offset);
105 
110 
121 void xt_exchanger_internal_optimize(size_t n, void * msgs, size_t msg_type_size,
122  MPI_Comm comm);
123 
134 MPI_Datatype
136  int rank, enum xt_msg_direction direction);
137 
149 int
151  enum xt_msg_direction direction,
152  int *restrict *ranks);
153 
155 (*Xt_exchanger_new)(int nsend, int nrecv,
156  const struct Xt_redist_msg *send_msgs,
157  const struct Xt_redist_msg *recv_msgs,
158  MPI_Comm comm, int tag_offset);
159 
160 #endif // XT_EXCHANGER_H
161 /*
162  * Local Variables:
163  * c-basic-offset: 2
164  * coding: utf-8
165  * indent-tabs-mode: nil
166  * show-trailing-whitespace: t
167  * require-trailing-newline: t
168  * End:
169  */
int MPI_Comm
Definition: core.h:64
struct xt_exchanger_vtable * vtable
Definition: xt_exchanger.h:75
int(* get_msg_ranks)(Xt_exchanger, enum xt_msg_direction, int *restrict *)
Definition: xt_exchanger.h:70
Xt_exchanger(* copy)(Xt_exchanger, MPI_Comm, int)
Definition: xt_exchanger.h:66
void(* a_exchange)(Xt_exchanger, const void *, void *, Xt_request *request)
Definition: xt_exchanger.h:69
MPI_Datatype(* get_MPI_Datatype)(Xt_exchanger, int, enum xt_msg_direction)
Definition: xt_exchanger.h:71
void(* s_exchange)(Xt_exchanger, const void *, void *)
Definition: xt_exchanger.h:68
base definitions header file
Xt_exchanger(* Xt_exchanger_new)(int nsend, int nrecv, const struct Xt_redist_msg *send_msgs, const struct Xt_redist_msg *recv_msgs, MPI_Comm comm, int tag_offset)
Definition: xt_exchanger.h:155
void xt_exchanger_internal_optimize(size_t n, void *msgs, size_t msg_type_size, MPI_Comm comm)
Definition: xt_exchanger.c:90
void xt_exchanger_s_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data)
Definition: xt_exchanger.c:71
int xt_exchanger_get_msg_ranks(Xt_exchanger exchanger, enum xt_msg_direction direction, int *restrict *ranks)
Definition: xt_exchanger.c:126
void xt_exchanger_a_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data, Xt_request *request)
Definition: xt_exchanger.c:76
struct Xt_exchanger_ * Xt_exchanger
Definition: xt_exchanger.h:63
MPI_Datatype xt_exchanger_get_MPI_Datatype(Xt_exchanger exchanger, int rank, enum xt_msg_direction direction)
Definition: xt_exchanger.c:134
Xt_exchanger xt_exchanger_copy(Xt_exchanger orig, MPI_Comm new_comm, int new_tag_offset)
Definition: xt_exchanger.c:61
void xt_exchanger_delete(Xt_exchanger)
Definition: xt_exchanger.c:66
redistribution of data, non-public declarations
xt_msg_direction