Yet Another eXchange Tool 0.11.4
Loading...
Searching...
No Matches
xt_ddt_internal.h
Go to the documentation of this file.
1
15/*
16 * Keywords:
17 * Maintainer: Jörg Behrens <behrens@dkrz.de>
18 * Moritz Hanke <hanke@dkrz.de>
19 * Thomas Jahns <jahns@dkrz.de>
20 *
21 * URL: https://dkrz-sw.gitlab-pages.dkrz.de/yaxt/
22 *
23 * Redistribution and use in source and binary forms, with or without
24 * modification, are permitted provided that the following conditions are
25 * met:
26 *
27 * Redistributions of source code must retain the above copyright notice,
28 * this list of conditions and the following disclaimer.
29 *
30 * Redistributions in binary form must reproduce the above copyright
31 * notice, this list of conditions and the following disclaimer in the
32 * documentation and/or other materials provided with the distribution.
33 *
34 * Neither the name of the DKRZ GmbH nor the names of its contributors
35 * may be used to endorse or promote products derived from this software
36 * without specific prior written permission.
37 *
38 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
39 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
40 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
41 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
42 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
43 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
44 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
45 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
46 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
47 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
48 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 */
50
51#ifndef XT_DDT_INTERNAL_H
52#define XT_DDT_INTERNAL_H
53
54#include "xt_ddt.h"
55#include "xt_gpu.h"
56
57#include "core/ppm_visibility.h"
58
60 size_t kernel_idx; // index into the list of available pack/unpack kernels
61 size_t displ_count; // number of elements in displs
63 // displacements in byte of elements (int does not work)
64 // (if required this array has to be available
65 // in GPU memory)
66};
67
68struct Xt_ddt_ {
69
70 size_t pack_size;
71 size_t count; // number of elements in data
73
74
75 int displs_available[XT_MEMTYPE_COUNT]; // determines in which memory type
76 // the displacements are available
77
78 // if exchange data is on GPU, one kernel per data entry is launched
79 struct xt_ddt_data data[];
80};
81
82typedef void (*xt_ddt_kernel_func)
83 (size_t, ssize_t*, const void*, void*, enum xt_memtype);
84
91
92enum { NUM_VALID_KERNELS = 9 };
95
109xt_ddt_from_mpi_ddt(MPI_Datatype mpi_ddt);
110
117
126
132PPM_DSO_INTERNAL size_t
134
144 Xt_ddt ddt, void const * src, void * dst, enum xt_memtype memtype);
145
155 Xt_ddt ddt, void const * src, void * dst, enum xt_memtype memtype);
156
157#endif // XT_DDT_INTERNAL_H
158
159/*
160 * Local Variables:
161 * c-basic-offset: 2
162 * coding: utf-8
163 * indent-tabs-mode: nil
164 * show-trailing-whitespace: t
165 * require-trailing-newline: t
166 * End:
167 */
#define PPM_DSO_INTERNAL
size_t count
size_t pack_size
int displs_available[XT_MEMTYPE_COUNT]
struct xt_ddt_data data[]
ssize_t * displs[XT_MEMTYPE_COUNT]
xt_ddt_kernel_func pack
xt_ddt_kernel_func unpack
utility routines for manual handling of MPI DDT's
PPM_DSO_INTERNAL size_t xt_ddt_get_pack_size_internal(Xt_ddt ddt)
Definition xt_ddt.c:166
PPM_DSO_INTERNAL Xt_ddt xt_ddt_from_mpi_ddt(MPI_Datatype mpi_ddt)
PPM_DSO_INTERNAL void xt_ddt_delete(Xt_ddt ddt)
void(* xt_ddt_kernel_func)(size_t, ssize_t *, const void *, void *, enum xt_memtype)
PPM_DSO_INTERNAL void xt_ddt_inc_ref_count(Xt_ddt ddt)
PPM_DSO_INTERNAL void xt_ddt_unpack_internal(Xt_ddt ddt, void const *src, void *dst, enum xt_memtype memtype)
Definition xt_ddt.c:553
PPM_DSO_INTERNAL struct xt_ddt_kernels xt_ddt_valid_kernels[NUM_VALID_KERNELS]
Definition xt_ddt.c:127
@ NUM_VALID_KERNELS
PPM_DSO_INTERNAL void xt_ddt_pack_internal(Xt_ddt ddt, void const *src, void *dst, enum xt_memtype memtype)
Definition xt_ddt.c:341
routines for using GPU devices
xt_memtype
Definition xt_gpu.h:68
@ XT_MEMTYPE_COUNT
Definition xt_gpu.h:71