Actual source code: mpi.h

  1: /* $Id: mpi.h,v 1.87 2001/04/10 19:34:44 bsmith Exp $ */

  3: /*
  4:    This is a special set of bindings for uni-processor use of MPI by the PETSc library.
  5:  
  6:    NOT ALL THE MPI CALLS ARE IMPLEMENTED CORRECTLY! Only those needed in PETSc.

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

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

 17:   MPIUNI was developed with the aim of getting PETSc compiled, and
 18:   usable in the absence of MPI. This is the reason each function is
 19:   not documented.  The development strategy was - to make enough
 20:   changes to it so that PETSc source compiles without errors, and runs
 21:   in the uni-processor mode.

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

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

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

 40:   One of the goals with MPIUNI, is to avoid the function call overhead
 41:   of a regular MPI implementation. If this was not the case, we could
 42:   as well have used a regular implementation of MPI as they are
 43:   available on almost all machines. Hence most of the functions are
 44:   implemented as macros. One of the additional benefits we got from
 45:   MPIUNI is, we were able to use PETSc on machines where using a
 46:   proper implementation of MPI was painful (for eg NT).

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


 62: #if defined(__BSdependh)
 63: #error You cannot use MPI-uni with BlockSolve95
 64: #endif
 65: #if defined(__basic_H)
 66: #error You cannot use MPI-uni with SPAI
 67: #endif

 69: #define USING_MPIUNI

 71: /*

 73:     MPIUNI_TMP is used in the macros below only to stop various C/C++ compilers
 74: from generating warning messages about unused variables while compiling PETSc.
 75: */
 76: extern void *MPIUNI_TMP;

 78: #define MPI_COMM_WORLD       1
 79: #define MPI_COMM_SELF        MPI_COMM_WORLD
 80: #define MPI_COMM_NULL        0
 81: #define MPI_SUCCESS          0
 82: #define MPI_IDENT            0
 83: #define MPI_CONGRUENT        0
 84: #define MPI_SIMILAR          0
 85: #define MPI_UNEQUAL          3
 86: #define MPI_ANY_SOURCE     (-2)
 87: #define MPI_KEYVAL_INVALID   0
 88: #define MPI_ERR_UNKNOWN     18
 89: #define MPI_ERR_INTERN      21
 90: #define MPI_ERR_OTHER        1
 91: #define MPI_TAG_UB           0
 92: #define MPI_ERRORS_RETURN    0

 94: /* External types */
 95: typedef int    MPI_Comm;
 96: typedef void   *MPI_Request;
 97: typedef void   *MPI_Group;
 98: typedef struct {int MPI_TAG,MPI_SOURCE,MPI_ERROR;} MPI_Status;
 99: typedef char*   MPI_Errhandler;

101: extern int MPIUNI_Memcpy(void*,void*,int);

103: /* In order to handle datatypes, we make them into "sizeof(raw-type)";
104:     this allows us to do the MPIUNI_Memcpy's easily */
105: #define MPI_Datatype        int
106: #define MPI_FLOAT           sizeof(float)
107: #define MPI_DOUBLE          sizeof(double)
108: #define MPI_CHAR            sizeof(char)
109: #define MPI_BYTE            sizeof(char)
110: #define MPI_INT             sizeof(int)
111: #define MPI_LONG            sizeof(long)
112: #define MPI_SHORT           sizeof(short)
113: #define MPI_UNSIGNED_CHAR   sizeof(unsigned char)
114: #define MPI_UNSIGNED_LONG   sizeof(unsigned long)
115: #define MPIU_PETSCLOGDOUBLE sizeof(PetscLogDouble)
116: #define MPI_REQUEST_NULL    ((MPI_Request)0)

118: typedef int MPI_Op;

120: #define MPI_SUM           0
121: #define MPI_ANY_TAG     (-1)

123: /*
124:   Prototypes of some functions which are implemented in mpi.c
125: */
126: typedef int   (MPI_Copy_function)(MPI_Comm,int,void *,void *,void *,int *);
127: typedef int   (MPI_Delete_function)(MPI_Comm,int,void *,void *);
128: typedef void  (MPI_User_function)(void *, void *, int *, MPI_Datatype *);

