From 29be76f95819033b11334a8c3c4bce4ebacbb070 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Sun, 10 May 2015 15:23:09 +0100 Subject: [PATCH] Fixing breakage in the Comms non compile --- lib/communicator/Grid_communicator_fake.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/communicator/Grid_communicator_fake.cc b/lib/communicator/Grid_communicator_fake.cc index 962283ee..1cad9c1f 100644 --- a/lib/communicator/Grid_communicator_fake.cc +++ b/lib/communicator/Grid_communicator_fake.cc @@ -3,15 +3,17 @@ namespace Grid { CartesianCommunicator::CartesianCommunicator(std::vector &processors) { - _ndimension = _processors.size(); - _processor_coor.resize(_ndimension); _processors = processors; + _ndimension = processors.size(); + _processor_coor.resize(_ndimension); // Require 1^N processor grid for fake - for(int d=0;d<_ndimension;d++) if(_processors[d]!=1) exit(-1); - - _processor = 0;// I am the one. The only one.. - for(int d=0;d<_ndimension;d++) _processor_coor[d] = 0; + _Nprocessors=1; + _processor = 0; + for(int d=0;d<_ndimension;d++) { + assert(_processors[d]==1); + _processor_coor[d] = 0; + } } 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) { - source =1; - dest=1; + source =0; + dest=0; } int CartesianCommunicator::RankFromProcessorCoor(std::vector &coor) { - return 1; + return 0; } void CartesianCommunicator::ProcessorCoorFromRank(int rank, std::vector &coor) {