Salome HOME
cleaning useless part of algo
authorLauffenburger Thomas <thomas.lauffenburger@edf.fr>
Mon, 31 Jul 2017 12:26:59 +0000 (14:26 +0200)
committerLauffenburger Thomas <thomas.lauffenburger@edf.fr>
Mon, 31 Jul 2017 12:26:59 +0000 (14:26 +0200)
src/engine/PlayGround.cxx
src/engine/PlayGround.hxx

index bc96d9b3d4df2d207695f6854a02a64cc0c6ceea..4ed54568e9f62091e221629d88a903bf84891088 100644 (file)
@@ -97,30 +97,6 @@ void PlayGround::checkCoherentInfo() const
     throw Exception("host names entries must be different each other !");
 }
 
-std::vector<bool> PlayGround::FromUItoVB(unsigned int sz, unsigned int v)
-{
-  std::vector<bool> ret(sz);
-  unsigned int p(1);
-  for(std::size_t i=0;i<sz;i++)
-    {
-      ret[i]=p&v;
-      p<<=1;
-    }
-  return ret;
-}
-
-unsigned int PlayGround::FromVBtoUI(const std::vector<bool>& v)
-{
-  std::size_t sz(v.size());
-  unsigned int ret(0);
-  for(std::size_t i=0;i<sz;i++)
-    {
-      if(v[i])
-        ret+=1u<<i;
-    }
-  return ret;
-}
-
 std::vector<int> PlayGround::GetIdsMatching(const std::vector<bool>& bigArr, const std::vector<bool>& pat)
 {
   std::vector<int> ret;
@@ -230,16 +206,10 @@ std::vector< YACS::BASES::AutoRefCnt<PartDefinition> > PlayGround::partition(con
       for(std::size_t j=0;j<szs;j++)
         zeArr[j*sz+i]=bs[j];
     }
-  std::set<unsigned int> ss;
-  for(std::size_t i=0;i<szs;i++)
-    {
-      std::vector<bool> vb(zeArr.begin()+i*sz,zeArr.begin()+(i+1)*sz);
-      ss.insert(FromVBtoUI(vb));
-    }
   std::vector< std::vector<int> > retIds(sz);
-  for(std::set<unsigned int>::const_iterator i=ss.begin();i!=ss.end();i++)
+  for(std::size_t i=0;i<szs;i++)
     {
-      std::vector<bool> code(FromUItoVB(sz,*i));// for this configuration which parts are considered
+      std::vector<bool> code(zeArr.begin()+i*sz,zeArr.begin()+(i+1)*sz);
       std::vector<int> locIds(GetIdsMatching(zeArr,code));
       std::vector<int> partsIds(BuildVectOfIdsFromVecBool(code));
       if(partsIds.empty())
index b695e65133216b114c7ac4942fb9fb1f82b4c77d..63236663a89436907f2baecf40cef9e65678c901 100644 (file)
@@ -54,8 +54,6 @@ namespace YACS
       std::vector<std::size_t> getWorkerIdsFullyFetchedBy(int nbCoresPerComp, const std::vector<bool>& coreFlags) const;
       static std::vector<int> BuildVectOfIdsFromVecBool(const std::vector<bool>& v);
       static std::vector<int> GetIdsMatching(const std::vector<bool>& bigArr, const std::vector<bool>& pat);
-      static std::vector<bool> FromUItoVB(unsigned int sz, unsigned int v);
-      static unsigned int FromVBtoUI(const std::vector<bool>& v);
     private:
       std::vector< std::vector<int> > splitIntoParts(const std::vector<int>& coreIds, const std::vector<int>& nbCoresConso, const std::vector<double>& weights) const;
       std::vector<int> takePlace(int maxNbOfCoresToAlloc, int nbCoresPerShot, std::vector<bool>& distributionOfCores, bool lastOne=false) const;