130: /*
131:   In order that the PETSc MPIUNI can be used with another package that has its
132:   own MPIUni we map the following function names to a unique PETSc name. Those functions
133:   are defined in mpi.c
134: */
135: extern int    Petsc_MPI_Abort(MPI_Comm,int);
136: extern int    Petsc_MPI_Attr_get(MPI_Comm comm,int keyval,void *attribute_val,int *flag);
137: extern int    Petsc_MPI_Keyval_free(int*);
138: extern int    Petsc_MPI_Attr_put(MPI_Comm,int,void *);
139: extern int    Petsc_MPI_Attr_delete(MPI_Comm,int);
140: extern int    Petsc_MPI_Keyval_create(MPI_Copy_function *,MPI_Delete_function *,int *,void *);
141: extern int    Petsc_MPI_Comm_free(MPI_Comm*);
142: extern int    Petsc_MPI_Initialized(int *);
143: extern int    Petsc_MPI_Comm_dup(MPI_Comm,MPI_Comm *);
144: extern int    Petsc_MPI_Finalize(void);

146: #define MPI_Abort         Petsc_MPI_Abort
147: #define MPI_Attr_get      Petsc_MPI_Attr_get
148: #define MPI_Keyval_free   Petsc_MPI_Keyval_free
149: #define MPI_Attr_put      Petsc_MPI_Attr_put
150: #define MPI_Attr_delete   Petsc_MPI_Attr_delete
151: #define MPI_Keyval_create Petsc_MPI_Keyval_create
152: #define MPI_Comm_free     Petsc_MPI_Comm_free
153: #define MPI_Initialized   Petsc_MPI_Initialized
154: #define MPI_Comm_dup      Petsc_MPI_Comm_dup
155: #define MPI_Finalize      Petsc_MPI_Finalize

157: /* 
158:     Routines we have replace with macros that do nothing 
159:     Some return error codes others return success
160: */

