topology.hpp 1.24 KB
Newer Older
Francois Tessier's avatar
Francois Tessier committed
1 2 3 4 5 6 7 8
#ifndef TOPOLOGY_H
#define TOPOLOGY_H

#include <stdio.h>
#include <stdlib.h>

class iTopology {
 public:
Francois Tessier's avatar
Francois Tessier committed
9 10 11
  /**********************/
  /*  |-- Nodes         */
  /**********************/
12
  virtual int IONodesPerFile ( char* filename, int *nodesList ) = 0;
Francois Tessier's avatar
Francois Tessier committed
13 14
  virtual int IONodeId () = 0;
  virtual int BridgeNodeId () = 0;
15
  //virtual int ComputeNodeId () = 0;
16
  virtual int ProcessPerNode () = 0;
Francois Tessier's avatar
Francois Tessier committed
17 18 19 20 21 22 23 24

  /**********************/
  /*  |-- Network       */
  /**********************/
  virtual int NetworkDimensions () = 0;

  /*  |---- Coordinates */
  virtual void RankToCoordinates ( int rank, int* coord ) = 0;
Francois Tessier's avatar
Francois Tessier committed
25 26 27
  // Number of IO nodes
  // List of IO nodes
  // By rank -> what is my IO node
Francois Tessier's avatar
Francois Tessier committed
28 29 30
  virtual void IONodeCoordinates ( int* coord ) = 0;

  /*  |---- Distance    */
Francois Tessier's avatar
Francois Tessier committed
31
  // Minimal/maximal/exact(root?) distance
Francois Tessier's avatar
Francois Tessier committed
32 33 34
  virtual int DistanceToIONode ( int srcRank ) = 0;
  virtual int DistanceBetweenRanks ( int srcRank, int destRank ) = 0;

Francois Tessier's avatar
Francois Tessier committed
35
  /*  |---- Routes      */
Francois Tessier's avatar
Francois Tessier committed
36 37 38
  virtual int RouteToIONode ( int srcRank, int* path ) = 0;
  virtual int RouteBetweenRanks ( int srcRank, int destRank, int* path ) = 0;

Francois Tessier's avatar
Francois Tessier committed
39
  /*  |---- Links       */
Francois Tessier's avatar
Francois Tessier committed
40 41
  virtual void LinksList ( int* linksList ) = 0;
  //virtual int LinkToId ( int srcRank, int destRank ) = 0;
Francois Tessier's avatar
Francois Tessier committed
42 43 44
};

#endif // TOPOLOGY_H