From: degomme Date: Tue, 7 Mar 2017 09:40:15 +0000 (+0100) Subject: better handling for MPI_COMM_UNINITIALIZED to please asan X-Git-Tag: v3_15~209^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/294a7c93ce4eacc0310a7f3f261639afbbe011d2?ds=sidebyside;hp=2c5bdaef3a408b3abd47c3afa587fd968af4b37c better handling for MPI_COMM_UNINITIALIZED to please asan --- diff --git a/src/smpi/private.h b/src/smpi/private.h index e2e68fc8d1..ffaa5b6710 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -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; diff --git a/src/smpi/smpi_comm.cpp b/src/smpi/smpi_comm.cpp index 19e7a8e78d..c8c156906e 100644 --- a/src/smpi/smpi_comm.cpp +++ b/src/smpi/smpi_comm.cpp @@ -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; diff --git a/src/smpi/smpi_comm.hpp b/src/smpi/smpi_comm.hpp index 1b71731bdb..e8773ecd4c 100644 --- a/src/smpi/smpi_comm.hpp +++ b/src/smpi/smpi_comm.hpp @@ -29,7 +29,7 @@ class Comm { xbt_dict_t m_attributes; public: - + Comm(); Comm(MPI_Group group, MPI_Topology topo); void destroy();