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 _petsc_mpi_uni
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;
100: typedef int MPI_Fint;
102: extern int MPIUNI_Memcpy(void*,void*,int);
104: /* In order to handle datatypes, we make them into "sizeof(raw-type)";
105: this allows us to do the MPIUNI_Memcpy's easily */
106: #define MPI_Datatype int
107: #define MPI_FLOAT sizeof(float)
108: #define MPI_DOUBLE sizeof(double)
109: #define MPI_CHAR sizeof(char)
110: #define MPI_BYTE sizeof(char)
111: #define MPI_INT sizeof(int)
112: #define MPI_LONG sizeof(long)
113: #define MPI_SHORT sizeof(short)
114: #define MPI_UNSIGNED sizeof(unsigned)
115: #define MPI_UNSIGNED_CHAR sizeof(unsigned char)
116: #define MPI_UNSIGNED_LONG sizeof(unsigned long)
117: #define MPI_COMPLEX 2*sizeof(float)
118: #define MPI_DOUBLE_COMPLEX 2*sizeof(double)
119: #define MPIU_PETSCLOGDOUBLE sizeof(PetscLogDouble)
120: #define MPI_REQUEST_NULL ((MPI_Request)0)
121: #define MPI_GROUP_NULL ((MPI_Group)0)
122: typedef int MPI_Op;
124: #define MPI_SUM 0
125: #define MPI_ANY_TAG (-1)
126: #define MPI_DATATYPE_NULL 0
127: /*
128: Prototypes of some functions which are implemented in mpi.c
129: */
130: typedef int (MPI_Copy_function)(MPI_Comm,int,void *,void *,void *,int *);
131: typedef int (MPI_Delete_function)(MPI_Comm,int,void *,void *);
132: typedef void (MPI_User_function)(void *, void *, int *, MPI_Datatype *);
134: /*
135: In order that the PETSc MPIUNI can be used with another package that has its
136: own MPIUni we map the following function names to a unique PETSc name. Those functions
137: are defined in mpi.c
138: */
139: extern int Petsc_MPI_Abort(MPI_Comm,int);
140: extern int Petsc_MPI_Attr_get(MPI_Comm comm,int keyval,void *attribute_val,int *flag);
141: extern int Petsc_MPI_Keyval_free(int*);
142: extern int Petsc_MPI_Attr_put(MPI_Comm,int,void *);
143: extern int Petsc_MPI_Attr_delete(MPI_Comm,int);
144: extern int Petsc_MPI_Keyval_create(MPI_Copy_function *,MPI_Delete_function *,int *,void *);
145: extern int Petsc_MPI_Comm_free(MPI_Comm*);
146: extern int Petsc_MPI_Initialized(int *);
147: extern int Petsc_MPI_Comm_dup(MPI_Comm,MPI_Comm *);
148: extern int Petsc_MPI_Finalize(void);
150: #define MPI_Abort Petsc_MPI_Abort
151: #define MPI_Attr_get Petsc_MPI_Attr_get
152: #define MPI_Keyval_free Petsc_MPI_Keyval_free
153: #define MPI_Attr_put Petsc_MPI_Attr_put
154: #define MPI_Attr_delete Petsc_MPI_Attr_delete
155: #define MPI_Keyval_create Petsc_MPI_Keyval_create
156: #define MPI_Comm_free Petsc_MPI_Comm_free
157: #define MPI_Initialized Petsc_MPI_Initialized
158: #define MPI_Comm_dup Petsc_MPI_Comm_dup
159: #define MPI_Finalize Petsc_MPI_Finalize
161: /*
162: Routines we have replace with macros that do nothing
163: Some return error codes others return success
164: */
166: #define MPI_Comm_f2c(comm) (MPI_Comm)(comm)
167: #define MPI_Comm_c2f(comm) (MPI_Fint)(comm)
170: #define MPI_Init(argc,argv)
171: (MPIUNI_TMP = (void*)(long) (argc),
172: MPIUNI_TMP = (void*)(long) (argv),
173: MPI_SUCCESS)
174: #define MPI_Send(buf,count,datatype,dest,tag,comm)
175: (MPIUNI_TMP = (void*)(long) (buf),
176: MPIUNI_TMP = (void*)(long) (count),
177: MPIUNI_TMP = (void*)(long) (datatype),
178: MPIUNI_TMP = (void*)(long) (dest),
179: MPIUNI_TMP = (void*)(long) (tag),
180: MPIUNI_TMP = (void*)(long) (comm),
181: MPI_SUCCESS)
182: #define MPI_Recv(buf,count,datatype,source,tag,comm,status)
183: (MPIUNI_TMP = (void*)(long) (buf),
184: MPIUNI_TMP = (void*)(long) (count),
185: MPIUNI_TMP = (void*)(long) (datatype),
186: MPIUNI_TMP = (void*)(long) (source),
187: MPIUNI_TMP = (void*)(long) (tag),
188: MPIUNI_TMP = (void*)(long) (comm),
189: MPIUNI_TMP = (void*)(long) (status),
190: MPI_Abort(MPI_COMM_WORLD,0))
191: #define MPI_Get_count(status, datatype,count)
192: (MPIUNI_TMP = (void*)(long) (status),
193: MPIUNI_TMP = (void*)(long) (datatype),
194: MPIUNI_TMP = (void*)(long) (count),
195: MPI_Abort(MPI_COMM_WORLD,0))
196: #define MPI_Bsend(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_Ssend(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_Rsend(buf,count, datatype,dest,tag,comm)
213: (MPIUNI_TMP = (void*)(long) (buf),
214: MPIUNI_TMP = (void*)(long) (count),
215: MPIUNI_TMP = (void*)(long) (datatype),
216: MPIUNI_TMP = (void*)(long) (dest),
217: MPIUNI_TMP = (void*)(long) (tag),
218: MPIUNI_TMP = (void*)(long) (comm),
219: MPI_SUCCESS)
220: #define MPI_Buffer_attach(buffer,size)
221: (MPIUNI_TMP = (void*)(long) (buffer),
222: MPIUNI_TMP = (void*)(long) (size),
223: MPI_SUCCESS)
224: #define MPI_Buffer_detach(buffer,size)
225: (MPIUNI_TMP = (void*)(long) (buffer),
226: MPIUNI_TMP = (void*)(long) (size),
227: MPI_SUCCESS)
228: #define MPI_Ibsend(buf,count, datatype,dest,tag,comm,request)
229: (MPIUNI_TMP = (void*)(long) (buf),
230: MPIUNI_TMP = (void*)(long) (count),
231: MPIUNI_TMP = (void*)(long) (datatype),
232: MPIUNI_TMP = (void*)(long) (dest),
233: MPIUNI_TMP = (void*)(long) (tag),
234: MPIUNI_TMP = (void*)(long) (comm),
235: MPIUNI_TMP = (void*)(long) (request),
236: MPI_SUCCESS)
237: #define MPI_Issend(buf,count, datatype,dest,tag,comm,request)
238: (MPIUNI_TMP = (void*)(long) (buf),
239: MPIUNI_TMP = (void*)(long) (count),
240: MPIUNI_TMP = (void*)(long) (datatype),
241: MPIUNI_TMP = (void*)(long) (dest),
242: MPIUNI_TMP = (void*)(long) (tag),
243: MPIUNI_TMP = (void*)(long) (comm),
244: MPIUNI_TMP = (void*)(long) (request),
245: MPI_SUCCESS)
246: #define MPI_Irsend(buf,count, datatype,dest,tag,comm,request)
247: (MPIUNI_TMP = (void*)(long) (buf),
248: MPIUNI_TMP = (void*)(long) (count),
249: MPIUNI_TMP = (void*)(long) (datatype),
250: MPIUNI_TMP = (void*)(long) (dest),
251: MPIUNI_TMP = (void*)(long) (tag),
252: MPIUNI_TMP = (void*)(long) (comm),
253: MPIUNI_TMP = (void*)(long) (request),
254: MPI_SUCCESS)
255: #define MPI_Irecv(buf,count, datatype,source,tag,comm,request)
256: (MPIUNI_TMP = (void*)(long) (buf),
257: MPIUNI_TMP = (void*)(long) (count),
258: MPIUNI_TMP = (void*)(long) (datatype),
259: MPIUNI_TMP = (void*)(long) (source),
260: MPIUNI_TMP = (void*)(long) (tag),
261: MPIUNI_TMP = (void*)(long) (comm),
262: MPIUNI_TMP = (void*)(long) (request),
263: MPI_Abort(MPI_COMM_WORLD,0))
264: #define MPI_Isend(buf,count, datatype,dest,tag,comm,request)
265: (MPIUNI_TMP = (void*)(long) (buf),
266: MPIUNI_TMP = (void*)(long) (count),
267: MPIUNI_TMP = (void*)(long) (datatype),
268: MPIUNI_TMP = (void*)(long) (dest),
269: MPIUNI_TMP = (void*)(long) (tag),
270: MPIUNI_TMP = (void*)(long) (comm),
271: MPIUNI_TMP = (void*)(long) (request),
272: MPI_Abort(MPI_COMM_WORLD,0))
273: #define MPI_Wait(request,status)
274: (MPIUNI_TMP = (void*)(long) (request),
275: MPIUNI_TMP = (void*)(long) (status),
276: MPI_SUCCESS)
277: #define MPI_Test(request,flag,status)
278: (MPIUNI_TMP = (void*)(long) (request),
279: MPIUNI_TMP = (void*)(long) (status),
280: *(flag) = 0,
281: MPI_SUCCESS)
282: #define MPI_Request_free(request)
283: (MPIUNI_TMP = (void*)(long) (request),
284: MPI_SUCCESS)
285: #define MPI_Waitany(a,b,c,d)
286: (MPIUNI_TMP = (void*)(long) (a),
287: MPIUNI_TMP = (void*)(long) (b),
288: MPIUNI_TMP = (void*)(long) (c),
289: MPIUNI_TMP = (void*)(long) (d),
290: MPI_SUCCESS)
291: #define MPI_Testany(a,b,c,d,e)
292: (MPIUNI_TMP = (void*)(long) (a),
293: MPIUNI_TMP = (void*)(long) (b),
294: MPIUNI_TMP = (void*)(long) (c),
295: MPIUNI_TMP = (void*)(long) (d),
296: MPIUNI_TMP = (void*)(long) (e),
297: MPI_SUCCESS)
298: #define MPI_Waitall(count,array_of_requests,array_of_statuses)
299: (MPIUNI_TMP = (void*)(long) (count),
300: MPIUNI_TMP = (void*)(long) (array_of_requests),
301: MPIUNI_TMP = (void*)(long) (array_of_statuses),
302: MPI_SUCCESS)
303: #define MPI_Testall(count,array_of_requests,flag,array_of_statuses)
304: (MPIUNI_TMP = (void*)(long) (count),
305: MPIUNI_TMP = (void*)(long) (array_of_requests),
306: MPIUNI_TMP = (void*)(long) (flag),
307: MPIUNI_TMP = (void*)(long) (array_of_statuses),
308: MPI_SUCCESS)
309: #define MPI_Waitsome(incount,array_of_requests,outcount,
310: array_of_indices,array_of_statuses)
311: (MPIUNI_TMP = (void*)(long) (incount),
312: MPIUNI_TMP = (void*)(long) (array_of_requests),
313: MPIUNI_TMP = (void*)(long) (outcount),
314: MPIUNI_TMP = (void*)(long) (array_of_indices),
315: MPIUNI_TMP = (void*)(long) (array_of_statuses),
316: MPI_SUCCESS)
317: #define MPI_Comm_group(comm,group)
318: (MPIUNI_TMP = (void*)(long) (comm),
319: MPIUNI_TMP = (void*)(long) (group),
320: MPI_SUCCESS)
321: #define MPI_Group_incl(group,n,ranks,newgroup)
322: (MPIUNI_TMP = (void*)(long) (group),
323: MPIUNI_TMP = (void*)(long) (n),
324: MPIUNI_TMP = (void*)(long) (ranks),
325: MPIUNI_TMP = (void*)(long) (newgroup),
326: MPI_SUCCESS)
327: #define MPI_Testsome(incount,array_of_requests,outcount,
328: array_of_indices,array_of_statuses) MPI_SUCCESS
329: #define MPI_Iprobe(source,tag,comm,flag,status) (*(flag)=0, MPI_SUCCESS)
330: #define MPI_Probe(source,tag,comm,status) MPI_SUCCESS
331: #define MPI_Cancel(request) (MPIUNI_TMP = (void*)(long) (request),MPI_SUCCESS)
332: #define MPI_Test_cancelled(status,flag) (*(flag)=0,MPI_SUCCESS)
333: #define MPI_Send_init(buf,count, datatype,dest,tag,comm,request)
334: (MPIUNI_TMP = (void*)(long) (buf),
335: MPIUNI_TMP = (void*)(long) (count),
336: MPIUNI_TMP = (void*)(long) (datatype),
337: MPIUNI_TMP = (void*)(long) (dest),
338: MPIUNI_TMP = (void*)(long) (tag),
339: MPIUNI_TMP = (void*)(long) (comm),
340: MPIUNI_TMP = (void*)(long) (request),
341: MPI_SUCCESS)
342: #define MPI_Bsend_init(buf,count, datatype,dest,tag,comm,request)
343: (MPIUNI_TMP = (void*)(long) (buf),
344: MPIUNI_TMP = (void*)(long) (count),
345: MPIUNI_TMP = (void*)(long) (datatype),
346: MPIUNI_TMP = (void*)(long) (dest),
347: MPIUNI_TMP = (void*)(long) (tag),
348: MPIUNI_TMP = (void*)(long) (comm),
349: MPIUNI_TMP = (void*)(long) (request),
350: MPI_SUCCESS)
351: #define MPI_Ssend_init(buf,count, datatype,dest,tag,comm,request)
352: (MPIUNI_TMP = (void*)(long) (buf),
353: MPIUNI_TMP = (void*)(long) (count),
354: MPIUNI_TMP = (void*)(long) (datatype),
355: MPIUNI_TMP = (void*)(long) (dest),
356: MPIUNI_TMP = (void*)(long) (tag),
357: MPIUNI_TMP = (void*)(long) (comm),
358: MPIUNI_TMP = (void*)(long) (request),
359: MPI_SUCCESS)
360: #define MPI_Bsend_init(buf,count, datatype,dest,tag,comm,request)
361: (MPIUNI_TMP = (void*)(long) (buf),
362: MPIUNI_TMP = (void*)(long) (count),
363: MPIUNI_TMP = (void*)(long) (datatype),
364: MPIUNI_TMP = (void*)(long) (dest),
365: MPIUNI_TMP = (void*)(long) (tag),
366: MPIUNI_TMP = (void*)(long) (comm),
367: MPIUNI_TMP = (void*)(long) (request),
368: MPI_SUCCESS)
369: #define MPI_Rsend_init(buf,count, datatype,dest,tag,comm,request)
370: (MPIUNI_TMP = (void*)(long) (buf),
371: MPIUNI_TMP = (void*)(long) (count),
372: MPIUNI_TMP = (void*)(long) (datatype),
373: MPIUNI_TMP = (void*)(long) (dest),
374: MPIUNI_TMP = (void*)(long) (tag),
375: MPIUNI_TMP = (void*)(long) (comm),
376: MPIUNI_TMP = (void*)(long) (request),
377: MPI_SUCCESS)
378: #define MPI_Recv_init(buf,count, datatype,source,tag,comm,request)
379: (MPIUNI_TMP = (void*)(long) (buf),
380: MPIUNI_TMP = (void*)(long) (count),
381: MPIUNI_TMP = (void*)(long) (datatype),
382: MPIUNI_TMP = (void*)(long) (source),
383: MPIUNI_TMP = (void*)(long) (tag),
384: MPIUNI_TMP = (void*)(long) (comm),
385: MPIUNI_TMP = (void*)(long) (request),
386: MPI_SUCCESS)
387: #define MPI_Start(request) (MPIUNI_TMP = (void*)(long) (request),MPI_SUCCESS)
388: #define MPI_Startall(count,array_of_requests)
389: (MPIUNI_TMP = (void*)(long) (count),
390: MPIUNI_TMP = (void*)(long) (array_of_requests),
391: MPI_SUCCESS)
392: #define MPI_Op_create(function,commute,op)
393: (MPIUNI_TMP = (void*)(long) (function),
394: MPIUNI_TMP = (void*)(long) (commute),
395: MPIUNI_TMP = (void*)(long) (op),
396: MPI_SUCCESS)
397: #define MPI_Op_free(op)
398: (MPIUNI_TMP = (void*)(long) (op),
399: MPI_SUCCESS)
400: /* Need to determine sizeof "sendtype" */
401: #define MPI_Sendrecv(sendbuf,sendcount, sendtype,
402: dest,sendtag,recvbuf,recvcount,
403: recvtype,source,recvtag,
404: comm,status)
405: MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount) * (sendtype))
406: #define MPI_Sendrecv_replace(buf,count, datatype,dest,sendtag,
407: source,recvtag,comm,status) MPI_SUCCESS
408: #define MPI_Type_contiguous(count, oldtype,newtype)
409: (*(newtype) = (count)*(oldtype),MPI_SUCCESS)
410: #define MPI_Type_vector(count,blocklength,stride,oldtype, newtype) MPI_SUCCESS
411: #define MPI_Type_hvector(count,blocklength,stride,oldtype, newtype) MPI_SUCCESS
412: #define MPI_Type_indexed(count,array_of_blocklengths,
413: array_of_displacements, oldtype,
414: newtype) MPI_SUCCESS
415: #define MPI_Type_hindexed(count,array_of_blocklengths,
416: array_of_displacements, oldtype,
417: newtype) MPI_SUCCESS
418: #define MPI_Type_struct(count,array_of_blocklengths,
419: array_of_displacements,
420: array_of_types, newtype) MPI_SUCCESS
421: #define MPI_Address(location,address)
422: (*(address) = (long)(char *)(location),MPI_SUCCESS)
423: #define MPI_Type_extent(datatype,extent)
424: MPI_Abort(MPI_COMM_WORLD,0)
425: #define MPI_Type_size(datatype,size)
426: MPI_Abort(MPI_COMM_WORLD,0)
427: #define MPI_Type_lb(datatype,displacement)
428: MPI_Abort(MPI_COMM_WORLD,0)
429: #define MPI_Type_ub(datatype,displacement)
430: MPI_Abort(MPI_COMM_WORLD,0)
431: #define MPI_Type_commit(datatype) (MPIUNI_TMP = (void*)(long) (datatype),
432: MPI_SUCCESS)
433: #define MPI_Type_free(datatype) MPI_SUCCESS
434: #define MPI_Get_elements(status, datatype,count)
435: MPI_Abort(MPI_COMM_WORLD,0)
436: #define MPI_Pack(inbuf,incount, datatype,outbuf,
437: outsize,position, comm)
438: MPI_Abort(MPI_COMM_WORLD,0)
439: #define MPI_Unpack(inbuf,insize,position,outbuf,
440: outcount, datatype,comm)
441: MPI_Abort(MPI_COMM_WORLD,0)
442: #define MPI_Pack_size(incount, datatype,comm,size)
443: MPI_Abort(MPI_COMM_WORLD,0)
444: #define MPI_Barrier(comm)
445: (MPIUNI_TMP = (void*)(long) (comm),
446: MPI_SUCCESS)
447: #define MPI_Bcast(buffer,count,datatype,root,comm)
448: (MPIUNI_TMP = (void*)(long) (buffer),
449: MPIUNI_TMP = (void*)(long) (count),
450: MPIUNI_TMP = (void*)(long) (datatype),
451: MPIUNI_TMP = (void*)(long) (comm),
452: MPI_SUCCESS)
453: #define MPI_Gather(sendbuf,sendcount, sendtype,
454: recvbuf,recvcount, recvtype,
455: root,comm)
456: (MPIUNI_TMP = (void*)(long) (recvcount),
457: MPIUNI_TMP = (void*)(long) (root),
458: MPIUNI_TMP = (void*)(long) (recvtype),
459: MPIUNI_TMP = (void*)(long) (comm),
460: MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)),
461: MPI_SUCCESS)
462: #define MPI_Gatherv(sendbuf,sendcount, sendtype,
463: recvbuf,recvcounts,displs,
464: recvtype,root,comm)
465: (MPIUNI_TMP = (void*)(long) (recvcounts),
466: MPIUNI_TMP = (void*)(long) (displs),
467: MPIUNI_TMP = (void*)(long) (recvtype),
468: MPIUNI_TMP = (void*)(long) (root),
469: MPIUNI_TMP = (void*)(long) (comm),
470: MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)),
471: MPI_SUCCESS)
472: #define MPI_Scatter(sendbuf,sendcount, sendtype,
473: recvbuf,recvcount, recvtype,
474: root,comm)
475: (MPIUNI_TMP = (void*)(long) (sendbuf),
476: MPIUNI_TMP = (void*)(long) (sendcount),
477: MPIUNI_TMP = (void*)(long) (sendtype),
478: MPIUNI_TMP = (void*)(long) (recvbuf),
479: MPIUNI_TMP = (void*)(long) (recvcount),
480: MPIUNI_TMP = (void*)(long) (recvtype),
481: MPIUNI_TMP = (void*)(long) (root),
482: MPIUNI_TMP = (void*)(long) (comm),MPI_Abort(MPI_COMM_WORLD,0))
483: #define MPI_Scatterv(sendbuf,sendcounts,displs,
484: sendtype, recvbuf,recvcount,
485: recvtype,root,comm)
486: (MPIUNI_TMP = (void*)(long) (sendbuf),
487: MPIUNI_TMP = (void*)(long) (sendcounts),
488: MPIUNI_TMP = (void*)(long) (displs),
489: MPIUNI_TMP = (void*)(long) (sendtype),
490: MPIUNI_TMP = (void*)(long) (recvbuf),
491: MPIUNI_TMP = (void*)(long) (recvcount),
492: MPIUNI_TMP = (void*)(long) (recvtype),
493: MPIUNI_TMP = (void*)(long) (root),
494: MPIUNI_TMP = (void*)(long) (comm),MPI_Abort(MPI_COMM_WORLD,0))
495: #define MPI_Allgather(sendbuf,sendcount, sendtype,
496: recvbuf,recvcount, recvtype,comm)
497: (MPIUNI_TMP = (void*)(long) (recvcount),
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_Allgatherv(sendbuf,sendcount, sendtype,
503: recvbuf,recvcounts,displs,recvtype,comm)
504: (MPIUNI_TMP = (void*)(long) (recvcounts),
505: MPIUNI_TMP = (void*)(long) (displs),
506: MPIUNI_TMP = (void*)(long) (recvtype),
507: MPIUNI_TMP = (void*)(long) (comm),
508: MPIUNI_Memcpy(recvbuf,sendbuf,(sendcount)* (sendtype)),
509: MPI_SUCCESS)
510: #define MPI_Alltoall(sendbuf,sendcount, sendtype,
511: recvbuf,recvcount, recvtype,
512: comm) MPI_Abort(MPI_COMM_WORLD,0)
513: #define MPI_Alltoallv(sendbuf,sendcounts,sdispls,
514: sendtype, recvbuf,recvcounts,
515: rdispls, recvtype,comm) MPI_Abort(MPI_COMM_WORLD,0)
516: #define MPI_Reduce(sendbuf, recvbuf,count,
517: datatype,op,root,comm)
518: (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)),
519: MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
520: #define MPI_Allreduce(sendbuf, recvbuf,count,datatype,op,comm)
521: (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)),
522: MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
523: #define MPI_Scan(sendbuf, recvbuf,count,datatype,op,comm)
524: (MPIUNI_Memcpy(recvbuf,sendbuf,(count)*(datatype)),
525: MPIUNI_TMP = (void*)(long) (comm),MPI_SUCCESS)
526: #define MPI_Reduce_scatter(sendbuf, recvbuf,recvcounts,
527: datatype,op,comm)
528: MPI_Abort(MPI_COMM_WORLD,0)
529: #define MPI_Group_size(group,size) (*(size)=1,MPI_SUCCESS)
530: #define MPI_Group_rank(group,rank) (*(rank)=0,MPI_SUCCESS)
531: #define MPI_Group_translate_ranks (group1,n,ranks1,
532: group2,ranks2) MPI_Abort(MPI_COMM_WORLD,0)
533: #define MPI_Group_compare(group1,group2,result)
534: (*(result)=1,MPI_SUCCESS)
535: #define MPI_Group_union(group1,group2,newgroup) MPI_SUCCESS
536: #define MPI_Group_intersection(group1,group2,newgroup) MPI_SUCCESS
537: #define MPI_Group_difference(group1,group2,newgroup) MPI_SUCCESS
538: #define MPI_Group_excl(group,n,ranks,newgroup) MPI_SUCCESS
539: #define MPI_Group_range_incl(group,n,ranges,newgroup) MPI_SUCCESS
540: #define MPI_Group_range_excl(group,n,ranges,newgroup) MPI_SUCCESS
541: #define MPI_Group_free(group)
542: (MPIUNI_TMP = (void*)(long) (group),
543: MPI_SUCCESS)
544: #define MPI_Comm_size(comm,size)
545: (MPIUNI_TMP = (void*)(long) (comm),
546: *(size)=1,
547: MPI_SUCCESS)
548: #define MPI_Comm_rank(comm,rank)
549: (MPIUNI_TMP = (void*)(long) (comm),
550: *(rank)=0,
551: MPI_SUCCESS)
552: #define MPI_Comm_compare(comm1,comm2,result)
553: (MPIUNI_TMP = (void*)(long) (comm1),
554: MPIUNI_TMP = (void*)(long) (comm2),
555: *(result)=MPI_IDENT,
556: MPI_SUCCESS)
557: #define MPI_Comm_create(comm,group,newcomm)
558: (*(newcomm) = (comm),
559: MPIUNI_TMP = (void*)(long) (group),
560: MPI_SUCCESS)
561: #define MPI_Comm_split(comm,color,key,newcomm) MPI_SUCCESS
562: #define MPI_Comm_test_inter(comm,flag) (*(flag)=1,MPI_SUCCESS)
563: #define MPI_Comm_remote_size(comm,size) (*(size)=1,MPI_SUCCESS)
564: #define MPI_Comm_remote_group(comm,group) MPI_SUCCESS
565: #define MPI_Intercomm_create(local_comm,local_leader,peer_comm,
566: remote_leader,tag,newintercomm) MPI_SUCCESS
567: #define MPI_Intercomm_merge(intercomm,high,newintracomm) MPI_SUCCESS
569: #define MPI_Topo_test(comm,status) MPI_SUCCESS
570: #define MPI_Cart_create(comm_old,ndims,dims,periods,
571: reorder,comm_cart) MPI_SUCCESS
572: #define MPI_Dims_create(nnodes,ndims,dims) MPI_Abort(MPI_COMM_WORLD,0)
573: #define MPI_Graph_create(comm,a,b,c,d,e) MPI_SUCCESS
574: #define MPI_Graphdims_Get(comm,nnodes,nedges) MPI_Abort(MPI_COMM_WORLD,0)
575: #define MPI_Graph_get(comm,a,b,c,d) MPI_Abort(MPI_COMM_WORLD,0)
576: #define MPI_Cartdim_get(comm,ndims) MPI_Abort(MPI_COMM_WORLD,0)
577: #define MPI_Cart_get(comm,maxdims,dims,periods,coords)
578: MPI_Abort(MPI_COMM_WORLD,0)
579: #define MPI_Cart_rank(comm,coords,rank) MPI_Abort(MPI_COMM_WORLD,0)
580: #define MPI_Cart_coords(comm,rank,maxdims,coords)
581: MPI_Abort(MPI_COMM_WORLD,0)
582: #define MPI_Graph_neighbors_count(comm,rank,nneighbors)
583: MPI_Abort(MPI_COMM_WORLD,0)
584: #define MPI_Graph_neighbors(comm,rank,maxneighbors,neighbors)
585: MPI_Abort(MPI_COMM_WORLD,0)
586: #define MPI_Cart_shift(comm,direction,disp,rank_source,rank_dest)
587: MPI_Abort(MPI_COMM_WORLD,0)
588: #define MPI_Cart_sub(comm,remain_dims,newcomm) MPI_Abort(MPI_COMM_WORLD,0)
589: #define MPI_Cart_map(comm,ndims,dims,periods,newrank) MPI_Abort(MPI_COMM_WORLD,0)
590: #define MPI_Graph_map(comm,a,b,c,d) MPI_Abort(MPI_COMM_WORLD,0)
591: #define MPI_Get_processor_name(name,result_len)
592: (MPIUNI_Memcpy(name,"localhost",9*sizeof(char)),name[10] = 0,*(result_len) = 10)
593: #define MPI_Errhandler_create(function,errhandler)
594: (MPIUNI_TMP = (void*)(long) (errhandler),
595: MPI_SUCCESS)
596: #define MPI_Errhandler_set(comm,errhandler)
597: (MPIUNI_TMP = (void*)(long) (comm),
598: MPIUNI_TMP = (void*)(long) (errhandler),
599: MPI_SUCCESS)
600: #define MPI_Errhandler_get(comm,errhandler) MPI_SUCCESS
601: #define MPI_Errhandler_free(errhandler) MPI_SUCCESS
602: #define MPI_Error_string(errorcode,string,result_len) MPI_SUCCESS
603: #define MPI_Error_class(errorcode,errorclass) MPI_SUCCESS
604: #define MPI_Wtick() 1.0
605: #define MPI_Wtime() 0.0
606: #define MPI_Pcontrol(level) MPI_SUCCESS
608: #define MPI_NULL_COPY_FN 0
609: #define MPI_NULL_DELETE_FN 0
611: #endif