Actual source code: mpi.h

petsc-3.6.4 2016-04-12
Report Typos and Errors
  1: /*
  2:    This is a special set of bindings for uni-processor use of MPI by the PETSc library.

  4:    NOT ALL THE MPI CALLS ARE IMPLEMENTED CORRECTLY! Only those needed in PETSc.

  6:    For example,
  7:    * Does not implement send to self.
  8:    * Does not implement attributes correctly.
  9: */

 11: /*
 12:   The following info is a response to one of the petsc-maint questions
 13:   regarding MPIUNI.

 15:   MPIUNI was developed with the aim of getting PETSc compiled, and
 16:   usable in the absence of a full MPI implementation. With this, we
 17:   were able to provide PETSc on Windows, Windows64 even before any MPI
 18:   implementation was available on these platforms. [Or with certain
 19:   compilers - like borland, that do not have a usable MPI
 20:   implementation]

 22:   However - providing a seqential, standards compliant MPI
 23:   implementation is *not* the goal of MPIUNI. The development strategy
 24:   was - to make enough changes to it so that PETSc sources, examples
 25:   compile without errors, and runs in the uni-processor mode. This is
 26:   the reason each function is not documented.

 28:   PETSc usage of MPIUNI is primarily from C. However a minimal fortran
 29:   interface is also provided - to get PETSc fortran examples with a
 30:   few MPI calls working.

 32:   One of the optimzation with MPIUNI, is to avoid the function call
 33:   overhead, when possible. Hence most of the C functions are
 34:   implemented as macros. However the function calls cannot be avoided
 35:   with fortran usage.

 37:   Most PETSc objects have both sequential and parallel
 38:   implementations, which are separate. For eg: We have two types of
 39:   sparse matrix storage formats - SeqAIJ, and MPIAIJ. Some MPI
 40:   routines are used in the Seq part, but most of them are used in the
 41:   MPI part. The send/receive calls can be found mostly in the MPI
 42:   part.

 44:   When MPIUNI is used, only the Seq version of the PETSc objects are
 45:   used, even though the MPI variant of the objects are compiled. Since
 46:   there are no send/receive calls in the Seq variant, PETSc works fine
 47:   with MPIUNI in seq mode.

 49:   The reason some send/receive functions are defined to abort(), is to
 50:   detect sections of code that use send/receive functions, and gets
 51:   executed in the sequential mode. (which shouldn't happen in case of
 52:   PETSc).

 54:   Proper implementation of send/receive would involve writing a
 55:   function for each of them. Inside each of these functions, we have
 56:   to check if the send is to self or receive is from self, and then
 57:   doing the buffering accordingly (until the receive is called) - or
 58:   what if a nonblocking receive is called, do a copy etc.. Handling
 59:   the buffering aspects might be complicated enough, that in this
 60:   case, a proper implementation of MPI might as well be used. This is
 61:   the reason the send to self is not implemented in MPIUNI, and never
 62:   will be.

 64:   Proper implementations of MPI [for eg: MPICH & OpenMPI] are
 65:   available for most machines. When these packages are available, Its
 66:   generally preferable to use one of them instead of MPIUNI - even if
 67:   the user is using PETSc sequentially.

 69:     - MPIUNI does not support all MPI functions [or functionality].
 70:     Hence it might not work with external packages or user code that
 71:     might have MPI calls in it.

 73:     - MPIUNI is not a standards compliant implementation for np=1.
 74:     For eg: if the user code has send/recv to self, then it will
 75:     abort. [Similar issues with a number of other MPI functionality]
 76:     However MPICH & OpenMPI are the correct implementations of MPI
 77:     standard for np=1.

 79:     - When user code uses multiple MPI based packages that have their
 80:     own *internal* stubs equivalent to MPIUNI - in sequential mode,
 81:     invariably these multiple implementations of MPI for np=1 conflict
 82:     with each other. The correct thing to do is: make all such
 83:     packages use the *same* MPI implementation for np=1. MPICH/OpenMPI
 84:     satisfy this requirement correctly [and hence the correct choice].

 86:     - Using MPICH/OpenMPI sequentially should have minimal
 87:     disadvantages. [for eg: these binaries can be run without
 88:     mpirun/mpiexec as ./executable, without requiring any extra
 89:     configurations for ssh/rsh/daemons etc..]. This should not be a
 90:     reason to avoid these packages for sequential use.

 92:     Instructions for building standalone MPIUNI [for eg: linux/gcc+gfortran]:
 93:     - extract include/mpiuni/mpi.h,mpif.f, src/sys/mpiuni/mpi.c from PETSc
 94:     - remove reference to petscconf.h from mpi.h
 95:     - gcc -c mpi.c -DPETSC_HAVE_STDLIB_H -DPETSC_HAVE_FORTRAN_UNDERSCORE
 96:     - ar cr libmpiuni.a mpi.o

 98: */


