1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-14 01:35:36 +00:00

Fixing breakage in the Comms non compile

This commit is contained in:
Peter Boyle 2015-05-10 15:23:09 +01:00
parent 7f04b85368
commit 8299bc39ea

View File

@ -3,15 +3,17 @@ namespace Grid {
CartesianCommunicator::CartesianCommunicator(std::vector<int> &processors) CartesianCommunicator::CartesianCommunicator(std::vector<int> &processors)
{ {
_ndimension = _processors.size();
_processor_coor.resize(_ndimension);
_processors = processors; _processors = processors;
_ndimension = processors.size();
_processor_coor.resize(_ndimension);
// Require 1^N processor grid for fake // Require 1^N processor grid for fake
for(int d=0;d<_ndimension;d++) if(_processors[d]!=1) exit(-1); _Nprocessors=1;
_processor = 0;
_processor = 0;// I am the one. The only one.. for(int d=0;d<_ndimension;d++) {
for(int d=0;d<_ndimension;d++) _processor_coor[d] = 0; assert(_processors[d]==1);
_processor_coor[d] = 0;
}
} }
void CartesianCommunicator::GlobalSum(float &){} void CartesianCommunicator::GlobalSum(float &){}
@ -57,12 +59,12 @@ void CartesianCommunicator::BroadcastWorld(int root,void* data, int bytes)
void CartesianCommunicator::ShiftedRanks(int dim,int shift,int &source,int &dest) void CartesianCommunicator::ShiftedRanks(int dim,int shift,int &source,int &dest)
{ {
source =1; source =0;
dest=1; dest=0;
} }
int CartesianCommunicator::RankFromProcessorCoor(std::vector<int> &coor) int CartesianCommunicator::RankFromProcessorCoor(std::vector<int> &coor)
{ {
return 1; return 0;
} }
void CartesianCommunicator::ProcessorCoorFromRank(int rank, std::vector<int> &coor) void CartesianCommunicator::ProcessorCoorFromRank(int rank, std::vector<int> &coor)
{ {