Salome HOME
[EDF15946] bug with playground when nb of cores is small
authorLauffenburger Thomas <thomas.lauffenburger@edf.fr>
Wed, 3 Jan 2018 15:16:56 +0000 (16:16 +0100)
committerLauffenburger Thomas <thomas.lauffenburger@edf.fr>
Wed, 3 Jan 2018 15:16:56 +0000 (16:16 +0100)
src/engine/Bloc_impl.cxx
src/engine/ComplexWeight.hxx
src/engine/PlayGround.cxx

index 1a5ed1f72c64e6c63ec572843fee2514e7bc60d9..cd0fec926f360e5ff0a295515e9cb58f7c2a7059 100644 (file)
@@ -90,6 +90,8 @@ void Bloc::fitToPlayGround(const PlayGround *pg)
   this->accept(&vis);
   for(std::list<ForEachLoop *>::const_iterator it=vis._fes.begin();it!=vis._fes.end();it++)
     (*it)->edGetNbOfBranchesPort()->edInit(1);
+  if (this->getMaxLevelOfParallelism() > pg->getNumberOfCoresAvailable())
+    throw YACS::Exception("Bloc::fitToPlayGround : Not enough cores available to run the calculation !");
   this->removeRecursivelyRedundantCL();
   this->partitionRegardingDPL(pd,zeMap);
   this->accept(&vis);
index 872fe0f458ce79b23268e8845dad0b9b5eb97a8e..e8bb55c32534723c6fbb2520f4baf742ca263025 100644 (file)
@@ -52,7 +52,7 @@ namespace YACS
       ComplexWeight& addWeight(const ComplexWeight *other);
     protected:
       bool _bootWeight;
-      // _loopWeight: vect<pair(weight,nbcorePerIteration)>, for first element of vector: nbcorePerIteration<0 -> unset, nbcorePerIteration==0 -> no loopweight
+      // _loopWeight: vect<pair(weight,nbcorePerIteration)>, for first element of vector: nbcorePerIteration<0 -> unset, nbcorePerIteration==0 -> no loopweight (means no loop inside)
       std::vector<std::pair<double,int> > _loopWeight; 
       double _elementaryWeight;
     private:
index f28047937e3d563cc4a8445909fbc500ded85041..883a8b6d1fe230efd1b212e7107aa0cb59580848 100644 (file)
@@ -266,7 +266,7 @@ std::vector< std::vector<int> > PlayGround::splitIntoParts(const std::vector<int
         }
       else if (!(*it).first->hasValidLoopWeight())
         {
-          nbOfCoresAllocated[i]=(int)((double)totalSpace/(double)(sz)); // branch with undefined weight
+          nbOfCoresAllocated[i]=std::max((int)((double)totalSpace/(double)(sz)), nbCoresPerShot[i]); // branch with undefined weight, takes his part proportionnally to the number of branchs
         }
       else
         {