From: Lauffenburger Thomas Date: Wed, 3 Jan 2018 15:16:56 +0000 (+0100) Subject: [EDF15946] bug with playground when nb of cores is small X-Git-Tag: V8_5_0a1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7b60d375bf9b65bee599b71b59578c7ebfc6cd86;p=modules%2Fyacs.git [EDF15946] bug with playground when nb of cores is small --- diff --git a/src/engine/Bloc_impl.cxx b/src/engine/Bloc_impl.cxx index 1a5ed1f72..cd0fec926 100644 --- a/src/engine/Bloc_impl.cxx +++ b/src/engine/Bloc_impl.cxx @@ -90,6 +90,8 @@ void Bloc::fitToPlayGround(const PlayGround *pg) this->accept(&vis); for(std::list::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); diff --git a/src/engine/ComplexWeight.hxx b/src/engine/ComplexWeight.hxx index 872fe0f45..e8bb55c32 100644 --- a/src/engine/ComplexWeight.hxx +++ b/src/engine/ComplexWeight.hxx @@ -52,7 +52,7 @@ namespace YACS ComplexWeight& addWeight(const ComplexWeight *other); protected: bool _bootWeight; - // _loopWeight: vect, for first element of vector: nbcorePerIteration<0 -> unset, nbcorePerIteration==0 -> no loopweight + // _loopWeight: vect, for first element of vector: nbcorePerIteration<0 -> unset, nbcorePerIteration==0 -> no loopweight (means no loop inside) std::vector > _loopWeight; double _elementaryWeight; private: diff --git a/src/engine/PlayGround.cxx b/src/engine/PlayGround.cxx index f28047937..883a8b6d1 100644 --- a/src/engine/PlayGround.cxx +++ b/src/engine/PlayGround.cxx @@ -266,7 +266,7 @@ std::vector< std::vector > PlayGround::splitIntoParts(const std::vectorhasValidLoopWeight()) { - 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 {