6 #if !defined(__MPIUNI_H) 7 #error "Wrong mpi.h included! require mpi.h from MPIUNI" 9 #if !defined(PETSC_STDCALL) 13 #if defined(PETSC_HAVE_STDLIB_H) 20 int MPIUNI_DATASIZE[10] = {
sizeof(int),
sizeof(
float),
sizeof(double),2*
sizeof(
double),
sizeof(char),2*
sizeof(
int),4*
sizeof(double),4,8,2*
sizeof(
double)};
36 #if defined(__cplusplus) 48 for (i=0; i<n; i++) aa[i] = bb[i];
87 if (attr[keyval].active && attr[keyval].del) {
91 (*(attr[keyval].
del))(comm,keyval,save_attribute_val,attr[keyval].
extra_state);
99 *flag = attr[keyval].
active;
100 *(
void **)attribute_val = attr[keyval].attribute_val;
124 if (attr[i].active && attr[i].del) {
125 (*attr[i].
del)(*comm,i,attr[i].attribute_val,attr[i].extra_state);
157 if (MPI_was_initialized)
return 1;
158 if (MPI_was_finalized)
return 1;
159 MPI_was_initialized = 1;
165 if (MPI_was_finalized)
return 1;
166 if (!MPI_was_initialized)
return 1;
167 MPI_was_finalized = 1;
185 #if defined(PETSC_HAVE_FORTRAN_CAPS) 186 #define mpi_init_ MPI_INIT 187 #define mpi_finalize_ MPI_FINALIZE 188 #define mpi_comm_size_ MPI_COMM_SIZE 189 #define mpi_comm_rank_ MPI_COMM_RANK 190 #define mpi_abort_ MPI_ABORT 191 #define mpi_reduce_ MPI_REDUCE 192 #define mpi_allreduce_ MPI_ALLREDUCE 193 #define mpi_barrier_ MPI_BARRIER 194 #define mpi_bcast_ MPI_BCAST 195 #define mpi_gather_ MPI_GATHER 196 #define mpi_allgather_ MPI_ALLGATHER 197 #define mpi_comm_split_ MPI_COMM_SPLIT 198 #define mpi_scan_ MPI_SCAN 199 #define mpi_send_ MPI_SEND 200 #define mpi_recv_ MPI_RECV 201 #define mpi_reduce_scatter_ MPI_REDUCE_SCATTER 202 #define mpi_irecv_ MPI_IRECV 203 #define mpi_isend_ MPI_ISEND 204 #define mpi_sendrecv_ MPI_SENDRECV 205 #define mpi_test_ MPI_TEST 206 #define mpi_waitall_ MPI_WAITALL 207 #define mpi_waitany_ MPI_WAITANY 208 #define mpi_allgatherv_ MPI_ALLGATHERV 209 #define mpi_alltoallv_ MPI_ALLTOALLV 210 #define mpi_comm_create_ MPI_COMM_CREATE 211 #define mpi_address_ MPI_ADDRESS 212 #define mpi_pack_ MPI_PACK 213 #define mpi_unpack_ MPI_UNPACK 214 #define mpi_pack_size_ MPI_PACK_SIZE 215 #define mpi_type_struct_ MPI_TYPE_STRUCT 216 #define mpi_type_commit_ MPI_TYPE_COMMIT 217 #define mpi_wtime_ MPI_WTIME 218 #define mpi_cancel_ MPI_CANCEL 219 #define mpi_comm_dup_ MPI_COMM_DUP 220 #define mpi_comm_free_ MPI_COMM_FREE 221 #define mpi_get_count_ MPI_GET_COUNT 222 #define mpi_get_processor_name_ MPI_GET_PROCESSOR_NAME 223 #define mpi_initialized_ MPI_INITIALIZED 224 #define mpi_iprobe_ MPI_IPROBE 225 #define mpi_probe_ MPI_PROBE 226 #define mpi_request_free_ MPI_REQUEST_FREE 227 #define mpi_ssend_ MPI_SSEND 228 #define mpi_wait_ MPI_WAIT 229 #define mpi_comm_group_ MPI_COMM_GROUP 230 #define mpi_exscan_ MPI_EXSCAN 231 #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE) 232 #define mpi_init_ mpi_init 233 #define mpi_finalize_ mpi_finalize 234 #define mpi_comm_size_ mpi_comm_size 235 #define mpi_comm_rank_ mpi_comm_rank 236 #define mpi_abort_ mpi_abort 237 #define mpi_reduce_ mpi_reduce 238 #define mpi_allreduce_ mpi_allreduce 239 #define mpi_barrier_ mpi_barrier 240 #define mpi_bcast_ mpi_bcast 241 #define mpi_gather_ mpi_gather 242 #define mpi_allgather_ mpi_allgather 243 #define mpi_comm_split_ mpi_comm_split 244 #define mpi_scan_ mpi_scan 245 #define mpi_send_ mpi_send 246 #define mpi_recv_ mpi_recv 247 #define mpi_reduce_scatter_ mpi_reduce_scatter 248 #define mpi_irecv_ mpi_irecv 249 #define mpi_isend_ mpi_isend 250 #define mpi_sendrecv_ mpi_sendrecv 251 #define mpi_test_ mpi_test 252 #define mpi_waitall_ mpi_waitall 253 #define mpi_waitany_ mpi_waitany 254 #define mpi_allgatherv_ mpi_allgatherv 255 #define mpi_alltoallv_ mpi_alltoallv 256 #define mpi_comm_create_ mpi_comm_create 257 #define mpi_address_ mpi_address 258 #define mpi_pack_ mpi_pack 259 #define mpi_unpack_ mpi_unpack 260 #define mpi_pack_size_ mpi_pack_size 261 #define mpi_type_struct_ mpi_type_struct 262 #define mpi_type_commit_ mpi_type_commit 263 #define mpi_wtime_ mpi_wtime 264 #define mpi_cancel_ mpi_cancel 265 #define mpi_comm_dup_ mpi_comm_dup 266 #define mpi_comm_free_ mpi_comm_free 267 #define mpi_get_count_ mpi_get_count 268 #define mpi_get_processor_name_ mpi_get_processor_name 269 #define mpi_initialized_ mpi_initialized 270 #define mpi_iprobe_ mpi_iprobe 271 #define mpi_probe_ mpi_probe 272 #define mpi_request_free_ mpi_request_free 273 #define mpi_ssend_ mpi_ssend 274 #define mpi_wait_ mpi_wait 275 #define mpi_comm_group_ mpi_comm_group 276 #define mpi_exscan_ mpi_exscan 279 #if defined(PETSC_HAVE_FORTRAN_UNDERSCORE_UNDERSCORE) 280 #define mpi_init_ mpi_init__ 281 #define mpi_finalize_ mpi_finalize__ 282 #define mpi_comm_size_ mpi_comm_size__ 283 #define mpi_comm_rank_ mpi_comm_rank__ 284 #define mpi_abort_ mpi_abort__ 285 #define mpi_reduce_ mpi_reduce__ 286 #define mpi_allreduce_ mpi_allreduce__ 287 #define mpi_barrier_ mpi_barrier__ 288 #define mpi_bcast_ mpi_bcast__ 289 #define mpi_gather_ mpi_gather__ 290 #define mpi_allgather_ mpi_allgather__ 291 #define mpi_comm_split_ mpi_comm_split__ 292 #define mpi_scan_ mpi_scan__ 293 #define mpi_send_ mpi_send__ 294 #define mpi_recv_ mpi_recv__ 295 #define mpi_reduce_scatter_ mpi_reduce_scatter__ 296 #define mpi_irecv_ mpi_irecv__ 297 #define mpi_isend_ mpi_isend__ 298 #define mpi_sendrecv_ mpi_sendrecv__ 299 #define mpi_test_ mpi_test__ 300 #define mpi_waitall_ mpi_waitall__ 301 #define mpi_waitany_ mpi_waitany__ 302 #define mpi_allgatherv_ mpi_allgatherv__ 303 #define mpi_alltoallv_ mpi_alltoallv__ 304 #define mpi_comm_create_ mpi_comm_create__ 305 #define mpi_address_ mpi_address__ 306 #define mpi_pack_ mpi_pack__ 307 #define mpi_unpack_ mpi_unpack__ 308 #define mpi_pack_size_ mpi_pack_size__ 309 #define mpi_type_struct_ mpi_type_struct__ 310 #define mpi_type_commit_ mpi_type_commit__ 311 #define mpi_wtime_ mpi_wtime__ 312 #define mpi_cancel_ mpi_cancel__ 313 #define mpi_comm_dup_ mpi_comm_dup__ 314 #define mpi_comm_free_ mpi_comm_free__ 315 #define mpi_get_count_ mpi_get_count__ 316 #define mpi_get_processor_name_ mpi_get_processor_name__ 317 #define mpi_initialized_ mpi_initialized__ 318 #define mpi_iprobe_ mpi_iprobe__ 319 #define mpi_probe_ mpi_probe__ 320 #define mpi_request_free_ mpi_request_free__ 321 #define mpi_ssend_ mpi_ssend__ 322 #define mpi_wait_ mpi_wait__ 323 #define mpi_comm_group_ mpi_comm_group__ 324 #define mpi_exscan_ mpi_exscan__ 329 #if !defined(MPIUNI_AVOID_MPI_NAMESPACE) 333 *ierr =
MPI_Init((
int*)0, (
char***)0);
388 void PETSC_STDCALL mpi_gather_(
void *sendbuf,
int *scount,
int *sdatatype,
void* recvbuf,
int* rcount,
int* rdatatype,
int *root,
int *comm,
int *ierr)
431 void PETSC_STDCALL mpi_sendrecv_(
void*sendbuf,
int *sendcount,
int *sendtype,
int *dest,
int *sendtag,
void*recvbuf,
int *recvcount,
int *recvtype,
int *source,
int *recvtag,
int *comm,
int *status,
int *ierr)
452 void PETSC_STDCALL mpi_allgatherv_(
void*sendbuf,
int *sendcount,
int *sendtype,
void*recvbuf,
int *recvcounts,
int *displs,
int *recvtype,
int *comm,
int *ierr)
458 void PETSC_STDCALL mpi_alltoallv_(
void*sendbuf,
int *sendcounts,
int *sdispls,
int *sendtype,
void*recvbuf,
int *recvcounts,
int *rdispls,
int *recvtype,
int *comm,
int *ierr)
476 void PETSC_STDCALL mpi_pack_(
void*inbuf,
int *incount,
int *datatype,
void*outbuf,
int *outsize,
int *position,
int *comm,
int *ierr)
528 #if defined(PETSC_HAVE_FORTRAN_MIXED_STR_ARG) 529 #define PETSC_MIXED_LEN(len) ,int len 530 #define PETSC_END_LEN(len) 532 #define PETSC_MIXED_LEN(len) 533 #define PETSC_END_LEN(len) ,int len 586 #if defined(__cplusplus) int MPI_Finalized(int *flag)
static int MPI_was_initialized
int MPI_Comm_free(MPI_Comm *comm)
static int MPI_was_finalized
static MPI_Attr attr[MAX_ATTR]
static int Keyval_setup(void)
#define mpi_reduce_scatter_
MPI_Delete_function * del
int MPI_Comm_size(MPI_Comm comm, int *size)
int MPI_Attr_delete(MPI_Comm comm, int keyval)
int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *out)
int MPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm *newcomm)
int( MPI_Delete_function)(MPI_Comm, int, void *, void *)
int MPI_Keyval_create(MPI_Copy_function *copy_fn, MPI_Delete_function *delete_fn, int *keyval, void *extra_state)
#define PETSC_MIXED_LEN(len)
#define mpi_get_processor_name_
#define mpi_request_free_
int MPI_Attr_get(MPI_Comm comm, int keyval, void *attribute_val, int *flag)
int MPI_Initialized(int *flag)
int MPI_Attr_put(MPI_Comm comm, int keyval, void *attribute_val)
#define PETSC_END_LEN(len)
int MPI_Comm_rank(MPI_Comm comm, int *rank)
int MPIUNI_Memcpy(void *a, const void *b, int n)
int MPI_Abort(MPI_Comm comm, int errorcode)
int( MPI_Copy_function)(MPI_Comm, int, void *, void *, void *, int *)
int MPI_Keyval_free(int *keyval)
int MPI_Init(int *argc, char ***argv)