Commit e9bb0b17 authored by Francois Tessier's avatar Francois Tessier

Compute a unique node Id based on hostname on Cooley

parent 9fd32834
......@@ -16,7 +16,18 @@ int Topology::BridgeNodeId () {
int Topology::ComputeNodeId () {
return 0;
char *name;
int resultlen;
int nodeId;
name = (char *) malloc ( MPI_MAX_PROCESSOR_NAME * sizeof ( char ) );
MPI_Get_processor_name( name, &resultlen );
while ( name[0] == 'c' ) name++;
nodeId = atoi ( name );
return nodeId;
}
......@@ -42,7 +53,8 @@ int Topology::NetworkDimensions () {
void Topology::RankToCoordinates ( int rank, int* coord ) {
int size, node, core;
node = rank / this->ProcessPerNode ();
//node = rank / this->ProcessPerNode ();
node = this->ComputeNodeId ();
core = sched_getcpu();
coord[0] = node;
......
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