X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/fe304706848f0a64477d4687b3ea97d5b9a0c35c..HEAD:/src/smpi/include/smpi_topo.hpp diff --git a/src/smpi/include/smpi_topo.hpp b/src/smpi/include/smpi_topo.hpp index a0d55adc99..e46d67e55a 100644 --- a/src/smpi/include/smpi_topo.hpp +++ b/src/smpi/include/smpi_topo.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -6,21 +6,20 @@ #ifndef SMPI_TOPO_HPP_INCLUDED #define SMPI_TOPO_HPP_INCLUDED -#include "smpi_comm.hpp" #include "smpi_status.hpp" +#include -typedef SMPI_Topology *MPI_Topology; +using MPI_Topology = std::shared_ptr; -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { class Topo { - MPI_Comm comm_; + MPI_Comm comm_ = MPI_COMM_NULL; public: virtual ~Topo() = default; MPI_Comm getComm() const { return comm_; } - void setComm(MPI_Comm comm) { comm_ = comm; } + void setComm(MPI_Comm comm); }; class Topo_Cart: public Topo { @@ -38,7 +37,7 @@ public: int get(int maxdims, int* dims, int* periods, int* coords); int rank(const int* coords, int* rank); int shift(int direction, int disp, int* rank_source, int* rank_dest); - int dim_get(int* ndims); + int dim_get(int* ndims) const; static int Dims_create(int nnodes, int ndims, int dims[]); }; @@ -55,8 +54,6 @@ class Topo_Dist_Graph: public Topo { std::vector out_weights_; }; -} -} - +} // namespace simgrid::smpi #endif