Actual source code: mpi.h

petsc-3.3-p7 2013-05-11
  1: /*
  2:    This is a special set of bindings for uni-processor use of MPI by the PETSc library.
  3:  
  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.
 63:   
 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: #if defined(__cplusplus)
107: extern "C" {
108: #endif

110: /* require an int variable large enough to hold a pointer */
111: #if !defined(MPIUNI_INTPTR)
112: #define MPIUNI_INTPTR long
113: #endif

115: /*

117:     MPIUNI_TMP is used in the macros below only to stop various C/C++ compilers
118: from generating warning messages about unused variables while compiling PETSc.
119: */
120: extern void *MPIUNI_TMP;

122: #define MPI_COMM_WORLD       1
123: #define MPI_COMM_SELF        MPI_COMM_WORLD
124: #define MPI_COMM_NULL        0
125: #define MPI_SUCCESS          0
126: #define MPI_IDENT            0
127: #define MPI_CONGRUENT        1
128: #define MPI_SIMILAR          2
129: #define MPI_UNEQUAL          3
130: #define MPI_ANY_SOURCE     (-2)
131: #define MPI_KEYVAL_INVALID   0
132: #define MPI_ERR_UNKNOWN     18
133: #define MPI_ERR_INTERN      21
134: #define MPI_ERR_OTHER        1
135: #define MPI_TAG_UB           0
136: #define MPI_ERRORS_RETURN    0
137: #define MPI_UNDEFINED      (-32766)
138: #define MPI_ERRORS_ARE_FATAL (-32765)
139: #define MPI_MAXLOC           5


142: /* External types */
143: typedef int    MPI_Comm;
144: typedef void   *MPI_Request;
145: typedef void   *MPI_Group;
146: typedef struct {int MPI_TAG,MPI_SOURCE,MPI_ERROR;} MPI_Status;
147: typedef char   *MPI_Errhandler;
148: typedef int    MPI_Fint;
149: typedef int    MPI_File;
150: typedef int    MPI_Info;
151: typedef int    MPI_Offset;


154: /* In order to handle datatypes, we make them into "sizeof(raw-type)";
155:     this allows us to do the MPIUNI_Memcpy's easily */
156: #define MPI_Datatype         int
157: #define MPI_FLOAT            sizeof(float)
158: #define MPI_DOUBLE           sizeof(double)
159: #define MPI_LONG_DOUBLE      sizeof(long double)
160: #define MPI_CHAR             sizeof(char)
161: #define MPI_BYTE             sizeof(char)
162: #define MPI_INT              sizeof(int)
163: #define MPI_LONG             sizeof(long)
164: #define MPI_LONG_LONG_INT    sizeof(long long)
165: #define MPI_SHORT            sizeof(short)
166: #define MPI_UNSIGNED_SHORT   sizeof(unsigned short)
167: #define MPI_UNSIGNED         sizeof(unsigned)
168: #define MPI_UNSIGNED_CHAR    sizeof(unsigned char)
169: #define MPI_UNSIGNED_LONG    sizeof(unsigned long)
170: #define MPI_COMPLEX          2*sizeof(float)
171: #define MPI_C_COMPLEX        2*sizeof(float)
172: #define MPI_C_DOUBLE_COMPLEX 2*sizeof(double)
173: #define MPI_FLOAT_INT        (sizeof(float) + sizeof(int))
174: #define MPI_DOUBLE_INT       (sizeof(double) + sizeof(int))
175: #define MPI_LONG_INT         (sizeof(long) + sizeof(int))
176: #define MPI_SHORT_INT        (sizeof(short) + sizeof(int))
177: #define MPI_2INT             (2* sizeof(int))

179: #if defined(PETSC_USE_REAL___FLOAT128)
180: extern MPI_Datatype MPIU___FLOAT128;
181: #define MPI_sizeof(datatype) ((datatype == MPIU___FLOAT128) ? 2*sizeof(double) : datatype)
182: #else
183: #define MPI_sizeof(datatype) (datatype)
184: #endif
185: extern int MPIUNI_Memcpy(void*,const void*,int);


188: #define MPI_REQUEST_NULL     ((MPI_Request)0)
189: #define MPI_GROUP_NULL       ((MPI_Group)0)
190: #define MPI_INFO_NULL        ((MPI_Info)0)
191: #define MPI_BOTTOM           (void *)0
192: typedef int MPI_Op;

194: #define MPI_MODE_RDONLY   0
195: #define MPI_MODE_WRONLY   0
196: #define MPI_MODE_CREATE   0

