tp_network.hpp 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#ifndef TP_NETWORK_H
#define TP_NETWORK_H

#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <sched.h>
#include <mpi.h>
#include "tp_network_interface.hpp"

#define MAX_IONODES 1

class Topology: public iTopology {
public:
  /**********************/
  /*  |-- Nodes         */
  /**********************/
  int IONodeId ();
  int BridgeNodeId ();
  int ComputeNodeId ();
  int ProcessPerNode ();
  int IONodesPerFile ( char* filename, int *nodesList );

  /**********************/
  /*  |-- Network       */
  /**********************/
  int NetworkDimensions ();

  /*  |---- Coordinates */
  void RankToCoordinates ( int rank, int* coord );
  void IONodeCoordinates ( int* coord );

  /*  |---- Distance    */
  int DistanceToIONode ( int srcRank );
  int DistanceBetweenRanks ( int srcRank, int destRank );

  /*  |---- Routes      */
  int RouteToIONode ( int srcRank, int* path );
  int RouteBetweenRanks ( int srcRank, int destRank, int* path );

  /*  |---- Links       */
  void LinksList ( int* linksList );
};

#endif // TP_NETWORK_H