/[escript]/branches/split/escriptcore/src/SplitWorld.cpp
ViewVC logotype

Diff of /branches/split/escriptcore/src/SplitWorld.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4802 by jfenwick, Wed Mar 26 05:48:28 2014 UTC revision 4808 by jfenwick, Thu Mar 27 05:34:14 2014 UTC
# Line 26  using namespace boost::python; Line 26  using namespace boost::python;
26  using namespace escript;  using namespace escript;
27    
28  SplitWorld::SplitWorld(unsigned int numgroups, MPI_Comm global)  SplitWorld::SplitWorld(unsigned int numgroups, MPI_Comm global)
29      :localworld((SubWorld*)0), swcount(numgroups>0?numgroups:1), jobcounter(1)      :localworld((SubWorld*)0), swcount(numgroups>0?numgroups:1), jobcounter(1), manualimport(false)
30  {  {
31      globalcom=esysUtils::makeInfo(global);      globalcom=esysUtils::makeInfo(global);
32            
# Line 167  void SplitWorld::runJobs() Line 167  void SplitWorld::runJobs()
167      distributeJobs();      distributeJobs();
168      int mres=0;      int mres=0;
169      std::string err;      std::string err;
170        std::vector<char> impexpdetail;
171      do      do
172      {      {
173      // now we actually need to run the jobs      // now we actually need to run the jobs
174      // everybody will be executing their localworld's jobs      // everybody will be executing their localworld's jobs
175      int res=localworld->runJobs(err);        int res=localworld->runJobs(err);  
176    
177      // take this opportunity to clean up      // take this opportunity to clean up
       
178      localworld->clearImportExports();      localworld->clearImportExports();
179      // now we find out about the other worlds      // now we find out about the other worlds
180      if (!checkResultInt(res, mres, globalcom))      if (!checkResultInt(res, mres, globalcom))
181      {      {
182          throw SplitWorldException("MPI appears to have failed.");          throw SplitWorldException("MPI appears to have failed.");
183      }      }
184        if (mres>1) // 1 and 0 are normal returns, >1 is some sort of error
185        {
186           break;
187        }
188        if (!localworld->localTransport(impexpdetail, err))
189        {
190            mres=4;
191            break;
192        }
193      } while (mres==1);      } while (mres==1);
194      if (mres==0)      if (mres==0)
195      {      {
# Line 235  void SplitWorld::addVariable(std::string Line 245  void SplitWorld::addVariable(std::string
245      throw SplitWorldException("Creator function did not produce a reducer.");      throw SplitWorldException("Creator function did not produce a reducer.");
246      }      }
247      Reducer_ptr rp=ex();      Reducer_ptr rp=ex();
248      localworld->addVariable(name, rp);      localworld->addVariable(name, rp, manualimport);
249  }  }
250    
251    

Legend:
Removed from v.4802  
changed lines
  Added in v.4808

  ViewVC Help
Powered by ViewVC 1.1.26