103: /* Requred by abort() in mpi.c & for win64 */
104: #include <petscconf.h>

106: /*  This is reproduced from petscsys.h so that mpi.h can be used standalone without first including petscsys.h */
107: #if defined(_WIN32) && defined(PETSC_USE_SHARED_LIBRARIES)
108: #  define MPIUni_ __declspec(dllexport)
109: #  define MPIUni_PETSC_DLLIMPORT __declspec(dllimport)
110: #elif defined(PETSC_USE_VISIBILITY)
111: #  define MPIUni_ __attribute__((visibility ("default")))
112: #  define MPIUni_PETSC_DLLIMPORT __attribute__((visibility ("default")))
113: #else
114: #  define MPIUni_
115: #  define MPIUni_PETSC_DLLIMPORT
116: #endif

118: #if defined(petsc_EXPORTS)
119: #  define MPIUni_PETSC_VISIBILITY_PUBLIC MPIUni_
120: #else  /* Win32 users need this to import symbols from petsc.dll */
121: #  define MPIUni_PETSC_VISIBILITY_PUBLIC MPIUni_PETSC_DLLIMPORT
122: #endif

124: #if defined(__cplusplus)
125: #define MPIUni_PETSC_EXTERN extern "C" MPIUni_PETSC_VISIBILITY_PUBLIC
126: #else
127: #define MPIUni_PETSC_EXTERN extern MPIUni_PETSC_VISIBILITY_PUBLIC
128: #endif

