Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add bits and pieces to try to compile dumpi with smpi
[simgrid.git] / src / smpi / smpi_topo.hpp
1 /* Copyright (c) 2010-2017. The SimGrid Team. All rights reserved.          */
2
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. */
5
6 #ifndef SMPI_TOPO_HPP_INCLUDED
7 #define SMPI_TOPO_HPP_INCLUDED
8
9 #include "src/smpi/smpi_comm.hpp"
10 #include "src/smpi/smpi_status.hpp"
11
12 typedef SMPI_Topology *MPI_Topology;
13
14 namespace simgrid{
15 namespace smpi{
16
17 class Topo {
18   public:
19     virtual ~Topo()=default;
20   protected:
21   MPI_Comm comm_;
22 };
23
24
25 class Topo_Cart: public Topo {
26   private:
27     int nnodes_ = 0;
28     int ndims_;
29     int *dims_;
30     int *periodic_;
31     int *position_;
32   public:
33     explicit Topo_Cart(int ndims);
34     ~Topo_Cart();
35     Topo_Cart(MPI_Comm comm_old, int ndims, int dims[], int periods[], int reorder, MPI_Comm *comm_cart);
36     Topo_Cart* sub(const int remain_dims[], MPI_Comm *newcomm) ;
37     int coords(int rank, int maxdims, int coords[]) ;
38     int get(int maxdims, int* dims, int* periods, int* coords);
39     int rank(int* coords, int* rank);
40     int shift(int direction, int disp, int *rank_source, int *rank_dest) ;
41     int dim_get(int *ndims);
42     static int Dims_create(int nnodes, int ndims, int dims[]);
43 };
44
45
46 class Topo_Graph: public Topo {
47   private:
48     int nnodes_;
49     int nedges_;
50     int *index_;
51     int *edges_;
52   public:
53     Topo_Graph();
54     ~Topo_Graph();
55 };
56
57 class Topo_Dist_Graph: public Topo {
58   private:
59     int indegree_;
60     int *in_;
61     int *in_weights_;
62     int outdegree_;
63     int *out_;
64     int *out_weights_;
65     int is_weighted_;
66   public:
67     Topo_Dist_Graph();
68     ~Topo_Dist_Graph();
69 };
70
71 }
72 }
73
74
75 #endif