Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[SMPI] Make MPI_DATATYPE_NULL a non-null object
[simgrid.git] / include / smpi / smpi.h
index bccb165..32630ee 100644 (file)
@@ -198,6 +198,8 @@ SG_BEGIN_DECL()
 #define MPI_WIN_BASE -1
 #define MPI_WIN_SIZE -2
 #define MPI_WIN_DISP_UNIT -3
+#define MPI_WIN_CREATE_FLAVOR -4
+#define MPI_WIN_MODEL -5
 
 typedef ptrdiff_t MPI_Aint;
 typedef long long MPI_Offset;
@@ -213,6 +215,7 @@ typedef struct {
   int MPI_TAG;
   int MPI_ERROR;
   int count;
+  int cancelled;
 } MPI_Status;
 
 typedef SMPI_Win* MPI_Win;
@@ -221,7 +224,7 @@ typedef SMPI_Info* MPI_Info;
 #define MPI_STATUS_IGNORE ((MPI_Status*)NULL)
 #define MPI_STATUSES_IGNORE ((MPI_Status*)NULL)
 
-#define MPI_DATATYPE_NULL ((const MPI_Datatype)NULL)
+XBT_PUBLIC_DATA const MPI_Datatype MPI_DATATYPE_NULL;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_CHAR;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_SHORT;
 XBT_PUBLIC_DATA const MPI_Datatype MPI_INT;
@@ -308,6 +311,11 @@ XBT_PUBLIC_DATA const MPI_Datatype MPI_INTEGER16;
 #define MPI_DOUBLE_PRECISION MPI_DOUBLE
 #define MPI_2DOUBLE_PRECISION MPI_2DOUBLE
 
+#define MPI_WIN_FLAVOR_CREATE 0
+#define MPI_WIN_FLAVOR_ALLOCATE 1
+#define MPI_WIN_FLAVOR_DYNAMIC 2
+#define MPI_WIN_FLAVOR_SHARED 3
+
 typedef void MPI_User_function(void *invec, void *inoutvec, int *len, MPI_Datatype * datatype);
 typedef SMPI_Op *MPI_Op;
 
@@ -589,6 +597,8 @@ MPI_CALL(XBT_PUBLIC int, MPI_Win_create,
          (void* base, MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, MPI_Win* win));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_allocate,
          (MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void* base, MPI_Win* win));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_allocate_shared,
+         (MPI_Aint size, int disp_unit, MPI_Info info, MPI_Comm comm, void* base, MPI_Win* win));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_create_dynamic, (MPI_Info info, MPI_Comm comm, MPI_Win* win));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_attach, (MPI_Win win, void* base, MPI_Aint size));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_detach, (MPI_Win win, void* base));
@@ -617,6 +627,8 @@ MPI_CALL(XBT_PUBLIC int, MPI_Win_flush, (int rank, MPI_Win win));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_flush_local, (int rank, MPI_Win win));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_flush_all, (MPI_Win win));
 MPI_CALL(XBT_PUBLIC int, MPI_Win_flush_local_all, (MPI_Win win));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_shared_query, (MPI_Win win, int rank, MPI_Aint* size, int* disp_unit, void* baseptr));
+MPI_CALL(XBT_PUBLIC int, MPI_Win_sync, (MPI_Win win));
 MPI_CALL(XBT_PUBLIC MPI_Win, MPI_Win_f2c, (MPI_Fint win));
 MPI_CALL(XBT_PUBLIC MPI_Fint, MPI_Win_c2f, (MPI_Win win));
 
@@ -907,13 +919,14 @@ XBT_PUBLIC void smpi_execute_flops(double flops);
 XBT_PUBLIC void smpi_execute(double duration);
 XBT_PUBLIC void smpi_execute_benched(double duration);
 
-XBT_PUBLIC double smpi_get_host_power_peak_at(int pstate_index);
-XBT_PUBLIC double smpi_get_host_current_power_peak();
-XBT_PUBLIC int smpi_get_host_nb_pstates();
-XBT_PUBLIC void smpi_set_host_pstate(int pstate_index);
-XBT_PUBLIC int smpi_get_host_pstate();
+// PLEASE NOTE: If you remove these functions, the entire smpi_dvfs.cpp file can be removed as well!!
+XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_pstate_speed(sg_host_self(), pstate_index) instead") XBT_PUBLIC double smpi_get_host_power_peak_at(int pstate_index);
+XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_speed(sg_host_self()) instead") XBT_PUBLIC double smpi_get_host_current_power_peak();
+XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_nb_pstates(sg_host_self()) instead") XBT_PUBLIC int smpi_get_host_nb_pstates();
+XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_set_pstate(sg_host_self(), pstate_index) instead") XBT_PUBLIC void smpi_set_host_pstate(int pstate_index);
+XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_pstate(sg_host_self()) instead") XBT_PUBLIC int smpi_get_host_pstate();
 
-XBT_PUBLIC double smpi_get_host_consumed_energy();
+XBT_ATTRIB_DEPRECATED_v324("Please use sg_host_get_consumed_energy(sg_host_self()) instead") XBT_PUBLIC double smpi_get_host_consumed_energy();
 
 
 XBT_PUBLIC unsigned long long smpi_rastro_resolution();
@@ -1050,12 +1063,11 @@ SG_END_DECL()
 
 XBT_PUBLIC int smpi_is_shared(void* ptr, std::vector<std::pair<size_t, size_t>>& private_blocks, size_t* offset);
 
-std::vector<std::pair<size_t, size_t>> shift_and_frame_private_blocks(const std::vector<std::pair<size_t, size_t>> vec,
+std::vector<std::pair<size_t, size_t>> shift_and_frame_private_blocks(const std::vector<std::pair<size_t, size_t>>& vec,
                                                                       size_t offset, size_t buff_size);
-std::vector<std::pair<size_t, size_t>> merge_private_blocks(std::vector<std::pair<size_t, size_t>> src,
-                                                            std::vector<std::pair<size_t, size_t>> dst);
-                                                            
-                                                            
+std::vector<std::pair<size_t, size_t>> merge_private_blocks(const std::vector<std::pair<size_t, size_t>>& src,
+                                                            const std::vector<std::pair<size_t, size_t>>& dst);
+
 #endif
 
 #endif