198: #define MPI_SUM           0
199: #define MPI_MAX           0
200: #define MPI_MIN           0
201: #define MPI_REPLACE       0
202: #define MPI_ANY_TAG     (-1)
203: #define MPI_DATATYPE_NULL 0
204: #define MPI_PACKED        0
205: #define MPI_MAX_ERROR_STRING 2056
206: #define MPI_STATUS_IGNORE (MPI_Status *)1
207: #define MPI_STATUSES_IGNORE (MPI_Status *)1
208: #define MPI_ORDER_FORTRAN        57
209: #define MPI_IN_PLACE      (void *) -1

211: /*
212:   Prototypes of some functions which are implemented in mpi.c
213: */
214: typedef int   (MPI_Copy_function)(MPI_Comm,int,void *,void *,void *,int *);
215: typedef int   (MPI_Delete_function)(MPI_Comm,int,void *,void *);
216: typedef void  (MPI_User_function)(void*, void *, int *, MPI_Datatype *);

218: /*
219:   In order that the PETSc MPIUNI can be used with another package that has its
220:   own MPIUni we map the following function names to a unique PETSc name. Those functions
221:   are defined in mpi.c and put into the libpetscsys.a or libpetsc.a library.

223:   Note that this does not work for the MPIUni Fortran symbols which are explicitly in the 
224:   PETSc libraries unless the flag MPIUNI_AVOID_MPI_NAMESPACE is set.
225: */
226: #define MPI_Abort         Petsc_MPI_Abort
227: #define MPI_Attr_get      Petsc_MPI_Attr_get
228: #define MPI_Keyval_free   Petsc_MPI_Keyval_free
229: #define MPI_Attr_put      Petsc_MPI_Attr_put
230: #define MPI_Attr_delete   Petsc_MPI_Attr_delete
231: #define MPI_Keyval_create Petsc_MPI_Keyval_create
232: #define MPI_Comm_free     Petsc_MPI_Comm_free
233: #define MPI_Comm_dup      Petsc_MPI_Comm_dup
234: #define MPI_Comm_create   Petsc_MPI_Comm_create
235: #define MPI_Init          Petsc_MPI_Init
236: #define MPI_Finalize      Petsc_MPI_Finalize
237: #define MPI_Initialized   Petsc_MPI_Initialized
238: #define MPI_Finalized     Petsc_MPI_Finalized
239: #define MPI_Comm_size     Petsc_MPI_Comm_size
240: #define MPI_Comm_rank     Petsc_MPI_Comm_rank

242: /* identical C bindings */
243: #define MPI_Comm_create_keyval Petsc_MPI_Keyval_create
244: #define MPI_Comm_free_keyval   Petsc_MPI_Keyval_free
245: #define MPI_Comm_get_attr      Petsc_MPI_Attr_get
246: #define MPI_Comm_set_attr      Petsc_MPI_Attr_put

248: extern int    MPI_Abort(MPI_Comm,int);
249: extern int    MPI_Attr_get(MPI_Comm comm,int keyval,void *attribute_val,int *flag);
250: extern int    MPI_Keyval_free(int*);
251: extern int    MPI_Attr_put(MPI_Comm,int,void *);
252: extern int    MPI_Attr_delete(MPI_Comm,int);
253: extern int    MPI_Keyval_create(MPI_Copy_function *,MPI_Delete_function *,int *,void *);
254: extern int    MPI_Comm_free(MPI_Comm*);
255: extern int    MPI_Comm_dup(MPI_Comm,MPI_Comm *);
256: extern int    MPI_Comm_create(MPI_Comm,MPI_Group,MPI_Comm *);
257: extern int    MPI_Init(int *, char ***);
258: extern int    MPI_Finalize(void);
259: extern int    MPI_Initialized(int*);
260: extern int    MPI_Finalized(int*);
261: extern int    MPI_Comm_size(MPI_Comm,int*);
262: extern int    MPI_Comm_rank(MPI_Comm,int*);

264: #define MPI_Aint MPIUNI_INTPTR
265: /* 
266:     Routines we have replace with macros that do nothing 
267:     Some return error codes others return success
268: */

270: #define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
271: #define MPI_Comm_c2f(comm) (MPI_Fint)(comm)

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

