Yet Another eXchange Tool  0.9.0
xt_mpi.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://doc.redmine.dkrz.de/yaxt/html/
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_MPI_H
52 #define XT_MPI_H
53 
54 #ifdef HAVE_CONFIG_H
55 #include <config.h>
56 #endif
57 
58 #include <mpi.h>
59 
60 #include "xt/xt_core.h"
61 
68 #define xt_mpi_call(call, comm) \
69  do { \
70  int error_code = (call); \
71  if (error_code != MPI_SUCCESS) \
72  xt_mpi_error(error_code, comm); \
73  } while(0)
74 
81 void xt_mpi_error(int error_code, MPI_Comm comm);
82 
94 MPI_Datatype xt_mpi_generate_datatype(int const * displacements, int count,
95  MPI_Datatype old_type, MPI_Comm comm);
96 
109 MPI_Datatype xt_mpi_generate_datatype_block(const int *displacements,
110  const int *blocklengths,
111  int count, MPI_Datatype old_type,
112  MPI_Comm comm);
113 
126 MPI_Datatype xt_mpi_generate_datatype_stripe(const struct Xt_offset_ext *v,
127  int count, MPI_Datatype old_type,
128  MPI_Comm comm);
129 
130 
141 void
143 
144 #endif // XT_MPI_H
145 
146 /*
147  * Local Variables:
148  * c-basic-offset: 2
149  * coding: utf-8
150  * indent-tabs-mode: nil
151  * show-trailing-whitespace: t
152  * require-trailing-newline: t
153  * End:
154  */
int MPI_Comm
Definition: core.h:64
base definitions header file
MPI_Datatype xt_mpi_generate_datatype(int const *displacements, int count, MPI_Datatype old_type, MPI_Comm comm)
Definition: xt_mpi.c:264
MPI_Datatype xt_mpi_generate_datatype_stripe(const struct Xt_offset_ext *v, int count, MPI_Datatype old_type, MPI_Comm comm)
void xt_mpi_error(int error_code, MPI_Comm comm)
Definition: xt_mpi.c:80
MPI_Datatype xt_mpi_generate_datatype_block(const int *displacements, const int *blocklengths, int count, MPI_Datatype old_type, MPI_Comm comm)
Definition: xt_mpi.c:227
void xt_mpi_comm_mark_exclusive(MPI_Comm comm)
Definition: xt_mpi.c:881