Yet Another eXchange Tool 0.11.4
Loading...
Searching...
No Matches
xt_exchanger.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://dkrz-sw.gitlab-pages.dkrz.de/yaxt/
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#ifdef HAVE_CONFIG_H
47#include <config.h>
48#endif
49
50#include <string.h>
51#include <stdlib.h>
52
53#include "xt/xt_mpi.h"
54#include "xt_exchanger.h"
60
62xt_exchanger_copy(Xt_exchanger exchanger, MPI_Comm new_comm, int new_tag_offset)
63{
64 return exchanger->vtable->copy(exchanger, new_comm, new_tag_offset);
65}
66
68
69 exchanger->vtable->delete(exchanger);
70}
71
72void xt_exchanger_s_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data) {
73
74 exchanger->vtable->s_exchange(exchanger, src_data, dst_data);
75}
76
78 const void *src_data, void *dst_data,
79 Xt_request *request) {
80
81 exchanger->vtable->a_exchange(exchanger, src_data, dst_data, request);
82}
83
84int
86 enum xt_msg_direction direction,
87 int *restrict *ranks)
88{
89 return exchanger->vtable->get_msg_ranks(exchanger, direction, ranks);
90}
91
92MPI_Datatype
94 enum xt_msg_direction direction, bool do_dup) {
95 return exchanger->vtable->get_MPI_Datatype(exchanger, rank, direction, do_dup);
96}
97
100{
101 return exchanger->vtable->create_omp_share(exchanger);
102}
103
104
105/*
106 * Local Variables:
107 * c-basic-offset: 2
108 * coding: utf-8
109 * indent-tabs-mode: nil
110 * show-trailing-whitespace: t
111 * require-trailing-newline: t
112 * End:
113 */
int MPI_Comm
Definition core.h:64
struct xt_exchanger_vtable * vtable
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(* delete)(Xt_exchanger)
void(* s_exchange)(Xt_exchanger, const void *, void *)
MPI_Datatype(* get_MPI_Datatype)(Xt_exchanger, int, enum xt_msg_direction, bool)
Xt_exchanger_omp_share xt_exchanger_create_omp_share(Xt_exchanger exchanger)
void xt_exchanger_s_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data)
int xt_exchanger_get_msg_ranks(Xt_exchanger exchanger, enum xt_msg_direction direction, int *restrict *ranks)
void xt_exchanger_a_exchange(Xt_exchanger exchanger, const void *src_data, void *dst_data, Xt_request *request)
void xt_exchanger_delete(Xt_exchanger exchanger)
Xt_exchanger xt_exchanger_copy(Xt_exchanger exchanger, MPI_Comm new_comm, int new_tag_offset)
MPI_Datatype xt_exchanger_get_MPI_Datatype(Xt_exchanger exchanger, int rank, enum xt_msg_direction direction, bool do_dup)
exchanging of data based on information provided by redist's
struct Xt_exchanger_omp_share_ * Xt_exchanger_omp_share
utility routines for MPI
xt_msg_direction