Yet Another eXchange Tool 0.11.4
Loading...
Searching...
No Matches
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://dkrz-sw.gitlab-pages.dkrz.de/yaxt/
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 <stdbool.h>
55#include <mpi.h>
56
57#include "xt/xt_config.h"
58#include "xt/xt_core.h"
59#include "xt/xt_request.h"
60#include "xt_redist_internal.h"
61#include "core/ppm_visibility.h"
62
63
67typedef struct Xt_exchanger_omp_share_ *Xt_exchanger_omp_share;
68
70
73 void (*delete)(Xt_exchanger);
74 void (*s_exchange)(Xt_exchanger, const void *, void *);
75 void (*a_exchange)(Xt_exchanger, const void *, void *, Xt_request *request);
76 int (*get_msg_ranks)(Xt_exchanger, enum xt_msg_direction, int *restrict *);
78 bool);
79 void (*team_share_default_init)(void *share);
80 void (*team_share_destroy)(void *share);
83};
84
88
96xt_exchanger_s_exchange(Xt_exchanger exchanger, const void * src_data,
97 void * dst_data);
98
109 const void * src_data, void * dst_data,
110 Xt_request *request);
111
119xt_exchanger_copy(Xt_exchanger orig, MPI_Comm new_comm, int new_tag_offset);
120
126
138PPM_DSO_INTERNAL MPI_Datatype
140 int rank, enum xt_msg_direction direction,
141 bool do_dup);
142
156 enum xt_msg_direction direction,
157 int *restrict *ranks);
158
160(*Xt_exchanger_new)(int nsend, int nrecv,
161 const struct Xt_redist_msg *send_msgs,
162 const struct Xt_redist_msg *recv_msgs,
163 MPI_Comm comm, int tag_offset,
164 Xt_config config);
165
175
176/* team shares refer to expensive data that can be shared among
177 * multiple instances of exchangers that are of the same class and
178 * derived from the same xmap or communication matrix */
179
180enum { team_share_align = sizeof (void *) };
181
188PPM_DSO_INTERNAL size_t
190
199PPM_DSO_INTERNAL size_t
201
211 void *share);
222 void *share);
223
234xt_exchanger_team_share_destroy(Xt_exchanger exchanger, void *share);
235
249 void *share);
250
251
260
261
262
263
264#endif // XT_EXCHANGER_H
265/*
266 * Local Variables:
267 * c-basic-offset: 2
268 * coding: utf-8
269 * indent-tabs-mode: nil
270 * show-trailing-whitespace: t
271 * require-trailing-newline: t
272 * End:
273 */
int MPI_Comm
Definition core.h:64
#define PPM_DSO_INTERNAL
struct xt_exchanger_vtable * vtable
void(* team_share_destroy)(void *share)
int(* get_msg_ranks)(Xt_exchanger, enum xt_msg_direction, int *restrict *)
Xt_exchanger_omp_share(* create_omp_share)(Xt_exchanger)
Xt_exchanger(* copy)(Xt_exchanger, MPI_Comm, int)
void(* a_exchange)(Xt_exchanger, const void *, void *, Xt_request *request)
void(* team_share_default_init)(void *share)
void(* s_exchange)(Xt_exchanger, const void *, void *)
MPI_Datatype(* get_MPI_Datatype)(Xt_exchanger, int, enum xt_msg_direction, bool)
opaque configuration object for settings where the default needs to be overridden
base definitions header file
PPM_DSO_INTERNAL void xt_exchanger_team_share_destroy(Xt_exchanger exchanger, void *share)
PPM_DSO_INTERNAL const struct xt_exchanger_vtable * xt_exchanger_new_get_vtable(Xt_exchanger_new exchanger_new)
@ team_share_align
struct Xt_exchanger_omp_share_ * Xt_exchanger_omp_share
PPM_DSO_INTERNAL Xt_exchanger_omp_share xt_exchanger_create_omp_share(Xt_exchanger exchanger)
PPM_DSO_INTERNAL void xt_exchanger_delete(Xt_exchanger)
PPM_DSO_INTERNAL void xt_exchanger_team_share_default_init(Xt_exchanger exchanger, void *share)
struct Xt_exchanger_ * Xt_exchanger
PPM_DSO_INTERNAL void xt_exchanger_new_team_share_destroy(Xt_exchanger_new exchanger_new, void *share)
PPM_DSO_INTERNAL void xt_exchanger_new_team_share_default_init(Xt_exchanger_new exchanger_new, void *share)
PPM_DSO_INTERNAL void xt_exchanger_s_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data)
PPM_DSO_INTERNAL int xt_exchanger_get_msg_ranks(Xt_exchanger exchanger, enum xt_msg_direction direction, int *restrict *ranks)
PPM_DSO_INTERNAL void xt_exchanger_a_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data, Xt_request *request)
PPM_DSO_INTERNAL Xt_exchanger xt_exchanger_copy(Xt_exchanger orig, MPI_Comm new_comm, int new_tag_offset)
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, Xt_config config)
PPM_DSO_INTERNAL size_t xt_exchanger_new_team_get_share_size(Xt_exchanger_new exchanger_new)
PPM_DSO_INTERNAL size_t xt_exchanger_team_get_share_size(Xt_exchanger exchanger)
PPM_DSO_INTERNAL MPI_Datatype xt_exchanger_get_MPI_Datatype(Xt_exchanger exchanger, int rank, enum xt_msg_direction direction, bool do_dup)
redistribution of data, non-public declarations
xt_msg_direction