1 /* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
6 #ifndef SMPI_TOPO_HPP_INCLUDED
7 #define SMPI_TOPO_HPP_INCLUDED
9 #include "src/smpi/smpi_comm.hpp"
10 #include "src/smpi/smpi_status.hpp"
12 typedef enum MPIR_Topo_type {
19 typedef SMPI_Topology *MPI_Topology;
26 virtual ~Topo()=default;
32 class Topo_Cart: public Topo {
42 Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm *comm_cart);
43 Topo_Cart* sub(const int remain_dims[], MPI_Comm *newcomm) ;
44 int coords(int rank, int maxdims, int coords[]) ;
45 int get(int maxdims, int* dims, int* periods, int* coords);
46 int rank(int* coords, int* rank);
47 int shift(int direction, int disp, int *rank_source, int *rank_dest) ;
48 int dim_get(int *ndims);
49 static int Dims_create(int nnodes, int ndims, int dims[]);
53 class Topo_Graph: public Topo {
64 class Topo_Dist_Graph: public Topo {