@@ -82,12 +82,16 @@ extern void *MPIUNI_TMP;
82
82
#define MPI_COMM_WORLD 1
83
83
#define MPI_COMM_SELF MPI_COMM_WORLD
84
84
#define MPI_COMM_NULL 0
85
+ #define MPI_GROUP_EMPTY (-1)
86
+ #define MPI_GROUP_NULL 0
85
87
#define MPI_SUCCESS 0
86
88
#define MPI_IDENT 0
87
89
#define MPI_CONGRUENT 0
88
90
#define MPI_SIMILAR 0
89
91
#define MPI_UNEQUAL 3
90
92
#define MPI_ANY_SOURCE (-2)
93
+ #define MPI_PROC_NULL (-3)
94
+ #define MPI_ROOT (-4)
91
95
#define MPI_KEYVAL_INVALID 0
92
96
#define MPI_ERR_UNKNOWN 18
93
97
#define MPI_ERR_INTERN 21
@@ -109,13 +113,19 @@ typedef int MPI_Info; /* handle */
109
113
110
114
#define MPI_INFO_NULL (0)
111
115
116
+ #define MPI_IN_PLACE (void *)(-1)
117
+ enum CheckForMPIInPlace_Flag {
118
+ CHECK_FOR_MPI_IN_PLACE_NONE ,
119
+ CHECK_FOR_MPI_IN_PLACE_SOURCE ,
120
+ CHECK_FOR_MPI_IN_PLACE_DEST
121
+ };
112
122
113
-
114
- extern int MPIUNI_Memcpy (void * ,const void * ,int );
123
+ extern int MPIUNI_Memcpy (void * ,const void * ,int ,enum CheckForMPIInPlace_Flag );
115
124
116
125
/* In order to handle datatypes, we make them into "sizeof(raw-type)";
117
126
this allows us to do the MPIUNI_Memcpy's easily */
118
127
#define MPI_Datatype int
128
+ #define MPI_DATATYPE_NULL 0
119
129
#define MPI_FLOAT sizeof(float)
120
130
#define MPI_DOUBLE sizeof(double)
121
131
#define MPI_LONG_DOUBLE sizeof(long double)
@@ -140,6 +150,7 @@ extern int MPIUNI_Memcpy(void*,const void*,int);
140
150
#define MPI_2INTEGER (2*sizeof(int))
141
151
#define MPI_UNSIGNED_CHAR sizeof(unsigned char)
142
152
#define MPI_UNSIGNED_LONG sizeof(unsigned long)
153
+ #define MPI_OFFSET sizeof(MPI_Offset)
143
154
#define MPIU_PETSCLOGDOUBLE sizeof(PetscLogDouble)
144
155
#define MPI_REQUEST_NULL ((MPI_Request)0)
145
156
@@ -197,6 +208,14 @@ extern int Petsc_MPI_Initialized(int *);
197
208
extern int Petsc_MPI_Comm_dup (MPI_Comm ,MPI_Comm * );
198
209
extern int Petsc_MPI_Finalize (void );
199
210
extern int Petsc_MPI_Finalized (int * );
211
+ extern int ESMC_MPI_Alltoallw (void * ,int * ,int * ,MPI_Datatype * ,
212
+ void * ,int * ,int * ,MPI_Datatype * ,MPI_Comm );
213
+ extern int ESMC_MPI_Scatterv (void * ,int * ,int * ,MPI_Datatype ,
214
+ void * ,int ,MPI_Datatype ,int ,MPI_Comm );
215
+ extern int ESMC_MPI_Type_create_hvector (int ,int ,MPI_Aint ,MPI_Datatype ,MPI_Datatype * );
216
+ extern int ESMC_MPI_Type_create_indexed_block (int ,int ,const int [],MPI_Datatype ,MPI_Datatype * );
217
+ extern int ESMC_MPI_Type_hvector (int ,int ,MPI_Aint ,MPI_Datatype ,MPI_Datatype * );
218
+ extern int ESMC_MPI_Type_size (MPI_Datatype ,int * );
200
219
extern double ESMC_MPI_Wtime (void );
201
220
202
221
#define MPI_Abort Petsc_MPI_Abort
@@ -210,6 +229,12 @@ extern double ESMC_MPI_Wtime(void);
210
229
#define MPI_Comm_dup Petsc_MPI_Comm_dup
211
230
#define MPI_Finalize Petsc_MPI_Finalize
212
231
#define MPI_Finalized Petsc_MPI_Finalized
232
+ #define MPI_Alltoallw ESMC_MPI_Alltoallw
233
+ #define MPI_Scatterv ESMC_MPI_Scatterv
234
+ #define MPI_Type_create_hvector ESMC_MPI_Type_create_hvector
235
+ #define MPI_Type_create_indexed_block ESMC_MPI_Type_create_indexed_block
236
+ #define MPI_Type_hvector ESMC_MPI_Type_hvector
237
+ #define MPI_Type_size ESMC_MPI_Type_size
213
238
#define MPI_Wtime ESMC_MPI_Wtime
214
239
215
240
/*
@@ -458,13 +483,12 @@ extern double ESMC_MPI_Wtime(void);
458
483
dest ,sendtag ,recvbuf ,recvcount ,\
459
484
recvtype ,source ,recvtag ,\
460
485
comm ,status ) \
461
- MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount) * (sendtype))
486
+ MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount) * (sendtype),CHECK_FOR_MPI_IN_PLACE_NONE )
462
487
#define MPI_Sendrecv_replace (buf ,count , datatype ,dest ,sendtag ,\
463
488
source ,recvtag ,comm ,status ) MPI_SUCCESS
464
489
#define MPI_Type_contiguous (count , oldtype ,newtype ) \
465
490
(*(newtype) = (count)*(oldtype),MPI_SUCCESS)
466
491
#define MPI_Type_vector (count ,blocklength ,stride ,oldtype , newtype ) MPI_SUCCESS
467
- #define MPI_Type_hvector (count ,blocklength ,stride ,oldtype , newtype ) MPI_SUCCESS
468
492
#define MPI_Type_indexed (count ,array_of_blocklengths ,\
469
493
array_of_displacements , oldtype ,\
470
494
newtype ) MPI_SUCCESS
@@ -478,8 +502,6 @@ extern double ESMC_MPI_Wtime(void);
478
502
(*(address) = (long)(char *)(location),MPI_SUCCESS)
479
503
#define MPI_Type_extent (datatype ,extent ) \
480
504
MPI_Abort(MPI_COMM_WORLD,0)
481
- #define MPI_Type_size (datatype ,size ) \
482
- MPI_Abort(MPI_COMM_WORLD,0)
483
505
#define MPI_Type_lb (datatype ,displacement ) \
484
506
MPI_Abort(MPI_COMM_WORLD,0)
485
507
#define MPI_Type_ub (datatype ,displacement ) \
@@ -513,7 +535,7 @@ extern double ESMC_MPI_Wtime(void);
513
535
MPIUNI_TMP = (void*)(long) (root),\
514
536
MPIUNI_TMP = (void*)(long) (recvtype),\
515
537
MPIUNI_TMP = (void*)(long) (comm),\
516
- MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)), \
538
+ MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype),CHECK_FOR_MPI_IN_PLACE_SOURCE), \
517
539
MPI_SUCCESS)
518
540
#define MPI_Gatherv (sendbuf ,sendcount , sendtype ,\
519
541
recvbuf ,recvcounts ,displs ,\
@@ -523,7 +545,7 @@ extern double ESMC_MPI_Wtime(void);
523
545
MPIUNI_TMP = (void*)(long) (recvtype),\
524
546
MPIUNI_TMP = (void*)(long) (root),\
525
547
MPIUNI_TMP = (void*)(long) (comm),\
526
- MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)), \
548
+ MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype),CHECK_FOR_MPI_IN_PLACE_SOURCE), \
527
549
MPI_SUCCESS)
528
550
#define MPI_Scatter (sendbuf ,sendcount , sendtype ,\
529
551
recvbuf ,recvcount , recvtype ,\
@@ -536,32 +558,20 @@ extern double ESMC_MPI_Wtime(void);
536
558
MPIUNI_TMP = (void*)(long) (recvtype),\
537
559
MPIUNI_TMP = (void*)(long) (root),\
538
560
MPIUNI_TMP = (void*)(long) (comm),MPI_Abort(MPI_COMM_WORLD,0))
539
- #define MPI_Scatterv (sendbuf ,sendcounts ,displs ,\
540
- sendtype , recvbuf ,recvcount ,\
541
- recvtype ,root ,comm ) \
542
- (MPIUNI_TMP = (void*)(long) (sendbuf),\
543
- MPIUNI_TMP = (void*)(long) (sendcounts),\
544
- MPIUNI_TMP = (void*)(long) (displs),\
545
- MPIUNI_TMP = (void*)(long) (sendtype),\
546
- MPIUNI_TMP = (void*)(long) (recvbuf),\
547
- MPIUNI_TMP = (void*)(long) (recvcount),\
548
- MPIUNI_TMP = (void*)(long) (recvtype),\
549
- MPIUNI_TMP = (void*)(long) (root),\
550
- MPIUNI_TMP = (void*)(long) (comm),MPI_Abort(MPI_COMM_WORLD,0))
551
561
#define MPI_Allgather (sendbuf ,sendcount , sendtype ,\
552
562
recvbuf ,recvcount , recvtype ,comm ) \
553
563
(MPIUNI_TMP = (void*)(long) (recvcount),\
554
564
MPIUNI_TMP = (void*)(long) (recvtype),\
555
565
MPIUNI_TMP = (void*)(long) (comm),\
556
- MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)), \
566
+ MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype),CHECK_FOR_MPI_IN_PLACE_SOURCE), \
557
567
MPI_SUCCESS)
558
568
#define MPI_Allgatherv (sendbuf ,sendcount , sendtype ,\
559
569
recvbuf ,recvcounts ,displs ,recvtype ,comm ) \
560
570
(MPIUNI_TMP = (void*)(long) (recvcounts),\
561
571
MPIUNI_TMP = (void*)(long) (displs),\
562
572
MPIUNI_TMP = (void*)(long) (recvtype),\
563
573
MPIUNI_TMP = (void*)(long) (comm),\
564
- MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)), \
574
+ MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype),CHECK_FOR_MPI_IN_PLACE_SOURCE), \
565
575
MPI_SUCCESS)
566
576
#define MPI_Alltoall (sendbuf ,sendcount , sendtype ,\
567
577
recvbuf ,recvcount , recvtype ,\
@@ -571,13 +581,13 @@ extern double ESMC_MPI_Wtime(void);
571
581
rdispls , recvtype ,comm ) MPI_Abort(MPI_COMM_WORLD,0)
572
582
#define MPI_Reduce (sendbuf , recvbuf ,count ,\
573
583
datatype ,op ,root ,comm ) \
574
- (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)), \
584
+ (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype),CHECK_FOR_MPI_IN_PLACE_SOURCE), \
575
585
MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
576
586
#define MPI_Allreduce (sendbuf , recvbuf ,count ,datatype ,op ,comm ) \
577
- (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)), \
587
+ (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype),CHECK_FOR_MPI_IN_PLACE_SOURCE), \
578
588
MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
579
589
#define MPI_Scan (sendbuf , recvbuf ,count ,datatype ,op ,comm ) \
580
- (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)), \
590
+ (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype),CHECK_FOR_MPI_IN_PLACE_SOURCE), \
581
591
MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
582
592
#define MPI_Reduce_scatter (sendbuf , recvbuf ,recvcounts ,\
583
593
datatype ,op ,comm ) \
@@ -626,6 +636,15 @@ extern double ESMC_MPI_Wtime(void);
626
636
remote_leader ,tag ,newintercomm ) MPI_SUCCESS
627
637
#define MPI_Intercomm_merge (intercomm ,high ,newintracomm ) MPI_SUCCESS
628
638
639
+ #define MPI_Info_create (info ) \
640
+ (MPIUNI_TMP = (void*)(long) (info),\
641
+ MPI_SUCCESS)
642
+ #define MPI_Info_set (info ,key ,value ) \
643
+ (MPIUNI_TMP = (void*)(long) (info),\
644
+ MPIUNI_TMP = (void*)(long) (key),\
645
+ MPIUNI_TMP = (void*)(long) (value),\
646
+ MPI_SUCCESS)
647
+
629
648
#define MPI_Topo_test (comm ,status ) MPI_SUCCESS
630
649
#define MPI_Cart_create (comm_old ,ndims ,dims ,periods ,\
631
650
reorder ,comm_cart ) MPI_SUCCESS
@@ -649,7 +668,7 @@ extern double ESMC_MPI_Wtime(void);
649
668
#define MPI_Cart_map (comm ,ndims ,dims ,periods ,newrank ) MPI_Abort(MPI_COMM_WORLD,0)
650
669
#define MPI_Graph_map (comm ,a ,b ,c ,d ) MPI_Abort(MPI_COMM_WORLD,0)
651
670
#define MPI_Get_processor_name (name ,result_len ) \
652
- (MPIUNI_Memcpy(name,"localhost",9*sizeof(char)),name[10] = 0,*(result_len) = 10)
671
+ (MPIUNI_Memcpy(name,"localhost",9*sizeof(char),CHECK_FOR_MPI_IN_PLACE_NONE ),name[10] = 0,*(result_len) = 10)
653
672
#define MPI_Errhandler_create (function ,errhandler ) \
654
673
(MPIUNI_TMP = (void*)(long) (errhandler),\
655
674
MPI_SUCCESS)
0 commit comments