162: #define MPI_Init(argc,argv) 
163:      (MPIUNI_TMP = (void*)(long) (argc),
164:       MPIUNI_TMP = (void*)(long) (argv),
165:       MPI_SUCCESS)
166: #define MPI_Send(buf,count,datatype,dest,tag,comm)  
167:      (MPIUNI_TMP = (void*)(long) (buf),
168:       MPIUNI_TMP = (void*)(long) (count),
169:       MPIUNI_TMP = (void*)(long) (datatype),
170:       MPIUNI_TMP = (void*)(long) (dest),
171:       MPIUNI_TMP = (void*)(long) (tag),
172:       MPIUNI_TMP = (void*)(long) (comm),
173:       MPI_SUCCESS)
174: #define MPI_Recv(buf,count,datatype,source,tag,comm,status) 
175:      (MPIUNI_TMP = (void*)(long) (buf),
176:       MPIUNI_TMP = (void*)(long) (count),
177:       MPIUNI_TMP = (void*)(long) (datatype),
178:       MPIUNI_TMP = (void*)(long) (source),
179:       MPIUNI_TMP = (void*)(long) (tag),
180:       MPIUNI_TMP = (void*)(long) (comm),
181:       MPIUNI_TMP = (void*)(long) (status),
182:       MPI_Abort(MPI_COMM_WORLD,0))
183: #define MPI_Get_count(status, datatype,count) 
184:      (MPIUNI_TMP = (void*)(long) (status),
185:       MPIUNI_TMP = (void*)(long) (datatype),
186:       MPIUNI_TMP = (void*)(long) (count),
187:       MPI_Abort(MPI_COMM_WORLD,0))
188: #define MPI_Bsend(buf,count,datatype,dest,tag,comm)  
189:      (MPIUNI_TMP = (void*)(long) (buf),
190:       MPIUNI_TMP = (void*)(long) (count),
191:       MPIUNI_TMP = (void*)(long) (datatype),
192:       MPIUNI_TMP = (void*)(long) (dest),
193:       MPIUNI_TMP = (void*)(long) (tag),
194:       MPIUNI_TMP = (void*)(long) (comm),
195:       MPI_SUCCESS)
196: #define MPI_Ssend(buf,count, datatype,dest,tag,comm) 
197:      (MPIUNI_TMP = (void*)(long) (buf),
198:       MPIUNI_TMP = (void*)(long) (count),
199:       MPIUNI_TMP = (void*)(long) (datatype),
200:       MPIUNI_TMP = (void*)(long) (dest),
201:       MPIUNI_TMP = (void*)(long) (tag),
202:       MPIUNI_TMP = (void*)(long) (comm),
203:       MPI_SUCCESS)
204: #define MPI_Rsend(buf,count, datatype,dest,tag,comm) 
205:      (MPIUNI_TMP = (void*)(long) (buf),
206:       MPIUNI_TMP = (void*)(long) (count),
207:       MPIUNI_TMP = (void*)(long) (datatype),
208:       MPIUNI_TMP = (void*)(long) (dest),
209:       MPIUNI_TMP = (void*)(long) (tag),
210:       MPIUNI_TMP = (void*)(long) (comm),
211:       MPI_SUCCESS)
212: #define MPI_Buffer_attach(buffer,size) 
213:      (MPIUNI_TMP = (void*)(long) (buffer),
214:       MPIUNI_TMP = (void*)(long) (size),
215:       MPI_SUCCESS)
216: #define MPI_Buffer_detach(buffer,size)
217:      (MPIUNI_TMP = (void*)(long) (buffer),
218:       MPIUNI_TMP = (void*)(long) (size),
219:       MPI_SUCCESS)
220: #define MPI_Ibsend(buf,count, datatype,dest,tag,comm,request) 
221:      (MPIUNI_TMP = (void*)(long) (buf),
222:        MPIUNI_TMP = (void*)(long) (count),
223:        MPIUNI_TMP = (void*)(long) (datatype),
224:        MPIUNI_TMP = (void*)(long) (dest),
225:        MPIUNI_TMP = (void*)(long) (tag),
226:        MPIUNI_TMP = (void*)(long) (comm),
227:        MPIUNI_TMP = (void*)(long) (request),
228:        MPI_SUCCESS)
229: #define MPI_Issend(buf,count, datatype,dest,tag,comm,request) 
230:      (MPIUNI_TMP = (void*)(long) (buf),
231:       MPIUNI_TMP = (void*)(long) (count),
232:       MPIUNI_TMP = (void*)(long) (datatype),
233:       MPIUNI_TMP = (void*)(long) (dest),
234:       MPIUNI_TMP = (void*)(long) (tag),
235:       MPIUNI_TMP = (void*)(long) (comm),
236:       MPIUNI_TMP = (void*)(long) (request),
237:       MPI_SUCCESS)
238: #define MPI_Irsend(buf,count, datatype,dest,tag,comm,request) 
239:      (MPIUNI_TMP = (void*)(long) (buf),
240:       MPIUNI_TMP = (void*)(long) (count),
241:       MPIUNI_TMP = (void*)(long) (datatype),
242:       MPIUNI_TMP = (void*)(long) (dest),
243:       MPIUNI_TMP = (void*)(long) (tag),
244:       MPIUNI_TMP = (void*)(long) (comm),
245:       MPIUNI_TMP = (void*)(long) (request),
246:       MPI_SUCCESS)
247: #define MPI_Irecv(buf,count, datatype,source,tag,comm,request) 
248:      (MPIUNI_TMP = (void*)(long) (buf),
249:       MPIUNI_TMP = (void*)(long) (count),
250:       MPIUNI_TMP = (void*)(long) (datatype),
251:       MPIUNI_TMP = (void*)(long) (source),
252:       MPIUNI_TMP = (void*)(long) (tag),
253:       MPIUNI_TMP = (void*)(long) (comm),
254:       MPIUNI_TMP = (void*)(long) (request),
255:       MPI_Abort(MPI_COMM_WORLD,0))
256: #define MPI_Isend(buf,count, datatype,dest,tag,comm,request) 
257:      (MPIUNI_TMP = (void*)(long) (buf),
258:       MPIUNI_TMP = (void*)(long) (count),
259:       MPIUNI_TMP = (void*)(long) (datatype),
260:       MPIUNI_TMP = (void*)(long) (dest),
261:       MPIUNI_TMP = (void*)(long) (tag),
262:       MPIUNI_TMP = (void*)(long) (comm),
263:       MPIUNI_TMP = (void*)(long) (request),
264:       MPI_Abort(MPI_COMM_WORLD,0))
265: #define MPI_Wait(request,status) 
266:      (MPIUNI_TMP = (void*)(long) (request),
267:       MPIUNI_TMP = (void*)(long) (status),
268:       MPI_SUCCESS)
269: #define MPI_Test(request,flag,status) 
270:      (MPIUNI_TMP = (void*)(long) (request),
271:       MPIUNI_TMP = (void*)(long) (status),
272:       *(flag) = 0, 
273:       MPI_SUCCESS)
274: #define MPI_Request_free(request) 
275:      (MPIUNI_TMP = (void*)(long) (request),
276:       MPI_SUCCESS)
277: #define MPI_Waitany(a,b,c,d) 
278:      (MPIUNI_TMP = (void*)(long) (a),
279:       MPIUNI_TMP = (void*)(long) (b),
280:       MPIUNI_TMP = (void*)(long) (c),
281:       MPIUNI_TMP = (void*)(long) (d),
282:       MPI_SUCCESS)
283: #define MPI_Testany(a,b,c,d,e) 
284:      (MPIUNI_TMP = (void*)(long) (a),
285:       MPIUNI_TMP = (void*)(long) (b),
286:       MPIUNI_TMP = (void*)(long) (c),
287:       MPIUNI_TMP = (void*)(long) (d),
288:       MPIUNI_TMP = (void*)(long) (e),
289:       MPI_SUCCESS)
290: #define MPI_Waitall(count,array_of_requests,array_of_statuses) 
291:      (MPIUNI_TMP = (void*)(long) (count),
292:       MPIUNI_TMP = (void*)(long) (array_of_requests),
293:       MPIUNI_TMP = (void*)(long) (array_of_statuses),
294:       MPI_SUCCESS)
295: #define MPI_Testall(count,array_of_requests,flag,array_of_statuses) 
296:      (MPIUNI_TMP = (void*)(long) (count),
297:       MPIUNI_TMP = (void*)(long) (array_of_requests),
298:       MPIUNI_TMP = (void*)(long) (flag),
299:       MPIUNI_TMP = (void*)(long) (array_of_statuses),
300:       MPI_SUCCESS)
301: #define MPI_Waitsome(incount,array_of_requests,outcount,
302:                      array_of_indices,array_of_statuses) 
303:      (MPIUNI_TMP = (void*)(long) (incount),
304:       MPIUNI_TMP = (void*)(long) (array_of_requests),
305:       MPIUNI_TMP = (void*)(long) (outcount),
306:       MPIUNI_TMP = (void*)(long) (array_of_indices),
307:       MPIUNI_TMP = (void*)(long) (array_of_statuses),
308:       MPI_SUCCESS)
309: #define MPI_Comm_group(comm,group) 
310:      (MPIUNI_TMP = (void*)(long) (comm),
311:       MPIUNI_TMP = (void*)(long) (group),
312:       MPI_SUCCESS)
313: #define MPI_Group_incl(group,n,ranks,newgroup) 
314:      (MPIUNI_TMP = (void*)(long) (group),
315:       MPIUNI_TMP = (void*)(long) (n),
316:       MPIUNI_TMP = (void*)(long) (ranks),
317:       MPIUNI_TMP = (void*)(long) (newgroup),
318:       MPI_SUCCESS)
319: #define MPI_Testsome(incount,array_of_requests,outcount,
320:                      array_of_indices,array_of_statuses) MPI_SUCCESS
321: #define MPI_Iprobe(source,tag,comm,flag,status) (*(flag)=0, MPI_SUCCESS)
322: #define MPI_Probe(source,tag,comm,status) MPI_SUCCESS
323: #define MPI_Cancel(request) (MPIUNI_TMP = (void*)(long) (request),MPI_SUCCESS)
324: #define MPI_Test_cancelled(status,flag) (*(flag)=0,MPI_SUCCESS)
325: #define MPI_Send_init(buf,count, datatype,dest,tag,comm,request) 
326:      (MPIUNI_TMP = (void*)(long) (buf),
327:      MPIUNI_TMP = (void*)(long) (count),
328:      MPIUNI_TMP = (void*)(long) (datatype),
329:      MPIUNI_TMP = (void*)(long) (dest),
330:      MPIUNI_TMP = (void*)(long) (tag),
331:      MPIUNI_TMP = (void*)(long) (comm),
332:      MPIUNI_TMP = (void*)(long) (request),
333:      MPI_SUCCESS)
334: #define MPI_Bsend_init(buf,count, datatype,dest,tag,comm,request) 
335:      (MPIUNI_TMP = (void*)(long) (buf),
336:      MPIUNI_TMP = (void*)(long) (count),
337:      MPIUNI_TMP = (void*)(long) (datatype),
338:      MPIUNI_TMP = (void*)(long) (dest),
339:      MPIUNI_TMP = (void*)(long) (tag),
340:      MPIUNI_TMP = (void*)(long) (comm),
341:      MPIUNI_TMP = (void*)(long) (request),
342:      MPI_SUCCESS)
343: #define MPI_Ssend_init(buf,count, datatype,dest,tag,comm,request) 
344:      (MPIUNI_TMP = (void*)(long) (buf),
345:      MPIUNI_TMP = (void*)(long) (count),
346:      MPIUNI_TMP = (void*)(long) (datatype),
347:      MPIUNI_TMP = (void*)(long) (dest),
348:      MPIUNI_TMP = (void*)(long) (tag),
349:      MPIUNI_TMP = (void*)(long) (comm),
350:      MPIUNI_TMP = (void*)(long) (request),
351:      MPI_SUCCESS)
352: #define MPI_Bsend_init(buf,count, datatype,dest,tag,comm,request) 
353:      (MPIUNI_TMP = (void*)(long) (buf),
354:      MPIUNI_TMP = (void*)(long) (count),
355:      MPIUNI_TMP = (void*)(long) (datatype),
356:      MPIUNI_TMP = (void*)(long) (dest),
357:      MPIUNI_TMP = (void*)(long) (tag),
358:      MPIUNI_TMP = (void*)(long) (comm),
359:      MPIUNI_TMP = (void*)(long) (request),
360:      MPI_SUCCESS)
361: #define MPI_Rsend_init(buf,count, datatype,dest,tag,comm,request) 
362:      (MPIUNI_TMP = (void*)(long) (buf),
363:      MPIUNI_TMP = (void*)(long) (count),
364:      MPIUNI_TMP = (void*)(long) (datatype),
365:      MPIUNI_TMP = (void*)(long) (dest),
366:      MPIUNI_TMP = (void*)(long) (tag),
367:      MPIUNI_TMP = (void*)(long) (comm),
368:      MPIUNI_TMP = (void*)(long) (request),
369:      MPI_SUCCESS)
370: #define MPI_Recv_init(buf,count, datatype,source,tag,comm,request) 
371:      (MPIUNI_TMP = (void*)(long) (buf),
372:      MPIUNI_TMP = (void*)(long) (count),
373:      MPIUNI_TMP = (void*)(long) (datatype),
374:      MPIUNI_TMP = (void*)(long) (source),
375:      MPIUNI_TMP = (void*)(long) (tag),
376:      MPIUNI_TMP = (void*)(long) (comm),
377:      MPIUNI_TMP = (void*)(long) (request),
378:      MPI_SUCCESS)
379: #define MPI_Start(request) (MPIUNI_TMP = (void*)(long) (request),MPI_SUCCESS)
380: #define MPI_Startall(count,array_of_requests) 
381:      (MPIUNI_TMP = (void*)(long) (count),
382:      MPIUNI_TMP = (void*)(long) (array_of_requests),
383:      MPI_SUCCESS)
384: #define MPI_Op_create(function,commute,op) 
385:      (MPIUNI_TMP = (void*)(long) (function),
386:      MPIUNI_TMP = (void*)(long) (commute),
387:      MPIUNI_TMP = (void*)(long) (op),
388:      MPI_SUCCESS)
389: #define MPI_Op_free(op) 
390:      (MPIUNI_TMP = (void*)(long) (op),
391:      MPI_SUCCESS)
392:      /* Need to determine sizeof "sendtype" */
393: #define MPI_Sendrecv(sendbuf,sendcount, sendtype,
394:      dest,sendtag,recvbuf,recvcount,
395:      recvtype,source,recvtag,
396:      comm,status) 
397:      MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount) * (sendtype))
398: #define MPI_Sendrecv_replace(buf,count, datatype,dest,sendtag,
399:      source,recvtag,comm,status) MPI_SUCCESS
400: #define MPI_Type_contiguous(count, oldtype,newtype) 
401:      (*(newtype) = (count)*(oldtype),MPI_SUCCESS)
402: #define MPI_Type_vector(count,blocklength,stride,oldtype, newtype) MPI_SUCCESS
403: #define MPI_Type_hvector(count,blocklength,stride,oldtype, newtype) MPI_SUCCESS
404: #define MPI_Type_indexed(count,array_of_blocklengths,
405:      array_of_displacements, oldtype,
406:      newtype) MPI_SUCCESS
407: #define MPI_Type_hindexed(count,array_of_blocklengths,
408:      array_of_displacements, oldtype,
409:      newtype) MPI_SUCCESS
410: #define MPI_Type_struct(count,array_of_blocklengths,
411:      array_of_displacements,
412:      array_of_types, newtype) MPI_SUCCESS
413: #define MPI_Address(location,address) 
414:      (*(address) = (long)(char *)(location),MPI_SUCCESS)
415: #define MPI_Type_extent(datatype,extent) 
416:      MPI_Abort(MPI_COMM_WORLD,0)
417: #define MPI_Type_size(datatype,size) 
418:      MPI_Abort(MPI_COMM_WORLD,0)
419: #define MPI_Type_lb(datatype,displacement) 
420:      MPI_Abort(MPI_COMM_WORLD,0)
421: #define MPI_Type_ub(datatype,displacement) 
422:      MPI_Abort(MPI_COMM_WORLD,0)
423: #define MPI_Type_commit(datatype) (MPIUNI_TMP = (void*)(long) (datatype),
424:      MPI_SUCCESS)
425: #define MPI_Type_free(datatype) MPI_SUCCESS
426: #define MPI_Get_elements(status, datatype,count) 
427:      MPI_Abort(MPI_COMM_WORLD,0)
428: #define MPI_Pack(inbuf,incount, datatype,outbuf,
429:      outsize,position, comm) 
430:      MPI_Abort(MPI_COMM_WORLD,0)
431: #define MPI_Unpack(inbuf,insize,position,outbuf,
432:      outcount, datatype,comm) 
433:      MPI_Abort(MPI_COMM_WORLD,0)
434: #define MPI_Pack_size(incount, datatype,comm,size) 
435:      MPI_Abort(MPI_COMM_WORLD,0)
436: #define MPI_Barrier(comm) 
437:      (MPIUNI_TMP = (void*)(long) (comm),
438:      MPI_SUCCESS)
439: #define MPI_Bcast(buffer,count,datatype,root,comm) 
440:      (MPIUNI_TMP = (void*)(long) (buffer),
441:      MPIUNI_TMP = (void*)(long) (count),
442:      MPIUNI_TMP = (void*)(long) (datatype),
443:      MPIUNI_TMP = (void*)(long) (comm),
444:      MPI_SUCCESS)
445: #define MPI_Gather(sendbuf,sendcount, sendtype,
446:      recvbuf,recvcount, recvtype,
447:      root,comm) 
448:      (MPIUNI_TMP = (void*)(long) (recvcount),
449:      MPIUNI_TMP = (void*)(long) (root),
450:      MPIUNI_TMP = (void*)(long) (recvtype),
451:      MPIUNI_TMP = (void*)(long) (comm),
452:      MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)),
453:      MPI_SUCCESS)
454: #define MPI_Gatherv(sendbuf,sendcount, sendtype,
455:      recvbuf,recvcounts,displs,
456:      recvtype,root,comm) 
457:      (MPIUNI_TMP = (void*)(long) (recvcounts),
458:      MPIUNI_TMP = (void*)(long) (displs),
459:      MPIUNI_TMP = (void*)(long) (recvtype),
460:      MPIUNI_TMP = (void*)(long) (root),
461:      MPIUNI_TMP = (void*)(long) (comm),
462:      MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)),
463:      MPI_SUCCESS)
464: #define MPI_Scatter(sendbuf,sendcount, sendtype,
465:      recvbuf,recvcount, recvtype,
466:      root,comm) 
467:      (MPIUNI_TMP = (void*)(long) (sendbuf),
468:      MPIUNI_TMP = (void*)(long) (sendcount),
469:      MPIUNI_TMP = (void*)(long) (sendtype),
470:      MPIUNI_TMP = (void*)(long) (recvbuf),
471:      MPIUNI_TMP = (void*)(long) (recvcount),
472:      MPIUNI_TMP = (void*)(long) (recvtype),
473:      MPIUNI_TMP = (void*)(long) (root),
474:      MPIUNI_TMP = (void*)(long) (comm),MPI_Abort(MPI_COMM_WORLD,0))
475: #define MPI_Scatterv(sendbuf,sendcounts,displs,
476:      sendtype, recvbuf,recvcount,
477:      recvtype,root,comm) 
478:      (MPIUNI_TMP = (void*)(long) (sendbuf),
479:      MPIUNI_TMP = (void*)(long) (sendcounts),
480:      MPIUNI_TMP = (void*)(long) (displs),
481:      MPIUNI_TMP = (void*)(long) (sendtype),
482:      MPIUNI_TMP = (void*)(long) (recvbuf),
483:      MPIUNI_TMP = (void*)(long) (recvcount),
484:      MPIUNI_TMP = (void*)(long) (recvtype),
485:      MPIUNI_TMP = (void*)(long) (root),
486:      MPIUNI_TMP = (void*)(long) (comm),MPI_Abort(MPI_COMM_WORLD,0))
487: #define MPI_Allgather(sendbuf,sendcount, sendtype,
488:      recvbuf,recvcount, recvtype,comm) 
489:      (MPIUNI_TMP = (void*)(long) (recvcount),
490:      MPIUNI_TMP = (void*)(long) (recvtype),
491:      MPIUNI_TMP = (void*)(long) (comm),
492:      MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)),
493:      MPI_SUCCESS)
494: #define MPI_Allgatherv(sendbuf,sendcount, sendtype,
495:      recvbuf,recvcounts,displs,recvtype,comm) 
496:      (MPIUNI_TMP = (void*)(long) (recvcounts),
497:      MPIUNI_TMP = (void*)(long) (displs),
498:      MPIUNI_TMP = (void*)(long) (recvtype),
499:      MPIUNI_TMP = (void*)(long) (comm),
500:      MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)),
501:      MPI_SUCCESS)
502: #define MPI_Alltoall(sendbuf,sendcount, sendtype,
503:      recvbuf,recvcount, recvtype,
504:      comm) MPI_Abort(MPI_COMM_WORLD,0)
505: #define MPI_Alltoallv(sendbuf,sendcounts,sdispls,
506:      sendtype, recvbuf,recvcounts,
507:      rdispls, recvtype,comm) MPI_Abort(MPI_COMM_WORLD,0)
508: #define MPI_Reduce(sendbuf, recvbuf,count,
509:      datatype,op,root,comm) 
510:      (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)),
511:      MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
512: #define MPI_Allreduce(sendbuf, recvbuf,count,datatype,op,comm) 
513:      (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)),
514:      MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
515: #define MPI_Scan(sendbuf, recvbuf,count,datatype,op,comm) 
516:      (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)),
517:      MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
518: #define MPI_Reduce_scatter(sendbuf, recvbuf,recvcounts,
519:      datatype,op,comm) 
520:      MPI_Abort(MPI_COMM_WORLD,0)
521: #define MPI_Group_size(group,size) (*(size)=1,MPI_SUCCESS)
522: #define MPI_Group_rank(group,rank) (*(rank)=0,MPI_SUCCESS)
523: #define MPI_Group_translate_ranks (group1,n,ranks1,
524:      group2,ranks2) MPI_Abort(MPI_COMM_WORLD,0)
525: #define MPI_Group_compare(group1,group2,result) 
526:      (*(result)=1,MPI_SUCCESS)
527: #define MPI_Group_union(group1,group2,newgroup) MPI_SUCCESS
528: #define MPI_Group_intersection(group1,group2,newgroup) MPI_SUCCESS
529: #define MPI_Group_difference(group1,group2,newgroup) MPI_SUCCESS
530: #define MPI_Group_excl(group,n,ranks,newgroup) MPI_SUCCESS
531: #define MPI_Group_range_incl(group,n,ranges,newgroup) MPI_SUCCESS
532: #define MPI_Group_range_excl(group,n,ranges,newgroup) MPI_SUCCESS
533: #define MPI_Group_free(group) 
534:      (MPIUNI_TMP = (void*)(long) (group),
535:      MPI_SUCCESS)
536: #define MPI_Comm_size(comm,size) 
537:      (MPIUNI_TMP = (void*)(long) (comm),
538:      *(size)=1,
539:      MPI_SUCCESS)
540: #define MPI_Comm_rank(comm,rank) 
541:      (MPIUNI_TMP = (void*)(long) (comm),
542:      *(rank)=0,
543:      MPI_SUCCESS)
544: #define MPI_Comm_compare(comm1,comm2,result) 
545:      (MPIUNI_TMP = (void*)(long) (comm1),
546:      MPIUNI_TMP = (void*)(long) (comm2),
547:      *(result)=MPI_IDENT,
548:      MPI_SUCCESS)
549: #define MPI_Comm_create(comm,group,newcomm)  
550:      (*(newcomm) =  (comm),
551:      MPIUNI_TMP = (void*)(long) (group),
552:      MPI_SUCCESS)
553: #define MPI_Comm_split(comm,color,key,newcomm) MPI_SUCCESS
554: #define MPI_Comm_test_inter(comm,flag) (*(flag)=1,MPI_SUCCESS)
555: #define MPI_Comm_remote_size(comm,size) (*(size)=1,MPI_SUCCESS)
556: #define MPI_Comm_remote_group(comm,group) MPI_SUCCESS
557: #define MPI_Intercomm_create(local_comm,local_leader,peer_comm,
558:      remote_leader,tag,newintercomm) MPI_SUCCESS
559: #define MPI_Intercomm_merge(intercomm,high,newintracomm) MPI_SUCCESS

