From f26d1d3988dc5283b874428672491b1c0f2eb4d9 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Tue, 14 Apr 2020 10:55:15 +0200 Subject: [PATCH] Select only the resources that can run containers in ListAllAvailableResources --- .../SALOME_ResourcesManager.cxx | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index e1cf88b5b..6788f27b7 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -148,21 +148,20 @@ void SALOME_ResourcesManager::Shutdown() void SALOME_ResourcesManager::ListAllAvailableResources(Engines::ResourceList_out machines, Engines::IntegerList_out nbProcsOfMachines) { const MapOfParserResourcesType& zeList(_rm->GetList()); - std::size_t sz(zeList.size()); - std::vector ret0(sz); - std::vector ret1(sz); + std::vector ret0; + std::vector ret1; + for(MapOfParserResourcesType::const_iterator it=zeList.begin();it!=zeList.end();it++) { - std::size_t i(0); - for(MapOfParserResourcesType::const_iterator it=zeList.begin();it!=zeList.end();it++,i++) - { - const ParserResourcesType& elt((*it).second); - ret0[i]=elt.HostName; - //ret1[i]=elt.nbOfProc; - ret1[i]=elt.DataForSort._nbOfNodes*elt.DataForSort._nbOfProcPerNode; - } + const ParserResourcesType& elt((*it).second); + if(elt.can_run_containers) + { + ret0.push_back(elt.HostName); + ret1.push_back(elt.DataForSort._nbOfNodes*elt.DataForSort._nbOfProcPerNode); + } } machines=new Engines::ResourceList; nbProcsOfMachines=new Engines::IntegerList; + std::size_t sz(ret0.size()); machines->length(sz); nbProcsOfMachines->length(sz); for(std::size_t j=0;j