130: #if defined(__cplusplus)
131: extern "C" {
132: #endif

134: /* require an int variable large enough to hold a pointer */
135: #if (PETSC_SIZEOF_LONG == PETSC_SIZEOF_VOID_P)
136: typedef long MPIUNI_INTPTR;
137: #elif (PETSC_SIZEOF_SIZE_T == PETSC_SIZEOF_VOID_P)
138: typedef size_t MPIUNI_INTPTR;
139: #else
140: typedef unknownuniptr MPIUNI_INTPTR;
141: #endif

143: /* old 32bit MS compiler does not support long long */
144: #if defined(PETSC_SIZEOF_LONG_LONG)
145: typedef long long MPIUNI_INT64;
146: typedef unsigned long long MPIUNI_UINT64;
147: #elif defined(PETSC_HAVE___INT64)
148: typedef _int64 MPIUNI_INT64;
149: typedef unsigned _int64 MPIUNI_UINT64;
150: #else
151: #error "cannot determine MPIUNI_INT64, MPIUNI_UINT64 types"
152: #endif

154: /*

156:     MPIUNI_TMP is used in the macros below only to stop various C/C++ compilers
157: from generating warning messages about unused variables while compiling PETSc.
158: */
159: MPIUni_PETSC_EXTERN void *MPIUNI_TMP;

161: #define MPI_COMM_SELF        1
162: #define MPI_COMM_WORLD       2
163: #define MPI_COMM_NULL        0
164: #define MPI_SUCCESS          0
165: #define MPI_IDENT            0
166: #define MPI_CONGRUENT        1
167: #define MPI_SIMILAR          2
168: #define MPI_UNEQUAL          3
169: #define MPI_ANY_SOURCE     (-2)
170: #define MPI_KEYVAL_INVALID   0
171: #define MPI_ERR_UNKNOWN     18
172: #define MPI_ERR_INTERN      21
173: #define MPI_ERR_OTHER        1
174: #define MPI_TAG_UB           0
175: #define MPI_ERRORS_RETURN    0
176: #define MPI_UNDEFINED      (-32766)
177: #define MPI_ERRORS_ARE_FATAL (-32765)
178: #define MPI_MAXLOC           5
179: #define MPI_MINLOC           6


182: /* External types */
183: typedef int    MPI_Comm;
184: typedef void   *MPI_Request;
185: typedef void   *MPI_Group;
186: typedef struct {int MPI_TAG,MPI_SOURCE,MPI_ERROR;} MPI_Status;
187: typedef char   *MPI_Errhandler;
188: typedef int    MPI_Fint;
189: typedef int    MPI_File;
190: typedef int    MPI_Info;
191: typedef int    MPI_Offset;

193: /* In order to handle datatypes, we make them into "sizeof(raw-type)";
194:     this allows us to do the MPIUNI_Memcpy's easily */
195: #define MPI_Datatype         int
196: #define MPI_FLOAT            (1 << 16 | sizeof(float))
197: #define MPI_DOUBLE           (1 << 16 | sizeof(double))
198: #define MPI_LONG_DOUBLE      (1 << 16 | sizeof(long double))

200: #define MPI_COMPLEX          (2 << 16 | 2*sizeof(float))
201: #define MPI_C_COMPLEX        (2 << 16 | 2*sizeof(float))
202: #define MPI_C_DOUBLE_COMPLEX (2 << 16 | 2*sizeof(double))

204: #define MPI_CHAR             (3 << 16 | sizeof(char))
205: #define MPI_BYTE             (3 << 16 | sizeof(char))
206: #define MPI_UNSIGNED_CHAR    (3 << 16 | sizeof(unsigned char))

208: #define MPI_INT              (4 << 16 | sizeof(int))
209: #define MPI_LONG             (4 << 16 | sizeof(long))
210: #define MPI_LONG_LONG_INT    (4 << 16 | sizeof(MPIUNI_INT64))
211: #define MPI_SHORT            (4 << 16 | sizeof(short))

213: #define MPI_UNSIGNED_SHORT   (5 << 16 | sizeof(unsigned short))
214: #define MPI_UNSIGNED         (5 << 16 | sizeof(unsigned))
215: #define MPI_UNSIGNED_LONG    (5 << 16 | sizeof(unsigned long))
216: #define MPI_UNSIGNED_LONG_LONG (5 << 16 | sizeof(MPIUNI_UINT64))

218: #define MPI_FLOAT_INT        (10 << 16 | (sizeof(float) + sizeof(int)))
219: #define MPI_DOUBLE_INT       (11 << 16 | (sizeof(double) + sizeof(int)))
220: #define MPI_LONG_INT         (12 << 16 | (sizeof(long) + sizeof(int)))
221: #define MPI_SHORT_INT        (13 << 16 | (sizeof(short) + sizeof(int)))
222: #define MPI_2INT             (14 << 16 | (2* sizeof(int)))

224: #if defined(PETSC_USE_REAL___FLOAT128)
225: extern MPI_Datatype MPIU___FLOAT128;
226: #define MPI_sizeof(datatype) ((datatype == MPIU___FLOAT128) ? 2*sizeof(double) : (datatype) & 0xff)
227: #else
228: #define MPI_sizeof(datatype) ((datatype) & 0xff)
229: #endif
230: MPIUni_PETSC_EXTERN int MPIUNI_Memcpy(void*,const void*,int);

232: #define MPI_MAX_PROCESSOR_NAME 1024

234: #define MPI_REQUEST_NULL     ((MPI_Request)0)
235: #define MPI_GROUP_NULL       ((MPI_Group)0)
236: #define MPI_INFO_NULL        ((MPI_Info)0)
237: #define MPI_BOTTOM           (void *)0
238: typedef int MPI_Op;

240: #define MPI_MODE_RDONLY   0
241: #define MPI_MODE_WRONLY   0
242: #define MPI_MODE_CREATE   0

244: #define MPI_SUM           1
245: #define MPI_MAX           2
246: #define MPI_MIN           3
247: #define MPI_REPLACE       4
248: #define MPI_PROD          5
249: #define MPI_LAND          6
250: #define MPI_BAND          7
251: #define MPI_LOR           8
252: #define MPI_BOR           9
253: #define MPI_LXOR          10
254: #define MPI_BXOR          11
255: #define MPI_ANY_TAG     (-1)
256: #define MPI_DATATYPE_NULL 0
257: #define MPI_PACKED        0
258: #define MPI_MAX_ERROR_STRING 2056
259: #define MPI_STATUS_IGNORE (MPI_Status *)1
260: #define MPI_STATUSES_IGNORE (MPI_Status *)1
261: #define MPI_ORDER_FORTRAN        57
262: #define MPI_IN_PLACE      (void *) -1

264: /*
265:   Prototypes of some functions which are implemented in mpi.c
266: */
267: typedef int   (MPI_Copy_function)(MPI_Comm,int,void *,void *,void *,int *);
268: typedef int   (MPI_Delete_function)(MPI_Comm,int,void *,void *);
269: typedef void  (MPI_User_function)(void*, void *, int *, MPI_Datatype *);

271: /*
272:   To enable linking PETSc+MPIUNI with any other package that might have its
273:   own MPIUNI (equivalent implementation) we need to avoid using 'MPI'
274:   namespace for MPIUNI functions that go into the petsc library.

276:   For C functions below (that get compiled into petsc library) - we map
277:   the 'MPI' functions to use 'Petsc_MPI' namespace.

279:   However we cannot do such maping for fortran MPIUNI functions. One
280:   can use the configure option --with-mpiuni-fortran-binding=0 to
281:   prevent compiling MPIUNI fortran interface.
282: */
283: #define MPI_Abort         Petsc_MPI_Abort
284: #define MPI_Attr_get      Petsc_MPI_Attr_get
285: #define MPI_Keyval_free   Petsc_MPI_Keyval_free
286: #define MPI_Attr_put      Petsc_MPI_Attr_put
287: #define MPI_Attr_delete   Petsc_MPI_Attr_delete
288: #define MPI_Keyval_create Petsc_MPI_Keyval_create
289: #define MPI_Comm_free     Petsc_MPI_Comm_free
290: #define MPI_Comm_dup      Petsc_MPI_Comm_dup
291: #define MPI_Comm_create   Petsc_MPI_Comm_create
292: #define MPI_Init          Petsc_MPI_Init
293: #define MPI_Finalize      Petsc_MPI_Finalize
294: #define MPI_Initialized   Petsc_MPI_Initialized
295: #define MPI_Finalized     Petsc_MPI_Finalized
296: #define MPI_Comm_size     Petsc_MPI_Comm_size
297: #define MPI_Comm_rank     Petsc_MPI_Comm_rank
298: #define MPI_Wtime         Petsc_MPI_Wtime

300: /* identical C bindings */
301: #define MPI_Comm_create_keyval Petsc_MPI_Keyval_create
302: #define MPI_Comm_free_keyval   Petsc_MPI_Keyval_free
303: #define MPI_Comm_get_attr      Petsc_MPI_Attr_get
304: #define MPI_Comm_set_attr      Petsc_MPI_Attr_put

306: MPIUni_PETSC_EXTERN int    MPI_Abort(MPI_Comm,int);
307: MPIUni_PETSC_EXTERN int    MPI_Attr_get(MPI_Comm comm,int keyval,void *attribute_val,int *flag);
308: MPIUni_PETSC_EXTERN int    MPI_Keyval_free(int*);
309: MPIUni_PETSC_EXTERN int    MPI_Attr_put(MPI_Comm,int,void *);
310: MPIUni_PETSC_EXTERN int    MPI_Attr_delete(MPI_Comm,int);
311: MPIUni_PETSC_EXTERN int    MPI_Keyval_create(MPI_Copy_function *,MPI_Delete_function *,int *,void *);
312: MPIUni_PETSC_EXTERN int    MPI_Comm_free(MPI_Comm*);
313: MPIUni_PETSC_EXTERN int    MPI_Comm_dup(MPI_Comm,MPI_Comm *);
314: MPIUni_PETSC_EXTERN int    MPI_Comm_create(MPI_Comm,MPI_Group,MPI_Comm *);
315: MPIUni_PETSC_EXTERN int    MPI_Init(int *, char ***);
316: MPIUni_PETSC_EXTERN int    MPI_Finalize(void);
317: MPIUni_PETSC_EXTERN int    MPI_Initialized(int*);
318: MPIUni_PETSC_EXTERN int    MPI_Finalized(int*);
319: MPIUni_PETSC_EXTERN int    MPI_Comm_size(MPI_Comm,int*);
320: MPIUni_PETSC_EXTERN int    MPI_Comm_rank(MPI_Comm,int*);
321: MPIUni_PETSC_EXTERN double MPI_Wtime(void);

323: #define MPI_Aint MPIUNI_INTPTR
324: /*
325:     Routines we have replace with macros that do nothing
326:     Some return error codes others return success
327: */

329: #define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
330: #define MPI_Comm_c2f(comm) (MPI_Fint)(comm)
331: #define MPI_Type_f2c(type) (MPI_Datatype)(type)
332: #define MPI_Type_c2f(type) (MPI_Fint)(type)
333: #define MPI_Op_c2f(op) (MPI_Fint)(op)

335: #define MPI_Send(buf,count,datatype,dest,tag,comm)  \
336:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
337:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
338:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
339:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
340:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
341:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
342:       MPI_Abort(MPI_COMM_WORLD,0))
343: #define MPI_Recv(buf,count,datatype,source,tag,comm,status) \
344:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
345:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
346:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
347:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (source),\
348:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
349:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
350:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (status),\
351:       MPI_Abort(MPI_COMM_WORLD,0))
352: #define MPI_Get_count(status, datatype,count) \
353:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (status),\
354:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
355:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
356:       MPI_Abort(MPI_COMM_WORLD,0))
357: #define MPI_Bsend(buf,count,datatype,dest,tag,comm)  \
358:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
359:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
360:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
361:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
362:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
363:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
364:       MPI_Abort(MPI_COMM_WORLD,0))
365: #define MPI_Ssend(buf,count, datatype,dest,tag,comm) \
366:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
367:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
368:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
369:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
370:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
371:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
372:       MPI_Abort(MPI_COMM_WORLD,0))
373: #define MPI_Rsend(buf,count, datatype,dest,tag,comm) \
374:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
375:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
376:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
377:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
378:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
379:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
380:       MPI_Abort(MPI_COMM_WORLD,0))
381: #define MPI_Buffer_attach(buffer,size) \
382:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buffer),\
383:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (size),\
384:       MPI_SUCCESS)
385: #define MPI_Buffer_detach(buffer,size)\
386:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buffer),\
387:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (size),\
388:       MPI_SUCCESS)
389: #define MPI_Ibsend(buf,count, datatype,dest,tag,comm,request) \
390:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
391:        MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
392:        MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
393:        MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
394:        MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
395:        MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
396:        MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
397:        MPI_Abort(MPI_COMM_WORLD,0))
398: #define MPI_Issend(buf,count, datatype,dest,tag,comm,request) \
399:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
400:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
401:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
402:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
403:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
404:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
405:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
406:       MPI_Abort(MPI_COMM_WORLD,0))
407: #define MPI_Irsend(buf,count, datatype,dest,tag,comm,request) \
408:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
409:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
410:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
411:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
412:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
413:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
414:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
415:       MPI_Abort(MPI_COMM_WORLD,0))
416: #define MPI_Irecv(buf,count, datatype,source,tag,comm,request) \
417:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
418:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
419:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
420:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (source),\
421:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
422:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
423:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
424:       MPI_Abort(MPI_COMM_WORLD,0))
425: #define MPI_Isend(buf,count, datatype,dest,tag,comm,request) \
426:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
427:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
428:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
429:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
430:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
431:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
432:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
433:       MPI_Abort(MPI_COMM_WORLD,0))
434: #define MPI_Wait(request,status) \
435:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
436:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (status),\
437:       MPI_SUCCESS)
438: #define MPI_Test(request,flag,status) \
439:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
440:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (status),\
441:       *(flag) = 0, \
442:       MPI_SUCCESS)
443: #define MPI_Request_free(request) \
444:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
445:       MPI_SUCCESS)
446: #define MPI_Waitany(a,b,c,d) \
447:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (a),\
448:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (b),\
449:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (c),\
450:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (d),(*c = 0), \
451:       MPI_SUCCESS)
452: #define MPI_Testany(a,b,c,d,e) \
453:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (a),\
454:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (b),\
455:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (c),\
456:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (d),\
457:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (e),\
458:       MPI_SUCCESS)
459: #define MPI_Waitall(count,array_of_requests,array_of_statuses) \
460:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
461:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_requests),\
462:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_statuses),\
463:       MPI_SUCCESS)
464: #define MPI_Testall(count,array_of_requests,flag,array_of_statuses) \
465:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
466:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_requests),\
467:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (flag),\
468:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_statuses),\
469:       MPI_SUCCESS)
470: #define MPI_Waitsome(incount,array_of_requests,outcount,\
471:                      array_of_indices,array_of_statuses) \
472:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (incount),\
473:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_requests),\
474:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (outcount),\
475:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_indices),\
476:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_statuses),\
477:       MPI_SUCCESS)
478: #define MPI_Comm_group(comm,group) \
479:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
480:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (group),\
481:       MPI_SUCCESS)
482: #define MPI_Group_incl(group,n,ranks,newgroup) \
483:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (group),\
484:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (n),\
485:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (ranks),\
486:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (newgroup),\
487:       MPI_SUCCESS)
488: #define MPI_Testsome(incount,array_of_requests,outcount,\
489:                      array_of_indices,array_of_statuses) MPI_SUCCESS
490: #define MPI_Iprobe(source,tag,comm,flag,status) (*(flag)=0, MPI_SUCCESS)
491: #define MPI_Probe(source,tag,comm,status) MPI_SUCCESS
492: #define MPI_Cancel(request) (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),MPI_SUCCESS)
493: #define MPI_Test_cancelled(status,flag) (*(flag)=0,MPI_SUCCESS)
494: #define MPI_Send_init(buf,count, datatype,dest,tag,comm,request) \
495:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
496:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
497:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
498:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
499:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
500:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
501:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
502:      MPI_SUCCESS)
503: #define MPI_Bsend_init(buf,count, datatype,dest,tag,comm,request) \
504:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
505:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
506:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
507:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
508:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
509:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
510:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
511:      MPI_SUCCESS)
512: #define MPI_Ssend_init(buf,count, datatype,dest,tag,comm,request) \
513:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
514:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
515:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
516:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
517:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
518:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
519:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
520:      MPI_SUCCESS)
521: #define MPI_Bsend_init(buf,count, datatype,dest,tag,comm,request) \
522:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
523:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
524:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
525:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
526:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
527:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
528:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
529:      MPI_SUCCESS)
530: #define MPI_Rsend_init(buf,count, datatype,dest,tag,comm,request) \
531:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
532:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
533:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
534:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (dest),\
535:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
536:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
537:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
538:      MPI_SUCCESS)
539: #define MPI_Recv_init(buf,count, datatype,source,tag,comm,request) \
540:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf),\
541:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
542:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
543:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (source),\
544:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (tag),\
545:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
546:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),\
547:      MPI_SUCCESS)
548: #define MPI_Start(request) (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (request),MPI_SUCCESS)
549: #define MPI_Startall(count,array_of_requests) \
550:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
551:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_requests),\
552:      MPI_SUCCESS)
553: #define MPI_Op_create(function,commute,op) \
554:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (function),\
555:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (commute),\
556:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (op),\
557:      MPI_SUCCESS)
558: #define MPI_Op_free(op) \
559:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (op),\
560:      MPI_SUCCESS)
561:      /* Need to determine sizeof "sendtype" */
562: #define MPI_Sendrecv(sendbuf,sendcount, sendtype,\
563:      dest,sendtag,recvbuf,recvcount,\
564:      recvtype,source,recvtag,\
565:      comm,status) \
566:   MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount) * MPI_sizeof(sendtype))
567: #define MPI_Sendrecv_replace(buf,count, datatype,dest,sendtag,\
568:      source,recvtag,comm,status) MPI_SUCCESS
569: #define MPI_Type_contiguous(count, oldtype,newtype) \
570:      (*(newtype) = (count)*(oldtype),MPI_SUCCESS)
571: #define MPI_Type_vector(count,blocklength,stride,oldtype, newtype) MPI_SUCCESS
572: #define MPI_Type_hvector(count,blocklength,stride,oldtype, newtype) MPI_SUCCESS
573: #define MPI_Type_indexed(count,array_of_blocklengths,\
574:      array_of_displacements, oldtype,\
575:      newtype) MPI_SUCCESS
576: #define MPI_Type_hindexed(count,array_of_blocklengths,\
577:      array_of_displacements, oldtype,\
578:      newtype) MPI_SUCCESS
579: #define MPI_Type_struct(count,array_of_blocklengths,\
580:      array_of_displacements,\
581:      array_of_types, newtype) \
582:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
583:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_blocklengths),\
584:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_displacements),\
585:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_types),\
586:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (newtype),\
587:       MPI_SUCCESS)
588: #define MPI_Address(location,address) \
589:      (*(address) = (MPIUNI_INTPTR)(char *)(location),MPI_SUCCESS)
590: #define MPI_Type_extent(datatype,extent) *(extent) = datatype
591: #define MPI_Type_size(datatype,size) (*(size) = (datatype) & 0xff, MPI_SUCCESS)
592: #define MPI_Type_lb(datatype,displacement) \
593:      MPI_Abort(MPI_COMM_WORLD,0)
594: #define MPI_Type_ub(datatype,displacement) \
595:      MPI_Abort(MPI_COMM_WORLD,0)
596: #define MPI_Type_commit(datatype) (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
597:      MPI_SUCCESS)
598: #define MPI_Type_free(datatype) MPI_SUCCESS
599: #define MPI_Get_elements(status, datatype,count) \
600:      MPI_Abort(MPI_COMM_WORLD,0)
601: #define MPI_Pack(inbuf,incount, datatype,outbuf,\
602:      outsize,position, comm) \
603:      MPI_Abort(MPI_COMM_WORLD,0)
604: #define MPI_Unpack(inbuf,insize,position,outbuf,\
605:      outcount, datatype,comm) \
606:      MPI_Abort(MPI_COMM_WORLD,0)
607: #define MPI_Pack_size(incount, datatype,comm,size) \
608:      MPI_Abort(MPI_COMM_WORLD,0)
609: #define MPI_Barrier(comm) \
610:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
611:      MPI_SUCCESS)
612: #define MPI_Bcast(buffer,count,datatype,root,comm) \
613:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buffer),\
614:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count),\
615:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),\
616:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (root),\
617:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
618:      MPI_SUCCESS)
619: #define MPI_Gather(sendbuf,sendcount, sendtype,\
620:      recvbuf,recvcount, recvtype,\
621:      root,comm) \
622:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvcount),\
623:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (root),\
624:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvtype),\
625:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
626:      MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)*MPI_sizeof(sendtype)),\
627:      MPI_SUCCESS)
628: #define MPI_Gatherv(sendbuf,sendcount, sendtype,\
629:      recvbuf,recvcounts,displs,\
630:      recvtype,root,comm) \
631:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvcounts),\
632:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (displs),\
633:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvtype),\
634:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (root),\
635:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
636:      MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)*MPI_sizeof(sendtype)),\
637:      MPI_SUCCESS)
638: #define MPI_Scatter(sendbuf,sendcount, sendtype,\
639:      recvbuf,recvcount, recvtype,\
640:      root,comm) \
641:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (sendbuf),\
642:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (sendcount),\
643:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (sendtype),\
644:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvbuf),\
645:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvcount),\
646:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvtype),\
647:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (root),\
648:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),MPI_Abort(MPI_COMM_WORLD,0))
649: #define MPI_Scatterv(sendbuf,sendcounts,displs,\
650:      sendtype, recvbuf,recvcount,\
651:      recvtype,root,comm) \
652:      (MPIUNI_Memcpy(recvbuf,sendbuf,(recvcount)*MPI_sizeof(recvtype)),\
653:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (displs),\
654:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (sendtype),\
655:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (sendcounts),\
656:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (root),\
657:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
658:      MPI_SUCCESS)
659: #define MPI_Allgather(sendbuf,sendcount, sendtype,\
660:      recvbuf,recvcount, recvtype,comm) \
661:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvcount),\
662:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvtype),\
663:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
664:      MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)*MPI_sizeof(sendtype)),\
665:      MPI_SUCCESS)
666: #define MPI_Allgatherv(sendbuf,sendcount, sendtype,\
667:      recvbuf,recvcounts,displs,recvtype,comm) \
668:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvcounts),\
669:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (displs),\
670:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvtype),\
671:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
672:      MPIUNI_Memcpy((recvbuf),(sendbuf),(sendcount)*MPI_sizeof(sendtype)), \
673:      MPI_SUCCESS)
674: #define MPI_Alltoall(sendbuf,sendcount, sendtype,\
675:      recvbuf,recvcount, recvtype,comm) \
676:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvcount),\
677:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (recvtype),\
678:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
679:       MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)*MPI_sizeof(sendtype)),\
680:       MPI_SUCCESS)
681: #define MPI_Alltoallv(sendbuf,sendcounts,sdispls,\
682:      sendtype, recvbuf,recvcounts,\
683:      rdispls, recvtype,comm) MPI_Abort(MPI_COMM_WORLD,0)
684: #define MPI_Alltoallw(sendbuf,sendcounts,sdispls,\
685:      sendtypes, recvbuf,recvcounts,\
686:      rdispls, recvtypes,comm) MPI_Abort(MPI_COMM_WORLD,0)
687: #define MPI_Reduce(sendbuf, recvbuf,count,\
688:      datatype,op,root,comm) \
689:      (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*MPI_sizeof(datatype)),\
690:       MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),MPI_SUCCESS)
691: #define MPI_Allreduce(sendbuf, recvbuf,count,datatype,op,comm) \
692:     (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*MPI_sizeof(datatype)), \
693:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),MPI_SUCCESS)
694: #define MPI_Scan(sendbuf, recvbuf,count,datatype,op,comm) \
695:      (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*MPI_sizeof(datatype)),\
696:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),MPI_SUCCESS)
697: #define MPI_Exscan(sendbuf, recvbuf,count,datatype,op,comm) MPI_SUCCESS
698: #define MPI_Reduce_scatter(sendbuf, recvbuf,recvcounts,\
699:      datatype,op,comm) \
700:      MPI_Abort(MPI_COMM_WORLD,0)
701: #define MPI_Group_size(group,size) (*(size)=1,MPI_SUCCESS)
702: #define MPI_Group_rank(group,rank) (*(rank)=0,MPI_SUCCESS)
703: #define MPI_Group_translate_ranks(group1,n,ranks1,group2,ranks2) \
704:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (group1),                 \
705:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (group2),                 \
706:    MPIUNI_Memcpy((ranks2),(ranks1),(n) * sizeof(int)),           \
707:    MPI_SUCCESS)
708: #define MPI_Group_compare(group1,group2,result) \
709:      (*(result)=1,MPI_SUCCESS)
710: #define MPI_Group_union(group1,group2,newgroup) MPI_SUCCESS
711: #define MPI_Group_intersection(group1,group2,newgroup) MPI_SUCCESS
712: #define MPI_Group_difference(group1,group2,newgroup) MPI_SUCCESS
713: #define MPI_Group_excl(group,n,ranks,newgroup) MPI_SUCCESS
714: #define MPI_Group_range_incl(group,n,ranges,newgroup) MPI_SUCCESS
715: #define MPI_Group_range_excl(group,n,ranges,newgroup) MPI_SUCCESS
716: #define MPI_Group_free(group) \
717:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (group),\
718:      MPI_SUCCESS)
719: #define MPI_Comm_compare(comm1,comm2,result) \
720:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm1),\
721:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm2),\
722:      *(result)=MPI_IDENT,\
723:      MPI_SUCCESS)
724: #define MPI_Comm_split(comm,color,key,newcomm) \
725:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (color),\
726:   MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (key),\
727:    MPI_Comm_dup(comm,newcomm))
728: #define MPI_Comm_test_inter(comm,flag) (*(flag)=1,MPI_SUCCESS)
729: #define MPI_Comm_remote_size(comm,size) (*(size)=1,MPI_SUCCESS)
730: #define MPI_Comm_remote_group(comm,group) MPI_SUCCESS
731: #define MPI_Intercomm_create(local_comm,local_leader,peer_comm,\
732:      remote_leader,tag,newintercomm) MPI_SUCCESS
733: #define MPI_Intercomm_merge(intercomm,high,newintracomm) MPI_SUCCESS