561: #define MPI_Topo_test(comm,status) MPI_SUCCESS
562: #define MPI_Cart_create(comm_old,ndims,dims,periods,
563:      reorder,comm_cart) MPI_SUCCESS
564: #define MPI_Dims_create(nnodes,ndims,dims) MPI_Abort(MPI_COMM_WORLD,0)
565: #define MPI_Graph_create(comm,a,b,c,d,e) MPI_SUCCESS
566: #define MPI_Graphdims_Get(comm,nnodes,nedges) MPI_Abort(MPI_COMM_WORLD,0)
567: #define MPI_Graph_get(comm,a,b,c,d) MPI_Abort(MPI_COMM_WORLD,0)
568: #define MPI_Cartdim_get(comm,ndims) MPI_Abort(MPI_COMM_WORLD,0)
569: #define MPI_Cart_get(comm,maxdims,dims,periods,coords) 
570:      MPI_Abort(MPI_COMM_WORLD,0)
571: #define MPI_Cart_rank(comm,coords,rank) MPI_Abort(MPI_COMM_WORLD,0)
572: #define MPI_Cart_coords(comm,rank,maxdims,coords) 
573:      MPI_Abort(MPI_COMM_WORLD,0)
574: #define MPI_Graph_neighbors_count(comm,rank,nneighbors) 
575:      MPI_Abort(MPI_COMM_WORLD,0)
576: #define MPI_Graph_neighbors(comm,rank,maxneighbors,neighbors) 
577:      MPI_Abort(MPI_COMM_WORLD,0)
578: #define MPI_Cart_shift(comm,direction,disp,rank_source,rank_dest) 
579:      MPI_Abort(MPI_COMM_WORLD,0)
580: #define MPI_Cart_sub(comm,remain_dims,newcomm) MPI_Abort(MPI_COMM_WORLD,0)
581: #define MPI_Cart_map(comm,ndims,dims,periods,newrank) MPI_Abort(MPI_COMM_WORLD,0)
582: #define MPI_Graph_map(comm,a,b,c,d) MPI_Abort(MPI_COMM_WORLD,0)
583: #define MPI_Get_processor_name(name,result_len) 
584:      (MPIUNI_Memcpy(name,"localhost",9*sizeof(char)),name[10] = 0,*(result_len) = 10)
585: #define MPI_Errhandler_create(function,errhandler) 
586:      (MPIUNI_TMP = (void*)(long) (errhandler),
587:      MPI_SUCCESS)
588: #define MPI_Errhandler_set(comm,errhandler) 
589:      (MPIUNI_TMP = (void*)(long) (comm),
590:      MPIUNI_TMP = (void*)(long) (errhandler),
591:      MPI_SUCCESS)
592: #define MPI_Errhandler_get(comm,errhandler) MPI_SUCCESS
593: #define MPI_Errhandler_free(errhandler) MPI_SUCCESS
594: #define MPI_Error_string(errorcode,string,result_len) MPI_SUCCESS
595: #define MPI_Error_class(errorcode,errorclass) MPI_SUCCESS
596: #define MPI_Wtick() 1.0
597: #define MPI_Wtime() 0.0
598: #define MPI_Pcontrol(level) MPI_SUCCESS

600: #define MPI_NULL_COPY_FN   0
601: #define MPI_NULL_DELETE_FN 0

603: #endif