Yet Another eXchange Tool 0.11.2
Loading...
Searching...
No Matches
xt_mpi_internal.h
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#ifndef XT_MPI_INTERNAL_H
47#define XT_MPI_INTERNAL_H
48
49#ifdef HAVE_CONFIG_H
50#include <config.h>
51#endif
52
53#include <stdbool.h>
54#include <mpi.h>
55
56#include "xt/xt_mpi.h"
57#include "xt_mpi_ddt_cache.h"
58#include "core/ppm_visibility.h"
59
62
71
73xt_disp2ext_count(size_t disp_len, const int *disp);
74
76xt_disp2ext(size_t disp_len, const int *disp,
77 struct Xt_offset_ext *restrict v);
78
84 struct Xt_mpiddt_list ddt_list;
86 MPI_Datatype old_type;
88};
89
90static inline void
92 MPI_Datatype old_type,
93 MPI_Comm comm)
94{
95 MPI_Aint old_type_lb;
96 xt_mpi_call(MPI_Type_get_extent(old_type, &old_type_lb,
97 &params->old_type_extent), comm);
98 params->old_type = old_type;
99 params->comm = comm;
101}
102
103static inline void
105{
106 Xt_mpi_ddt_cache_free(&params->ddt_list, params->comm);
107 params->old_type = MPI_DATATYPE_NULL;
108 params->comm = MPI_COMM_NULL;
109}
110
111PPM_DSO_INTERNAL MPI_Datatype
113 size_t vlen,
114 const struct Xt_offset_ext v[vlen],
115 struct Xt_mpi_strp_prs_params *params);
116
117PPM_DSO_INTERNAL MPI_Datatype
119 size_t vlen,
120 const struct Xt_aoffset_ext v[vlen],
121 struct Xt_mpi_strp_prs_params *params);
122
123PPM_DSO_INTERNAL MPI_Datatype
124xt_mpi_ddt_block_gen(int count, const int *disp, const int *blocklengths,
125 struct Xt_mpi_strp_prs_params *params);
126
127
129xt_mpi_init(void);
131xt_mpi_finalize(void);
132
134xt_mpi_comm_smart_dup(MPI_Comm comm, int *tag_offset);
135
137xt_mpi_comm_smart_dedup(MPI_Comm *comm, int tag_offset);
138
153xt_mpi_test_some(int *restrict num_req,
154 MPI_Request req[],
155 int ops_completed[], MPI_Comm comm);
156
157#ifdef _OPENMP
163xt_mpi_test_some_mt(int *restrict num_req,
164 MPI_Request *restrict req,
165 int *restrict ops_completed, MPI_Comm comm);
166#endif
167#endif
168
169/*
170 * Local Variables:
171 * c-basic-offset: 2
172 * coding: utf-8
173 * indent-tabs-mode: nil
174 * show-trailing-whitespace: t
175 * require-trailing-newline: t
176 * End:
177 */
@ MPI_COMM_NULL
Definition core.h:74
int MPI_Comm
Definition core.h:64
#define PPM_DSO_INTERNAL
struct Xt_mpiddt_list ddt_list
utility routines for MPI
#define xt_mpi_call(call, comm)
Definition xt_mpi.h:68
void Xt_mpi_ddt_cache_free(struct Xt_mpiddt_list *ddt_list, MPI_Comm comm)
#define Xt_mpiddt_empty_list
PPM_DSO_INTERNAL MPI_Datatype xt_mpi_parse_astripe(size_t vlen, const struct Xt_aoffset_ext v[vlen], struct Xt_mpi_strp_prs_params *params)
static void xt_destroy_mpi_strp_prs_params(struct Xt_mpi_strp_prs_params *params)
PPM_DSO_INTERNAL MPI_Comm xt_mpi_comm_smart_dup(MPI_Comm comm, int *tag_offset)
Definition xt_mpi.c:333
PPM_DSO_INTERNAL void xt_mpi_comm_smart_dedup(MPI_Comm *comm, int tag_offset)
Definition xt_mpi.c:386
PPM_DSO_INTERNAL MPI_Datatype xt_mpi_ddt_block_gen(int count, const int *disp, const int *blocklengths, struct Xt_mpi_strp_prs_params *params)
PPM_DSO_INTERNAL size_t xt_disp2ext_count(size_t disp_len, const int *disp)
Definition xt_mpi.c:92
xt_mpi_tags
@ xt_mpi_tag_xmap_dist_dir_dst_send
@ xt_mpi_num_tags
@ xt_mpi_tag_xmap_intersection_data_exchange
@ xt_mpi_tag_xmap_dist_dir_src_send
@ xt_mpi_tag_xmap_intersection_header_exchange
@ xt_mpi_tag_exchange_msg
PPM_DSO_INTERNAL bool xt_mpi_test_some(int *restrict num_req, MPI_Request req[], int ops_completed[], MPI_Comm comm)
PPM_DSO_INTERNAL void xt_mpi_init(void)
Definition xt_mpi.c:246
PPM_DSO_INTERNAL size_t xt_disp2ext(size_t disp_len, const int *disp, struct Xt_offset_ext *restrict v)
Definition xt_mpi.c:133
PPM_DSO_INTERNAL void xt_mpi_finalize(void)
Definition xt_mpi.c:261
static void xt_init_mpi_strp_prs_params(struct Xt_mpi_strp_prs_params *params, MPI_Datatype old_type, MPI_Comm comm)
PPM_DSO_INTERNAL MPI_Datatype xt_mpi_parse_stripe(size_t vlen, const struct Xt_offset_ext v[vlen], struct Xt_mpi_strp_prs_params *params)