735: #define MPI_Topo_test(comm,status) MPI_SUCCESS
736: #define MPI_Cart_create(comm_old,ndims,dims,periods,\
737:      reorder,comm_cart) MPI_SUCCESS
738: #define MPI_Dims_create(nnodes,ndims,dims) MPI_Abort(MPI_COMM_WORLD,0)
739: #define MPI_Graph_create(comm,a,b,c,d,e) MPI_SUCCESS
740: #define MPI_Graphdims_Get(comm,nnodes,nedges) MPI_Abort(MPI_COMM_WORLD,0)
741: #define MPI_Graph_get(comm,a,b,c,d) MPI_Abort(MPI_COMM_WORLD,0)
742: #define MPI_Cartdim_get(comm,ndims) MPI_Abort(MPI_COMM_WORLD,0)
743: #define MPI_Cart_get(comm,maxdims,dims,periods,coords) \
744:      MPI_Abort(MPI_COMM_WORLD,0)
745: #define MPI_Cart_rank(comm,coords,rank) MPI_Abort(MPI_COMM_WORLD,0)
746: #define MPI_Cart_coords(comm,rank,maxdims,coords) \
747:      MPI_Abort(MPI_COMM_WORLD,0)
748: #define MPI_Graph_neighbors_count(comm,rank,nneighbors) \
749:      MPI_Abort(MPI_COMM_WORLD,0)
750: #define MPI_Graph_neighbors(comm,rank,maxneighbors,neighbors) \
751:      MPI_Abort(MPI_COMM_WORLD,0)
752: #define MPI_Cart_shift(comm,direction,disp,rank_source,rank_dest) \
753:      MPI_Abort(MPI_COMM_WORLD,0)
754: #define MPI_Cart_sub(comm,remain_dims,newcomm) MPI_Abort(MPI_COMM_WORLD,0)
755: #define MPI_Cart_map(comm,ndims,dims,periods,newrank) MPI_Abort(MPI_COMM_WORLD,0)
756: #define MPI_Graph_map(comm,a,b,c,d) MPI_Abort(MPI_COMM_WORLD,0)
757: #define MPI_Get_processor_name(name,result_len) \
758:      (MPIUNI_Memcpy(name,"localhost",9*sizeof(char)),name[10] = 0,*(result_len) = 10)
759: #define MPI_Errhandler_create(function,errhandler) (*(errhandler) = (MPI_Errhandler) 0, MPI_SUCCESS)
760: #define MPI_Errhandler_set(comm,errhandler) \
761:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
762:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (errhandler),\
763:      MPI_SUCCESS)
764: #define MPI_Errhandler_get(comm,errhandler) MPI_SUCCESS
765: #define MPI_Errhandler_free(errhandler) MPI_SUCCESS
766: #define MPI_Error_string(errorcode,string,result_len) MPI_SUCCESS
767: #define MPI_Error_class(errorcode,errorclass) MPI_SUCCESS
768: #define MPI_Wtick() 1.0
769: #define MPI_Pcontrol(level) MPI_SUCCESS