672: #define MPI_Topo_test(comm,status) MPI_SUCCESS
673: #define MPI_Cart_create(comm_old,ndims,dims,periods,\
674:      reorder,comm_cart) MPI_SUCCESS
675: #define MPI_Dims_create(nnodes,ndims,dims) MPI_Abort(MPI_COMM_WORLD,0)
676: #define MPI_Graph_create(comm,a,b,c,d,e) MPI_SUCCESS
677: #define MPI_Graphdims_Get(comm,nnodes,nedges) MPI_Abort(MPI_COMM_WORLD,0)
678: #define MPI_Graph_get(comm,a,b,c,d) MPI_Abort(MPI_COMM_WORLD,0)
679: #define MPI_Cartdim_get(comm,ndims) MPI_Abort(MPI_COMM_WORLD,0)
680: #define MPI_Cart_get(comm,maxdims,dims,periods,coords) \
681:      MPI_Abort(MPI_COMM_WORLD,0)
682: #define MPI_Cart_rank(comm,coords,rank) MPI_Abort(MPI_COMM_WORLD,0)
683: #define MPI_Cart_coords(comm,rank,maxdims,coords) \
684:      MPI_Abort(MPI_COMM_WORLD,0)
685: #define MPI_Graph_neighbors_count(comm,rank,nneighbors) \
686:      MPI_Abort(MPI_COMM_WORLD,0)
687: #define MPI_Graph_neighbors(comm,rank,maxneighbors,neighbors) \
688:      MPI_Abort(MPI_COMM_WORLD,0)
689: #define MPI_Cart_shift(comm,direction,disp,rank_source,rank_dest) \
690:      MPI_Abort(MPI_COMM_WORLD,0)
691: #define MPI_Cart_sub(comm,remain_dims,newcomm) MPI_Abort(MPI_COMM_WORLD,0)
692: #define MPI_Cart_map(comm,ndims,dims,periods,newrank) MPI_Abort(MPI_COMM_WORLD,0)
693: #define MPI_Graph_map(comm,a,b,c,d) MPI_Abort(MPI_COMM_WORLD,0)
694: #define MPI_Get_processor_name(name,result_len) \
695:      (MPIUNI_Memcpy(name,"localhost",9*sizeof(char)),name[10] = 0,*(result_len) = 10)
696: #define MPI_Errhandler_create(function,errhandler) (*(errhandler) = (MPI_Errhandler) 0, MPI_SUCCESS)    
697: #define MPI_Errhandler_set(comm,errhandler) \
698:      (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),\
699:      MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (errhandler),\
700:      MPI_SUCCESS)
701: #define MPI_Errhandler_get(comm,errhandler) MPI_SUCCESS
702: #define MPI_Errhandler_free(errhandler) MPI_SUCCESS
703: #define MPI_Error_string(errorcode,string,result_len) MPI_SUCCESS
704: #define MPI_Error_class(errorcode,errorclass) MPI_SUCCESS
705: #define MPI_Wtick() 1.0
706: #define MPI_Wtime() 0.0
707: #define MPI_Pcontrol(level) MPI_SUCCESS

709: #define MPI_NULL_COPY_FN   0
710: #define MPI_NULL_DELETE_FN 0

712:   /* MPI-IO additions */

714: #define MPI_File_open(comm,filename,amode,info,mpi_fh) \
715:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (comm),  \
716:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (filename), \
717:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (amode), \
718:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (info), \
719:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh), \
720:    MPI_Abort(MPI_COMM_WORLD,0))

722: #define MPI_File_close(mpi_fh) \
723:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh),  \
724:    MPI_Abort(MPI_COMM_WORLD,0))

726: #define MPI_File_set_view(mpi_fh,disp,etype,filetype,datarep,info) \
727:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh),  \
728:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (disp), \
729:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (etype), \
730:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (filetype), \
731:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datarep), \
732:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (info), \
733:    MPI_Abort(MPI_COMM_WORLD,0))

735: #define MPI_Type_get_extent(datatype,lb,extent) \
736:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype),      \
737:    *(lb) = 0, *(extent) = datatype,0)

739: #define MPI_File_write_all(mpi_fh,buf,count,datatype,status) \
740:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh),             \
741:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf), \
742:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count), \
743:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype), \
744:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (status), \
745:    MPI_Abort(MPI_COMM_WORLD,0))

747: #define MPI_File_read_all(mpi_fh,buf,count,datatype,status) \
748:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (mpi_fh),            \
749:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (buf), \
750:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (count), \
751:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (datatype), \
752:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (status), \
753:    MPI_Abort(MPI_COMM_WORLD,0))

755:   /* called from PetscInitialize() - so return success */
756: #define MPI_Register_datarep(name,read_conv_fn,write_conv_fn,extent_fn,state) \
757:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (name),                          \
758:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (read_conv_fn), \
759:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (write_conv_fn), \
760:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (extent_fn), \
761:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (state), \
762:    MPI_SUCCESS)

764: #define MPI_Type_create_subarray(ndims,array_of_sizes,array_of_subsizes,array_of_starts,order,oldtype,newtype) \
765:   (MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (ndims),                         \
766:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_sizes), \
767:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_subsizes), \
768:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (array_of_starts), \
769:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (order), \
770:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (oldtype), \
771:    MPIUNI_TMP = (void*)(MPIUNI_INTPTR) (newtype), \
772:    MPI_Abort(MPI_COMM_WORLD,0))

774: #if defined(__cplusplus)
775: }
776: #endif
777: #endif