Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
better handling for MPI_COMM_UNINITIALIZED to please asan
authordegomme <augustin.degomme@unibas.ch>
Tue, 7 Mar 2017 09:40:15 +0000 (10:40 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 7 Mar 2017 10:10:15 +0000 (11:10 +0100)
src/smpi/private.h
src/smpi/smpi_comm.cpp
src/smpi/smpi_comm.hpp

index e2e68fc..ffaa5b6 100644 (file)
@@ -82,7 +82,7 @@ typedef struct s_smpi_mpi_datatype{
 #define COLL_TAG_ALLREDUCE -4445
 #define SMPI_RMA_TAG -1234
 
-#define MPI_COMM_UNINITIALIZED ((MPI_Comm)-1)
+extern XBT_PRIVATE MPI_Comm MPI_COMM_UNINITIALIZED;
 
 typedef struct s_smpi_mpi_request {
   void *buf;
index 19e7a8e..c8c1569 100644 (file)
@@ -23,6 +23,10 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_comm, smpi, "Logging specific to SMPI (comm
 xbt_dict_t smpi_comm_keyvals = nullptr;
 int comm_keyval_id = 0;//avoid collisions
 
+
+simgrid::SMPI::Comm mpi_MPI_COMM_UNINITIALIZED;
+MPI_Comm MPI_COMM_UNINITIALIZED=&mpi_MPI_COMM_UNINITIALIZED;
+
 /* Support for cartesian topology was added, but there are 2 other types of topology, graph et dist graph. In order to
  * support them, we have to add a field MPIR_Topo_type, and replace the MPI_Topology field by an union. */
 
@@ -49,6 +53,8 @@ static int smpi_compare_rankmap(const void *a, const void *b)
 namespace simgrid{
 namespace SMPI{
 
+Comm::Comm(){}
+
 Comm::Comm(MPI_Group group, MPI_Topology topo)
 {
   m_group = group;
index 1b71731..e8773ec 100644 (file)
@@ -29,7 +29,7 @@ class Comm {
     xbt_dict_t m_attributes;
 
   public:
-
+    Comm();
     Comm(MPI_Group group, MPI_Topology topo);
 
     void destroy();