1#ifndef MADNESS_STUBMPI_H
2#define MADNESS_STUBMPI_H
21#define MPI_STATUS_IGNORE ((MPI_Status *)1)
22#define MPI_STATUSES_IGNORE ((MPI_Status *)1)
25#define MPI_COMM_WORLD (0x44000000)
26#define MPI_UNDEFINED (-32766)
39#define MPI_ERR_IN_STATUS 999999
40#define MPI_ERRORS_RETURN 888888
41#define MPI_MAX_ERROR_STRING 1024
45#define MPI_CONGRUENT 1
50#define MPI_COMM_NULL ((MPI_Comm)0x04000000)
51#define MPI_OP_NULL ((MPI_Op)0x18000000)
52#define MPI_GROUP_NULL ((MPI_Group)0x08000000)
53#define MPI_DATATYPE_NULL ((MPI_Datatype)0x0c000000)
54#define MPI_REQUEST_NULL ((MPI_Request)0x2c000000)
55#define MPI_ERRHANDLER_NULL ((MPI_Errhandler)0x14000000)
59#define MPI_THREAD_SINGLE 0
60#define MPI_THREAD_FUNNELED 1
61#define MPI_THREAD_SERIALIZED 2
62#define MPI_THREAD_MULTIPLE 3
63#define MPI_COMM_TYPE_SHARED 4
66#define MPI_IN_PLACE ((void *) -1)
67#define MPI_PROC_NULL -1
68#define MPI_ANY_SOURCE -2
74#define MPI_CHAR ((MPI_Datatype)0x4c000101)
75#define MPI_SIGNED_CHAR ((MPI_Datatype)0x4c000118)
76#define MPI_UNSIGNED_CHAR ((MPI_Datatype)0x4c000102)
77#define MPI_BYTE ((MPI_Datatype)0x4c00010d)
78#define MPI_WCHAR ((MPI_Datatype)0x4c00040e)
79#define MPI_SHORT ((MPI_Datatype)0x4c000203)
80#define MPI_UNSIGNED_SHORT ((MPI_Datatype)0x4c000204)
81#define MPI_INT ((MPI_Datatype)0x4c000405)
82#define MPI_UNSIGNED ((MPI_Datatype)0x4c000406)
83#define MPI_LONG ((MPI_Datatype)0x4c000807)
84#define MPI_UNSIGNED_LONG ((MPI_Datatype)0x4c000808)
85#define MPI_FLOAT ((MPI_Datatype)0x4c00040a)
86#define MPI_DOUBLE ((MPI_Datatype)0x4c00080b)
87#define MPI_LONG_DOUBLE ((MPI_Datatype)0x4c00100c)
88#define MPI_LONG_LONG_INT ((MPI_Datatype)0x4c000809)
89#define MPI_UNSIGNED_LONG_LONG ((MPI_Datatype)0x4c000819)
90#define MPI_LONG_LONG ((MPI_Datatype)0x4c000809)
96 *extent =
sizeof(char);
break;
98 *extent =
sizeof(
signed char);
break;
100 *extent =
sizeof(
unsigned char);
break;
104 *extent =
sizeof(wchar_t);
break;
106 *extent =
sizeof(short);
break;
108 *extent =
sizeof(
unsigned short);
break;
110 *extent =
sizeof(int);
break;
112 *extent =
sizeof(unsigned);
break;
114 *extent =
sizeof(long);
break;
116 *extent =
sizeof(
unsigned long);
break;
118 *extent =
sizeof(float);
break;
120 *extent =
sizeof(double);
break;
122 *extent =
sizeof(
long double);
break;
124 *extent =
sizeof(
long long int);
break;
126 *extent =
sizeof(
unsigned long long);
break;
137#define MPI_MAX ((MPI_Op)0x58000001)
138#define MPI_MIN ((MPI_Op)0x58000002)
139#define MPI_SUM ((MPI_Op)0x58000003)
140#define MPI_PROD ((MPI_Op)0x58000004)
141#define MPI_LAND ((MPI_Op)0x58000005)
142#define MPI_BAND ((MPI_Op)0x58000006)
143#define MPI_LOR ((MPI_Op)0x58000007)
144#define MPI_BOR ((MPI_Op)0x58000008)
145#define MPI_LXOR ((MPI_Op)0x58000009)
146#define MPI_BXOR ((MPI_Op)0x5800000a)
147#define MPI_MINLOC ((MPI_Op)0x5800000b)
148#define MPI_MAXLOC ((MPI_Op)0x5800000c)
149#define MPI_REPLACE ((MPI_Op)0x5800000d)
219 void *recvbuf,
const int recvcounts[],
const int displs[],
MPI_Datatype recvtype,
229 MADNESS_ASSERT(sendcount * sendtype_extent <= recvcounts[0] * recvtype_extent);
230 std::memcpy(recvbuf, sendbuf, sendcount * sendtype_extent);
235 const int recvcounts[1] = {recvcount};
236 const int displs[1] = {0};
237 return MPI_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm);
245 if(sendbuf !=
MPI_IN_PLACE) std::memcpy(recvbuf, sendbuf, count);
249 if(sendbuf !=
MPI_IN_PLACE) std::memcpy(recvbuf, sendbuf, count);
287 if (comm1 == comm2) {
300 std::strncpy(
string,
"Success", *resultlen);
304 std::strncpy(
string,
"Invalid communicator", *resultlen);
308 std::strncpy(
string,
"Invalid argument", *resultlen);
Tensor< double > op(const Tensor< double > &x)
Definition kain.cc:508
Macros and tools pertaining to the configuration of MADNESS.
Defines madness::MadnessException for exception handling.
#define MADNESS_ASSERT(condition)
Assert a condition that should be free of side-effects since in release builds this might be a no-op.
Definition madness_exception.h:134
double wall_time()
Returns the wall time in seconds relative to an arbitrary origin.
Definition timers.cc:48
static const double b
Definition nonlinschro.cc:119
static const double a
Definition nonlinschro.cc:118
int count
Definition stubmpi.h:14
int cancelled
Definition stubmpi.h:15
int MPI_SOURCE
Definition stubmpi.h:16
int MPI_TAG
Definition stubmpi.h:17
int MPI_ERROR
Definition stubmpi.h:18
#define MPI_SUCCESS
Definition stubmpi.h:36
int MPI_Op_free(MPI_Op *op)
Definition stubmpi.h:326
#define MPI_SIGNED_CHAR
Definition stubmpi.h:75
int MPI_Ssend(void *, int, MPI_Datatype, int, int, MPI_Comm)
Definition stubmpi.h:212
void() MPI_User_function(void *a, void *b, int *len, MPI_Datatype *)
Definition stubmpi.h:152
int MPI_Info_create(MPI_Info *info)
Definition stubmpi.h:330
int MPI_Bcast(void *, int, MPI_Datatype, int, MPI_Comm)
Definition stubmpi.h:241
#define MPI_ERR_COMM
Definition stubmpi.h:37
#define MPI_COMM_NULL
Definition stubmpi.h:50
int MPI_Error_string(int errorcode, char *string, int *resultlen)
Definition stubmpi.h:296
int MPI_Isend(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *)
Definition stubmpi.h:209
int MPI_Op
Definition stubmpi.h:136
int MPI_Group_free(MPI_Group *group)
Definition stubmpi.h:167
int MPI_Request
Definition stubmpi.h:12
#define MPI_WCHAR
Definition stubmpi.h:78
int MPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm *newcomm)
Definition stubmpi.h:255
int MPI_Errhandler
Definition stubmpi.h:28
std::ptrdiff_t MPI_Aint
Definition stubmpi.h:32
#define MPI_COMM_WORLD
Definition stubmpi.h:25
int MPI_Group
Definition stubmpi.h:11
int MPI_Comm_compare(MPI_Comm comm1, MPI_Comm comm2, int *result)
Definition stubmpi.h:286
#define MPI_UNSIGNED_LONG_LONG
Definition stubmpi.h:89
int MPI_Type_get_extent(MPI_Datatype datatype, MPI_Aint *lb, MPI_Aint *extent)
Definition stubmpi.h:92
#define MPI_INT
Definition stubmpi.h:81
int MPI_Finalize()
Definition stubmpi.h:175
#define MPI_FLOAT
Definition stubmpi.h:85
int MPI_Info_free(MPI_Info *info)
Definition stubmpi.h:331
int MPI_Query_thread(int *provided)
Definition stubmpi.h:177
int MPI_Comm_create(MPI_Comm, MPI_Group, MPI_Comm *newcomm)
Definition stubmpi.h:270
int MPI_Op_create(MPI_User_function *user_fn, int commute, MPI_Op *op)
Definition stubmpi.h:322
int MPI_Finalized(int *flag)
Definition stubmpi.h:176
#define MPI_BYTE
Definition stubmpi.h:77
int MPI_Recv(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Status *)
Definition stubmpi.h:215
int MPI_Comm
Definition stubmpi.h:24
#define MPI_IDENT
Definition stubmpi.h:44
int MPI_Issend(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *)
Definition stubmpi.h:210
int MPI_Init_thread(int *, char ***, int, int *provided)
Definition stubmpi.h:173
#define MPI_ERR_ARG
Definition stubmpi.h:38
#define MPI_UNEQUAL
Definition stubmpi.h:47
#define MPI_UNSIGNED_CHAR
Definition stubmpi.h:76
unsigned int MPI_Comm_size(MPI_Comm, int *size)
Definition stubmpi.h:206
int MPI_Buffer_attach(void *, int)
Definition stubmpi.h:180
#define MPI_GROUP_NULL
Definition stubmpi.h:52
int MPI_Comm_set_errhandler(MPI_Comm comm, MPI_Errhandler errhandler)
Definition stubmpi.h:318
int MPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm *newcomm)
Definition stubmpi.h:261
int MPI_Abort(MPI_Comm, int code)
Definition stubmpi.h:266
int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int recvcounts[], const int displs[], MPI_Datatype recvtype, int root, MPI_Comm)
Definition stubmpi.h:218
#define MPI_UNSIGNED_LONG
Definition stubmpi.h:84
int MPI_Group_translate_ranks(MPI_Group, int, const int[], MPI_Group, int ranks2[])
Definition stubmpi.h:155
#define MPI_SHORT
Definition stubmpi.h:79
int MPI_Comm_rank(MPI_Comm, int *rank)
Definition stubmpi.h:205
int MPI_Comm_free(MPI_Comm *comm)
Definition stubmpi.h:281
double MPI_Wtime()
Definition stubmpi.h:320
int MPI_Comm_get_attr(MPI_Comm, int, void *, int *)
Definition stubmpi.h:253
int MPI_Info
Definition stubmpi.h:30
#define MPI_DOUBLE
Definition stubmpi.h:86
#define MPI_LONG
Definition stubmpi.h:83
int MPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype, MPI_Op, MPI_Comm)
Definition stubmpi.h:248
#define MPI_LONG_LONG_INT
Definition stubmpi.h:88
#define MPI_IN_PLACE
Definition stubmpi.h:66
int MPI_Bsend(void *, int, MPI_Datatype, int, int, MPI_Comm)
Definition stubmpi.h:213
int MPI_Irecv(void *, int, MPI_Datatype, int, int, MPI_Comm, MPI_Request *)
Definition stubmpi.h:214
int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
Definition stubmpi.h:233
#define MPI_CHAR
Definition stubmpi.h:74
#define MPI_UNSIGNED
Definition stubmpi.h:82
int MPI_Comm_group(MPI_Comm, MPI_Group *group)
Definition stubmpi.h:276
#define MPI_UNSIGNED_SHORT
Definition stubmpi.h:80
int MPI_Barrier(MPI_Comm)
Definition stubmpi.h:268
int MPI_Testsome(int, MPI_Request *, int *outcount, int *, MPI_Status *)
Definition stubmpi.h:194
int MPI_Get_count(MPI_Status *, MPI_Datatype, int *count)
Definition stubmpi.h:199
int MPI_Initialized(int *flag)
Definition stubmpi.h:174
int MPI_Init(int *, char ***)
Definition stubmpi.h:172
int MPI_Send(void *, int, MPI_Datatype, int, int, MPI_Comm)
Definition stubmpi.h:211
#define MPI_LONG_DOUBLE
Definition stubmpi.h:87
int MPI_Test(MPI_Request *, int *flag, MPI_Status *)
Definition stubmpi.h:183
int MPI_Group_incl(MPI_Group group, int n, const int ranks[], MPI_Group *newgroup)
Definition stubmpi.h:162
int MPI_Buffer_detach(void *buffer, int *size)
Definition stubmpi.h:181
int MPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype, MPI_Op, int, MPI_Comm)
Definition stubmpi.h:244
#define MPI_UNDEFINED
Definition stubmpi.h:26
int MPI_Datatype
Definition stubmpi.h:73
int MPI_Testany(int, MPI_Request[], int *index, int *flag, MPI_Status *)
Definition stubmpi.h:188
Wrappers around platform dependent timers and performance info.