Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Skeleton for MPI_IO
[simgrid.git] / include / smpi / smpi.h
index cc9755f..4bd6284 100644 (file)
@@ -180,8 +180,8 @@ enum ERROR_ENUM {
 #define MPI_COMM_TYPE_SHARED    1
 #define MPI_WIN_NULL ((MPI_Win)NULL)
 
-#define MPI_VERSION 2
-#define MPI_SUBVERSION 2
+#define MPI_VERSION 3
+#define MPI_SUBVERSION 1
 #define MPI_UNWEIGHTED      (int *)0
 #define MPI_ARGV_NULL (char **)0
 #define MPI_ARGVS_NULL (char ***)0
@@ -212,11 +212,9 @@ enum ERROR_ENUM {
 
 typedef ptrdiff_t MPI_Aint;
 typedef long long MPI_Offset;
+typedef long long MPI_Count;
 
-struct s_MPI_File;
-typedef struct s_MPI_File *MPI_File;
-
-
+typedef SMPI_File *MPI_File;
 typedef SMPI_Datatype *MPI_Datatype;
 
 typedef struct {
@@ -292,9 +290,7 @@ XBT_PUBLIC_DATA const MPI_Datatype MPI_INTEGER4;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_INTEGER8;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_INTEGER16;
 
-//for now we only send int values at max
-#define MPI_Count int
-#define MPI_COUNT MPI_INT
+XBT_PUBLIC_DATA const MPI_Datatype MPI_COUNT;
 
 //defines for fortran compatibility
 #if defined(__alpha__) || defined(__sparc64__) || defined(__x86_64__) || defined(__ia64__)
@@ -392,6 +388,9 @@ typedef void MPI_Type_delete_attr_function_fort(MPI_Datatype type, int keyval, v
 typedef void MPI_Win_copy_attr_function_fort(MPI_Win win, int keyval, void* extra_state, void* attribute_val_in,
                               void* attribute_val_out, int* flag, int* ierr);
 typedef void MPI_Win_delete_attr_function_fort(MPI_Win win, int keyval, void* attribute_val, void* extra_state, int* ierr);
+typedef int MPI_Grequest_query_function(void *extra_state, MPI_Status *status);
+typedef int MPI_Grequest_free_function(void *extra_state);
+typedef int MPI_Grequest_cancel_function(void *extra_state, int complete);
 #define MPI_COMM_NULL_COPY_FN ((MPI_Comm_copy_attr_function*)0)
 #define MPI_COMM_NULL_DELETE_FN ((MPI_Comm_delete_attr_function*)0)
 #define MPI_TYPE_NULL_COPY_FN ((MPI_Type_copy_attr_function*)0)
@@ -632,6 +631,9 @@ MPI_CALL(XBT_PUBLIC int, MPI_Alltoall, (void* sendbuf, int sendcount, MPI_Dataty
 MPI_CALL(XBT_PUBLIC int, MPI_Alltoallv,
          (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
           int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm));
+MPI_CALL(XBT_PUBLIC int, MPI_Alltoallw,
+         (void* sendbuf, int* sendcnts, int* sdispls, MPI_Datatype* sendtypes, void* recvbuf, int* recvcnts,
+          int* rdispls, MPI_Datatype* recvtypes, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC int, MPI_Reduce_local, (void* inbuf, void* inoutbuf, int count, MPI_Datatype datatype, MPI_Op op));
 
 MPI_CALL(XBT_PUBLIC int, MPI_Info_create, (MPI_Info * info));
@@ -725,6 +727,13 @@ MPI_CALL(XBT_PUBLIC int, MPI_Cart_shift, (MPI_Comm comm, int direction, int disp
 MPI_CALL(XBT_PUBLIC int, MPI_Cart_sub, (MPI_Comm comm, int* remain_dims, MPI_Comm* comm_new));
 MPI_CALL(XBT_PUBLIC int, MPI_Cartdim_get, (MPI_Comm comm, int* ndims));
 MPI_CALL(XBT_PUBLIC int, MPI_Dims_create, (int nnodes, int ndims, int* dims));
+MPI_CALL(XBT_PUBLIC int, MPI_Request_get_status, (MPI_Request request, int* flag, MPI_Status* status));
+MPI_CALL(XBT_PUBLIC int, MPI_Grequest_start,
+         (MPI_Grequest_query_function * query_fn, MPI_Grequest_free_function* free_fn,
+          MPI_Grequest_cancel_function* cancel_fn, void* extra_state, MPI_Request* request));
+MPI_CALL(XBT_PUBLIC int, MPI_Grequest_complete, (MPI_Request request));
+MPI_CALL(XBT_PUBLIC int, MPI_Status_set_cancelled, (MPI_Status * status, int flag));
+MPI_CALL(XBT_PUBLIC int, MPI_Status_set_elements, (MPI_Status * status, MPI_Datatype datatype, int count));
 
 //FIXME: these are not yet implemented
 
@@ -757,9 +766,6 @@ typedef void* MPI_Errhandler;
 typedef void MPI_Comm_errhandler_function(MPI_Comm *, int *, ...);
 typedef void MPI_File_errhandler_function(MPI_File *, int *, ...);
 typedef void MPI_Win_errhandler_function(MPI_Win *, int *, ...);
-typedef int MPI_Grequest_query_function(void *extra_state, MPI_Status *status);
-typedef int MPI_Grequest_free_function(void *extra_state);
-typedef int MPI_Grequest_cancel_function(void *extra_state, int complete);
 #define MPI_DUP_FN 1
 
 #define MPI_WIN_DUP_FN ((MPI_Win_copy_attr_function*)MPI_DUP_FN)
@@ -768,7 +774,7 @@ typedef int MPI_Grequest_cancel_function(void *extra_state, int complete);
 typedef MPI_Comm_errhandler_function MPI_Comm_errhandler_fn;
 typedef MPI_File_errhandler_function MPI_File_errhandler_fn;
 typedef MPI_Win_errhandler_function MPI_Win_errhandler_fn;
-#define MPI_INFO_ENV 1
+#define MPI_INFO_ENV smpi_process_info_env()
 XBT_PUBLIC_DATA const MPI_Datatype MPI_PACKED;
 XBT_PUBLIC_DATA MPI_Errhandler* MPI_ERRORS_RETURN;
 XBT_PUBLIC_DATA MPI_Errhandler* MPI_ERRORS_ARE_FATAL;
@@ -838,9 +844,6 @@ MPI_CALL(XBT_PUBLIC int, MPI_Type_create_subarray,
          (int ndims, int* array_of_sizes, int* array_of_subsizes, int* array_of_starts, int order, MPI_Datatype oldtype,
           MPI_Datatype* newtype));
 MPI_CALL(XBT_PUBLIC int, MPI_Type_match_size, (int typeclass, int size, MPI_Datatype* datatype));
-MPI_CALL(XBT_PUBLIC int, MPI_Alltoallw,
-         (void* sendbuf, int* sendcnts, int* sdispls, MPI_Datatype* sendtypes, void* recvbuf, int* recvcnts,
-          int* rdispls, MPI_Datatype* recvtypes, MPI_Comm comm));
 MPI_CALL(XBT_PUBLIC int, MPI_Comm_set_info, (MPI_Comm comm, MPI_Info info));
 MPI_CALL(XBT_PUBLIC int, MPI_Comm_get_info, (MPI_Comm comm, MPI_Info* info));
 MPI_CALL(XBT_PUBLIC int, MPI_Comm_dup_with_info, (MPI_Comm comm, MPI_Info info, MPI_Comm* newcomm));
@@ -848,13 +851,6 @@ MPI_CALL(XBT_PUBLIC int, MPI_Comm_split_type,
          (MPI_Comm comm, int split_type, int key, MPI_Info info, MPI_Comm* newcomm));
 MPI_CALL(XBT_PUBLIC int, MPI_Comm_connect,
          (char* port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm* newcomm));
-MPI_CALL(XBT_PUBLIC int, MPI_Request_get_status, (MPI_Request request, int* flag, MPI_Status* status));
-MPI_CALL(XBT_PUBLIC int, MPI_Grequest_start,
-         (MPI_Grequest_query_function * query_fn, MPI_Grequest_free_function* free_fn,
-          MPI_Grequest_cancel_function* cancel_fn, void* extra_state, MPI_Request* request));
-MPI_CALL(XBT_PUBLIC int, MPI_Grequest_complete, (MPI_Request request));
-MPI_CALL(XBT_PUBLIC int, MPI_Status_set_cancelled, (MPI_Status * status, int flag));
-MPI_CALL(XBT_PUBLIC int, MPI_Status_set_elements, (MPI_Status * status, MPI_Datatype datatype, int count));
 MPI_CALL(XBT_PUBLIC int, MPI_Unpublish_name, (char* service_name, MPI_Info info, char* port_name));
 MPI_CALL(XBT_PUBLIC int, MPI_Publish_name, (char* service_name, MPI_Info info, char* port_name));
 MPI_CALL(XBT_PUBLIC int, MPI_Lookup_name, (char* service_name, MPI_Info info, char* port_name));
@@ -966,6 +962,7 @@ MPI_CALL(XBT_PUBLIC int, MPI_File_sync, (MPI_File fh));
 // smpi functions
 XBT_PUBLIC int smpi_global_size();
 XBT_PUBLIC MPI_Comm smpi_process_comm_self();
+XBT_PUBLIC MPI_Info smpi_process_info_env();
 XBT_PUBLIC void* smpi_process_get_user_data();
 XBT_PUBLIC void smpi_process_set_user_data(void*);