-
Notifications
You must be signed in to change notification settings - Fork 40
/
mpi_types.h
195 lines (159 loc) · 7.46 KB
/
mpi_types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/**
Copyright 2009-2024 National Technology and Engineering Solutions of Sandia,
LLC (NTESS). Under the terms of Contract DE-NA-0003525, the U.S. Government
retains certain rights in this software.
Sandia National Laboratories is a multimission laboratory managed and operated
by National Technology and Engineering Solutions of Sandia, LLC., a wholly
owned subsidiary of Honeywell International, Inc., for the U.S. Department of
Energy's National Nuclear Security Administration under contract DE-NA0003525.
Copyright (c) 2009-2024, NTESS
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Questions? Contact [email protected]
*/
#ifndef sumi_mpi_MPITYPES_H_IN
#define sumi_mpi_MPITYPES_H_IN
#ifdef __cpluscplus
#include <cstdint>
#else
#include <stdint.h>
#endif
typedef uintptr_t MPI_Aint;
#include <sumi-mpi/mpi_integers.h>
#include <sumi-mpi/mpi_status.h>
// useful flags
#define MPI_PROC_NULL (-1)
#define MPI_ANY_SOURCE (-2)
#define MPI_ROOT (-3)
#define MPI_ANY_TAG (-1)
#define MPI_LOCK_SHARED 0
#define MPI_LOCK_EXCLUSIVE 1
/** Define the error codes for use as return values */
#define MPI_SUCCESS 0
#define MPI_ERR_BUFFER 1 // Invalid buffer pointer
#define MPI_ERR_COUNT 2 // Invalid count argument
#define MPI_ERR_TYPE 3 // Invalid datatype argument
#define MPI_ERR_TAG 4 // Invalid tag argument
#define MPI_ERR_COMM 5 // Invalid communicator
#define MPI_ERR_RANK 6 // Invalid rank
#define MPI_ERR_REQUEST 7 // Invalid request
#define MPI_ERR_ROOT 8 // Invalid root
#define MPI_ERR_GROUP 9 // Invalid group
#define MPI_ERR_OP 10 // Invalid operation
#define MPI_ERR_TOPOLOGY 11 // Invalid topology
#define MPI_ERR_DIMS 12 // Invalid dimensions argument
#define MPI_ERR_ARG 13 // Invalid argument of some other kind
#define MPI_ERR_UNKNOWN 14 // Unknown error
#define MPI_ERR_TRUNCATE 15 // Message truncated on receive
#define MPI_ERR_OTHER 16 // Known error not in this list
#define MPI_ERR_INTERN 17 // Internal MPI error
#define MPI_ERR_IN_STATUS 18 // Error code is in status
#define MPI_ERR_PENDING 19 // Pending request
#define MPI_ERR_NO_MEM 20
#define MPI_ERR_LASTCODE 21 // Last error code
/** Define a null payload */
#define MPI_PAYLOAD_IGNORE NULL
#define MPI_STATUSES_IGNORE 0
#define MPI_STATUS_IGNORE 0
/* Make the C names for the dup function mixed case.
This is required for systems that use all uppercase names for Fortran
externals. */
/* MPI 1 names */
#define MPI_NULL_COPY_FN ((MPI_Copy_function *)0)
#define MPI_NULL_DELETE_FN ((MPI_Delete_function *)0)
#define MPI_DUP_FN MPIR_Dup_fn
/* MPI 2 names */
#define MPI_COMM_NULL_COPY_FN ((MPI_Comm_copy_attr_function*)0)
#define MPI_COMM_NULL_DELETE_FN ((MPI_Comm_delete_attr_function*)0)
#define MPI_COMM_DUP_FN ((MPI_Comm_copy_attr_function *)MPI_DUP_FN)
#define MPI_WIN_NULL_COPY_FN ((MPI_Win_copy_attr_function*)0)
#define MPI_WIN_NULL_DELETE_FN ((MPI_Win_delete_attr_function*)0)
#define MPI_WIN_DUP_FN ((MPI_Win_copy_attr_function*)MPI_DUP_FN)
#define MPI_TYPE_NULL_COPY_FN ((MPI_Type_copy_attr_function*)0)
#define MPI_TYPE_NULL_DELETE_FN ((MPI_Type_delete_attr_function*)0)
#define MPI_TYPE_DUP_FN ((MPI_Type_copy_attr_function*)MPI_DUP_FN)
/* Topology types */
typedef enum MPIR_Topo_type { MPI_GRAPH=1, MPI_CART=2, MPI_DIST_GRAPH=3 } MPIR_Topo_type;
//offset everything by 8
//the null pointer is reserved specially for indicating a no-op
#define MPI_BOTTOM (void *)8
/* Permanent key values */
/* C Versions (return pointer to value),
Fortran Versions (return integer value).
Handled directly by the attribute value routine
DO NOT CHANGE THESE. The values encode:
builtin kind (0x1 in bit 30-31)
Keyval object (0x9 in bits 26-29)
for communicator (0x1 in bits 22-25)
Fortran versions of the attributes are formed by adding one to
the C version.
*/
#define int_UB 0x64400001
#define MPI_HOST 0x64400003
#define MPI_IO 0x64400005
#define MPI_WTIME_IS_GLOBAL 0x64400007
#define MPI_UNIVERSE_SIZE 0x64400009
#define MPI_LASTUSEDCODE 0x6440000b
#define MPI_APPNUM 0x6440000d
typedef int MPI_Fint;
typedef struct ADIOI_FileD *MPI_File;
#define MPI_FILE_NULL NULL
#define MPI_VERSION 2
#define MPI_SUBVERSION 0
/* For supported thread levels */
#define MPI_THREAD_SINGLE 0
#define MPI_THREAD_FUNNELED 1
#define MPI_THREAD_SERIALIZED 2
#define MPI_THREAD_MULTIPLE 3
/* Upper bound on the overhead in bsend for each message buffer */
#define MPI_BSEND_OVERHEAD 88
/* User combination function */
typedef void (MPI_User_function) ( void *, void *, int *, MPI_Datatype * );
/* C functions */
typedef void (MPI_Handler_function) ( MPI_Comm *, int *, ... );
typedef int (MPI_Comm_copy_attr_function)(MPI_Comm, int, void *, void *,
void *, int *);
typedef int (MPI_Comm_delete_attr_function)(MPI_Comm, int, void *, void *);
typedef int (MPI_Type_copy_attr_function)(MPI_Datatype, int, void *, void *,
void *, int *);
typedef int (MPI_Type_delete_attr_function)(MPI_Datatype, int, void *, void *);
typedef int (MPI_Win_copy_attr_function)(MPI_Win, int, void *, void *, void *,
int *);
typedef int (MPI_Win_delete_attr_function)(MPI_Win, int, void *, void *);
/* added in MPI-2.2 */
typedef void (MPI_Comm_errhandler_function)(MPI_Comm *, int *, ...);
typedef void (MPI_File_errhandler_function)(MPI_File *, int *, ...);
typedef void (MPI_Win_errhandler_function)(MPI_Win *, int *, ...);
/* names that were added in MPI-2.0 and deprecated in MPI-2.2 */
typedef MPI_Comm_errhandler_function MPI_Comm_errhandler_fn;
typedef MPI_File_errhandler_function MPI_File_errhandler_fn;
typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn;
/* Typedefs for generalized requests */
typedef int (MPI_Grequest_cancel_function)(void *, int);
typedef int (MPI_Grequest_free_function)(void *);
typedef int (MPI_Grequest_query_function)(void *, MPI_Status *);
#define MPI_TYPECLASS_REAL 1
#define MPI_TYPECLASS_INTEGER 2
#define MPI_TYPECLASS_COMPLEX 3
#endif // MPITYPES_H_IN