771: #define MPI_NULL_COPY_FN   0
772: #define MPI_NULL_DELETE_FN 0

774:   /* MPI-IO additions */

776: #define MPI_File_open(comm,filename,amode,info,mpi_fh) \
777:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),  \
778:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (filename), \
779:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (amode), \
780:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (info), \
781:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh), \
782:    MPI_Abort(MPI_COMM_WORLD,0))

784: #define MPI_File_close(mpi_fh) \
785:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh),  \
786:    MPI_Abort(MPI_COMM_WORLD,0))

788: #define MPI_File_set_view(mpi_fh,disp,etype,filetype,datarep,info) \
789:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh),  \
790:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (disp), \
791:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (etype), \
792:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (filetype), \
793:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datarep), \
794:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (info), \
795:    MPI_Abort(MPI_COMM_WORLD,0))

797: #define MPI_Type_get_extent(datatype,lb,extent) \
798:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),      \
799:    *(lb) = 0, *(extent) = datatype,0)

801: #define MPI_File_write_all(mpi_fh,buf,count,datatype,status) \
802:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh),             \
803:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf), \
804:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count), \
805:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype), \
806:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (status), \
807:    MPI_Abort(MPI_COMM_WORLD,0))

809: #define MPI_File_read_all(mpi_fh,buf,count,datatype,status) \
810:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh),            \
811:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf), \
812:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count), \
813:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype), \
814:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (status), \
815:    MPI_Abort(MPI_COMM_WORLD,0))

817:   /* called from PetscInitialize() - so return success */
818: #define MPI_Register_datarep(name,read_conv_fn,write_conv_fn,extent_fn,state) \
819:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (name),                          \
820:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (read_conv_fn), \
821:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (write_conv_fn), \
822:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (extent_fn), \
823:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (state), \
824:    MPI_SUCCESS)

826: #define MPI_Type_create_subarray(ndims,array_of_sizes,array_of_subsizes,array_of_starts,order,oldtype,newtype) \
827:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (ndims),                         \
828:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_sizes), \
829:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_subsizes), \
830:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_starts), \
831:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (order), \
832:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (oldtype), \
833:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (newtype), \
834:    MPI_Abort(MPI_COMM_WORLD,0))

836: #if defined(__cplusplus)
837: }
838: #endif
839: #endif