X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/89f523f3ff17676a68b12f47b941d7356043c75a..5eb856761d5f073b07eac25c05012cfa8075e1f1:/src/smpi/smpi_topo.hpp diff --git a/src/smpi/smpi_topo.hpp b/src/smpi/smpi_topo.hpp index 8927ec4a31..007e01bc18 100644 --- a/src/smpi/smpi_topo.hpp +++ b/src/smpi/smpi_topo.hpp @@ -9,28 +9,36 @@ #include "private.h" +typedef enum MPIR_Topo_type { + MPI_GRAPH=1, + MPI_CART=2, + MPI_DIST_GRAPH=3, + MPI_INVALID_TOPO=-1 +} MPIR_Topo_type; + +typedef SMPI_Topology *MPI_Topology; namespace simgrid{ namespace smpi{ class Topo { protected: - MPI_Comm _comm; + MPI_Comm comm_; }; -class Cart: public Topo { +class Topo_Cart: public Topo { private: - int _nnodes; - int _ndims; - int *_dims; - int *_periodic; - int *_position; + int nnodes_ = 0; + int ndims_; + int *dims_; + int *periodic_; + int *position_; public: - Cart(int ndims); - ~Cart(); - Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm *comm_cart); - Cart* sub(const int remain_dims[], MPI_Comm *newcomm) ; + Topo_Cart(int ndims); + ~Topo_Cart(); + Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm *comm_cart); + Topo_Cart* sub(const int remain_dims[], MPI_Comm *newcomm) ; int coords(int rank, int maxdims, int coords[]) ; int get(int maxdims, int* dims, int* periods, int* coords); int rank(int* coords, int* rank); @@ -39,29 +47,29 @@ class Cart: public Topo { }; -class Graph: public Topo { +class Topo_Graph: public Topo { private: - int _nnodes; - int _nedges; - int *_index; - int *_edges; + int nnodes_; + int nedges_; + int *index_; + int *edges_; public: - Graph(); - ~Graph(); + Topo_Graph(); + ~Topo_Graph(); }; -class Dist_Graph: public Topo { +class Topo_Dist_Graph: public Topo { private: - int _indegree; - int *_in; - int *_in_weights; - int _outdegree; - int *_out; - int *_out_weights; - int _is_weighted; + int indegree_; + int *in_; + int *in_weights_; + int outdegree_; + int *out_; + int *out_weights_; + int is_weighted_; public: - Dist_Graph(); - ~Dist_Graph(); + Topo_Dist_Graph(); + ~Topo_Dist_Graph(); }; /*