Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
First works on the datatypes. Still missing a lot.
[simgrid.git] / include / smpi / smpi.h
index 99e7074..0c6d952 100644 (file)
@@ -16,6 +16,9 @@
 #include <stddef.h>
 #include <xbt/misc.h>
 #include <xbt/function_types.h>
+#include "simgrid/datatypes.h"
+
+#include "include/smpi/forward.hpp"
 
 #ifdef _WIN32
 #define MPI_CALL(type,name,args) \
@@ -175,8 +178,8 @@ SG_BEGIN_DECL()
 #define MPI_COMM_TYPE_SHARED    1
 #define MPI_WIN_NULL ((MPI_Win)NULL)
 
-#define MPI_VERSION 1
-#define MPI_SUBVERSION 1
+#define MPI_VERSION 2
+#define MPI_SUBVERSION 2
 #define MPI_UNWEIGHTED      (int *)0
 #define MPI_ARGV_NULL (char **)0
 #define MPI_ARGVS_NULL (char ***)0
@@ -235,8 +238,8 @@ typedef long long MPI_Offset;
 struct s_MPI_File;
 typedef struct s_MPI_File *MPI_File;
 
-struct s_smpi_mpi_datatype;
-typedef struct s_smpi_mpi_datatype *MPI_Datatype;
+
+typedef SMPI_Datatype *MPI_Datatype;
 
 typedef struct {
   int MPI_SOURCE;
@@ -245,8 +248,7 @@ typedef struct {
   int count;
 } MPI_Status;
 
-struct s_smpi_mpi_win;
-typedef struct s_smpi_mpi_win* MPI_Win;
+typedef SMPI_Win* MPI_Win;
 struct s_smpi_mpi_info;
 typedef struct s_smpi_mpi_info *MPI_Info;
 
@@ -341,8 +343,7 @@ XBT_PUBLIC_DATA( const MPI_Datatype ) MPI_INTEGER16;
 #define MPI_2DOUBLE_PRECISION MPI_2DOUBLE
 
 typedef void MPI_User_function(void *invec, void *inoutvec, int *len, MPI_Datatype * datatype);
-struct s_smpi_mpi_op;
-typedef struct s_smpi_mpi_op *MPI_Op;
+typedef SMPI_Op *MPI_Op;
 
 #define MPI_OP_NULL ((MPI_Op)NULL)
 XBT_PUBLIC_DATA( MPI_Op ) MPI_MAX;
@@ -360,25 +361,21 @@ XBT_PUBLIC_DATA( MPI_Op ) MPI_BXOR;
 //For accumulate
 XBT_PUBLIC_DATA( MPI_Op ) MPI_REPLACE;
 
-struct s_smpi_mpi_topology;
-typedef struct s_smpi_mpi_topology *MPI_Topology;
-                                   
-struct s_smpi_mpi_group;
-typedef struct s_smpi_mpi_group *MPI_Group;
+typedef SMPI_Topology *MPI_Topology;
+
+typedef SMPI_Group* MPI_Group;
 
 #define MPI_GROUP_NULL ((MPI_Group)NULL)
 
 XBT_PUBLIC_DATA( MPI_Group ) MPI_GROUP_EMPTY;
 
-struct s_smpi_mpi_communicator;
-typedef struct s_smpi_mpi_communicator *MPI_Comm;
+typedef SMPI_Comm *MPI_Comm;
 
 #define MPI_COMM_NULL ((MPI_Comm)NULL)
 XBT_PUBLIC_DATA( MPI_Comm ) MPI_COMM_WORLD;
 #define MPI_COMM_SELF smpi_process_comm_self()
 
-struct s_smpi_mpi_request;
-typedef struct s_smpi_mpi_request *MPI_Request;
+typedef SMPI_Request *MPI_Request;
 
 #define MPI_REQUEST_NULL ((MPI_Request)NULL)
 #define MPI_FORTRAN_REQUEST_NULL -1
@@ -824,6 +821,13 @@ XBT_PUBLIC(void) smpi_sample_1(int global, const char *file, int line, int iters
 XBT_PUBLIC(int) smpi_sample_2(int global, const char *file, int line);
 XBT_PUBLIC(void) smpi_sample_3(int global, const char *file, int line);
 
+/** 
+ * Need a public setter for SMPI copy_callback function, so users can define 
+ * their own while still using default SIMIX_copy_callback for MSG copies.
+ */
+XBT_PUBLIC(void) smpi_comm_set_copy_data_callback(void (*callback) (smx_activity_t, void*, size_t));
+
+
 /** 
  * Functions for call location tracing. These functions will be
  * called from the user's application! (With the __FILE__ and __LINE__ values