Commit c9f59351 authored by Francois Tessier's avatar Francois Tessier

Implementation of the network abstraction for Cooley (CLOS network, haswell-based compute nodes)

parent ea58dc60
#include "tp_network.hpp"
#define MAX_IONODES 1
/**********************/
/* |-- Nodes */
/**********************/
int Topology::IONodeId () {
return 0;
}
int Topology::BridgeNodeId () {
return 0;
}
int Topology::ComputeNodeId () {
return 0;
}
int Topology::ProcessPerNode () {
return 12;
}
int Topology::IONodesPerFile ( char* filename, int *nodesList ) {
return 1;
}
/**********************/
/* |-- Network */
/**********************/
int Topology::NetworkDimensions () {
return 1;
}
/* |---- Coordinates */
void Topology::RankToCoordinates ( int rank, int* coord ) {
int size, node, core;
node = rank / this->ProcessPerNode ();
core = sched_getcpu();
coord[0] = node;
coord[1] = core;
return;
}
void Topology::IONodeCoordinates ( int* coord ) {
return;
}
/* |---- Distance */
int Topology::DistanceToIONode ( int srcRank ) {
return 1;
}
int Topology::DistanceBetweenRanks ( int srcRank, int destRank ) {
return 1;
}
/* |---- Routes */
int Topology::RouteToIONode ( int srcRank, int* path ) {
return 0;
}
int Topology::RouteBetweenRanks ( int srcRank, int destRank, int* path ) {
return 0;
}
/* |---- Links */
void Topology::LinksList ( int* linksList ) {
return;
}
#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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment