Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Added a definition of MPI_File (MPI-IO) to allow smpicc to compile code that declare...
[simgrid.git] / include / smpi / smpi.h
index eaf6fac..0cc6f08 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2013. The SimGrid Team.
+/* Copyright (c) 2007-2014. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -41,12 +41,10 @@ SG_BEGIN_DECL()
 #define SMPI_RAND_SEED 5
 #define MPI_ANY_SOURCE -555
 #define MPI_BOTTOM (void *)-111
-#define MPI_FORTRAN_BOTTOM -111
 #define MPI_PROC_NULL -666
 #define MPI_ANY_TAG -444
 #define MPI_UNDEFINED -333
 #define MPI_IN_PLACE (void *)-222
-#define MPI_FORTRAN_IN_PLACE -222
 
 // errorcodes
 #define MPI_SUCCESS       0
@@ -66,6 +64,9 @@ SG_BEGIN_DECL()
 #define MPI_ERR_PENDING   14
 #define MPI_ERR_BUFFER    15
 #define MPI_ERR_NAME      16
+#define MPI_ERR_DIMS      17
+#define MPI_ERR_TOPOLOGY  18
+#define MPI_ERR_NO_MEM    19
 #define MPI_ERRCODES_IGNORE (int *)0
 #define MPI_IDENT     0
 #define MPI_SIMILAR   1
@@ -101,6 +102,11 @@ SG_BEGIN_DECL()
 #define MPI_INTEGER8 MPI_DATATYPE_NULL
 #define MPI_COMPLEX MPI_DATATYPE_NULL
 #define MPI_DOUBLE_COMPLEX MPI_DATATYPE_NULL
+#define MPI_2DOUBLE_PRECISION MPI_DATATYPE_NULL
+#define MPI_REAL MPI_DATATYPE_NULL
+#define MPI_LOGICAL MPI_DATATYPE_NULL
+#define MPI_DOUBLE_PRECISION MPI_DATATYPE_NULL
+#define MPI_INTEGER MPI_DATATYPE_NULL
 
 #define MPI_DISTRIBUTE_BLOCK 0
 #define MPI_DISTRIBUTE_NONE 1
@@ -155,6 +161,15 @@ typedef enum MPIR_Topo_type {
 typedef ptrdiff_t MPI_Aint;
 typedef long long MPI_Offset;
 
+// To compile code that declare MPI_File variables
+struct s_empty {
+#if !defined(__GNUC__) || defined(__STRICT_ANSI__)
+  char empty;
+#endif
+};
+typedef struct s_empty *MPI_File;
+
+
 struct s_smpi_mpi_datatype;
 typedef struct s_smpi_mpi_datatype *MPI_Datatype;
 
@@ -165,12 +180,10 @@ typedef struct {
   int count;
 } MPI_Status;
 
-#define MPI_STATUS_IGNORE NULL
-#define MPI_STATUSES_IGNORE NULL
-#define MPI_FORTRAN_STATUS_IGNORE -1
-#define MPI_FORTRAN_STATUSES_IGNORE -1
+#define MPI_STATUS_IGNORE ((MPI_Status*)NULL)
+#define MPI_STATUSES_IGNORE ((MPI_Status*)NULL)
 
-#define MPI_DATATYPE_NULL NULL
+#define MPI_DATATYPE_NULL ((MPI_Datatype)NULL)
 XBT_PUBLIC_DATA( MPI_Datatype ) MPI_CHAR;
 XBT_PUBLIC_DATA( MPI_Datatype ) MPI_SHORT;
 XBT_PUBLIC_DATA( MPI_Datatype ) MPI_INT;
@@ -223,7 +236,7 @@ typedef void MPI_User_function(void *invec, void *inoutvec, int *len,
 struct s_smpi_mpi_op;
 typedef struct s_smpi_mpi_op *MPI_Op;
 
-#define MPI_OP_NULL NULL
+#define MPI_OP_NULL ((MPI_Op)NULL)
 XBT_PUBLIC_DATA( MPI_Op ) MPI_MAX;
 XBT_PUBLIC_DATA( MPI_Op ) MPI_MIN;
 XBT_PUBLIC_DATA( MPI_Op ) MPI_MAXLOC;
@@ -237,17 +250,20 @@ XBT_PUBLIC_DATA( MPI_Op ) MPI_BAND;
 XBT_PUBLIC_DATA( MPI_Op ) MPI_BOR;
 XBT_PUBLIC_DATA( MPI_Op ) MPI_BXOR;
 
+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;
 
-#define MPI_GROUP_NULL NULL
+#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;
 
-#define MPI_COMM_NULL NULL
+#define MPI_COMM_NULL ((MPI_Comm)NULL)
 XBT_PUBLIC_DATA( MPI_Comm ) MPI_COMM_WORLD;
 XBT_PUBLIC_DATA( int ) MPI_UNIVERSE_SIZE;
 #define MPI_COMM_SELF smpi_process_comm_self()
@@ -255,7 +271,7 @@ XBT_PUBLIC_DATA( int ) MPI_UNIVERSE_SIZE;
 struct s_smpi_mpi_request;
 typedef struct s_smpi_mpi_request *MPI_Request;
 
-#define MPI_REQUEST_NULL NULL
+#define MPI_REQUEST_NULL ((MPI_Request)NULL)
 #define MPI_FORTRAN_REQUEST_NULL -1
 
 MPI_CALL(XBT_PUBLIC(int), MPI_Init, (int *argc, char ***argv));
@@ -677,11 +693,21 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Comm_get_parent,( MPI_Comm *parent));
 //FIXME: End of all the not yet implemented stuff
 
 // smpi functions
+XBT_PUBLIC(int) smpi_global_size(void);
 XBT_PUBLIC(MPI_Comm) smpi_process_comm_self(void);
 /*
 XBT_PUBLIC(void) smpi_exit(int);
 */
 
+XBT_PUBLIC(void) smpi_execute_flops(double flops);
+XBT_PUBLIC(void) smpi_execute(double duration);
+
+XBT_PUBLIC(double) smpi_get_host_power_peak_at(int pstate_index);
+XBT_PUBLIC(double) smpi_get_host_current_power_peak(void);
+XBT_PUBLIC(int) smpi_get_host_nb_pstates(void);
+XBT_PUBLIC(void) smpi_set_host_power_peak_at(int pstate_index);
+XBT_PUBLIC(double) smpi_get_host_consumed_energy(void);
+
 XBT_PUBLIC(unsigned int) smpi_sleep(unsigned int secs);
 XBT_PUBLIC(int) smpi_gettimeofday(struct timeval *tv);
 XBT_PUBLIC(unsigned long long) smpi_rastro_resolution (void);
@@ -723,11 +749,19 @@ XBT_PUBLIC(int) __attribute__((weak)) MAIN__(void);
 XBT_PUBLIC(int) smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[]);
 XBT_PUBLIC(void) __attribute__((weak)) user_main_(void);
 XBT_PUBLIC(int) smpi_process_index(void);
+XBT_PUBLIC(void) smpi_process_init(int *argc, char ***argv);
 
 /* Trace replay specific stuff */
 XBT_PUBLIC(void) smpi_replay_init(int *argc, char***argv);
 XBT_PUBLIC(void) smpi_action_trace_run(char *);
 XBT_PUBLIC(int) smpi_replay_finalize(void);
 
+XBT_PUBLIC(void) SMPI_app_instance_register(const char *name, xbt_main_func_t code, int num_processes);
+XBT_PUBLIC(void) SMPI_init(void);
+XBT_PUBLIC(void) SMPI_finalize(void);
+
+
+
+
 SG_END_DECL()
 #endif