N-sim
Emulation and simulation of
Wireless Sensor Networks



   Home


   Project Page


   Download


   CVS



   Installation


   Configuration


   Plug-ins




 Hosted by
SourceForge.net Logo

/home/brennan/n-sim/OrbisQuartus/shared/mini_mpi.h

Go to the documentation of this file.
00001 
00014 /*
00015  * Copyright 2007. Los Alamos National Security, LLC. This material
00016  * was produced under U.S. Government contract DE-AC52-06NA25396 for
00017  * Los Alamos National Laboratory (LANL), which is operated by Los
00018  * Alamos National Security, LLC, for the Department of Energy. The
00019  * U.S. Government has rights to use, reproduce, and distribute this
00020  * software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY,
00021  * LLC, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL
00022  * LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to
00023  * produce derivative works, such modified software should be clearly
00024  * marked, so as not to confuse it with the version available from LANL.
00025  *
00026  * Additionally, this program is free software; you can redistribute
00027  * it and/or modify it under the terms of the GNU General Public
00028  * License as published by the Free Software Foundation; version 2 of
00029  * the License. Accordingly, this program is distributed in the hope
00030  * it will be useful, but WITHOUT ANY WARRANTY; without even the
00031  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00032  * PURPOSE. See the GNU General Public License for more details.
00033  */
00034 
00035 
00036 #ifndef _MINI_MPI_H_
00037 #define _MINI_MPI_H_
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif
00042 
00043 
00044 #define MPI_INIT_PORT       6851
00045 #define MPI_PORT            6853
00046 
00047 #define MPI_MSG_LEN         2048
00048 
00049 #define MPI_Comm            int
00050 #define MPI_COMM_WORLD      0x001
00051 
00052 #define MPI_Datatype        int
00053 #define MPI_CHAR            0x010
00054 #define MPI_SHORT           0x011
00055 #define MPI_INT             0x012
00056 #define MPI_LONG            0x013
00057 #define MPI_UNSIGNED_CHAR   0x014
00058 #define MPI_UNSIGNED_SHORT  0x015
00059 #define MPI_UNSIGNED_INT    0x016
00060 #define MPI_UNSIGNED_LONG   0x017
00061 #define MPI_FLOAT           0x018
00062 #define MPI_DOUBLE          0x019
00063 #define MPI_LONG_DOUBLE     0x020
00064 #define MPI_BYTE            0x021
00065 #define MPI_PACKED          0x022
00066 
00067 #define MPI_Status          int
00068 #define MPI_SUCCESS         0x100
00069 
00070 #define MPI_Request         int
00071 
00072 /* management routines */
00073 int MPI_Init(int *argc, char ***argv);
00074 int MPI_Initialized(int *flag);
00075 int MPI_Comm_size(MPI_Comm comm, int *size);
00076 int MPI_Comm_rank(MPI_Comm comm, int *rank);
00077 int MPI_Abort(MPI_Comm, int errorcode);
00078 int MPI_Finalize(void);
00079 
00080 /* blocking point-to-point comm */
00081 int MPI_Send(void *buf, int count, MPI_Datatype type, int dest,
00082              int tag, MPI_Comm comm);
00083 int MPI_Recv(void *buf, int count, MPI_Datatype type, int source,
00084              int tag, MPI_Comm comm, MPI_Status *status);
00085 
00086 /* nonblocking point-to-point comm */
00087 int MPI_Isend(void *buf, int count, MPI_Datatype type, int dest,
00088               int tag, MPI_Comm comm, MPI_Request *request);
00089 int MPI_Irecv(void *buf, int count, MPI_Datatype type, int source,
00090               int tag, MPI_Comm comm, MPI_Request *request);
00091 int MPI_Wait(MPI_Request *request, MPI_Status *status);
00092 int MPI_Waitall(int count, MPI_Request *request[], MPI_Status *status[]);
00093 
00094 /* collective comm */
00095 int MPI_Barrier(MPI_Comm comm);
00096 int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype,
00097               int root, MPI_Comm comm);
00098 int MPI_Scatter(void *sendbuffer, int sendcount, MPI_Datatype sendtype,
00099                 void *recvbuffer, int recvcount, MPI_Datatype recvtype,
00100                 int root, MPI_Comm comm);
00101 int MPI_Gather(void *sendbuffer, int sendcount, MPI_Datatype sendtype,
00102                 void *recvbuffer, int recvcount, MPI_Datatype recvtype,
00103                 int root, MPI_Comm comm);
00104 
00105 /* not MPI standard */
00106 int MPI_Comm_socket(MPI_Comm comm, int *sock);
00107 
00108 
00109 /* mini-mpi implementation */
00110 #define MINI_MPI_INIT    0x200
00111 #define MINI_MPI_HEAD    0x201
00112 #define MINI_MPI_ABORT   0x204
00113 #define MINI_MPI_FINAL   0x205
00114 #define MINI_MPI_BARRIER 0x207
00115 #define MINI_MPI_RESUME  0x208
00116 #define MINI_MPI_SEND    0x210
00117 #define MINI_MPI_RECV    0x211
00118 #define MINI_MPI_SCATTER 0x215
00119 #define MINI_MPI_GATHER  0x216
00120 
00121 
00122 #ifdef __cplusplus
00123 }
00124 #endif
00125 
00126 #endif  // _MINI_MPI_H_


© 2007, Los Alamos National Security, LLC.