From: Anthony Geay Date: Mon, 7 Mar 2016 10:34:02 +0000 (+0100) Subject: Apply cpu/mem info on localhost in CatalogResources.xml to enforced default localhost... X-Git-Tag: V8_1_0a1~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5d4b856b31a7d44652673ec2e75ad688a7d6cb71;p=modules%2Fkernel.git Apply cpu/mem info on localhost in CatalogResources.xml to enforced default localhost resource. --- diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index ba27107b4..14f5990fe 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -442,9 +442,8 @@ const MapOfParserResourcesType& ResourcesManager_cpp::ParseXmlFiles() { MapOfParserResourcesType _resourcesList_tmp; MapOfParserResourcesType _resourcesBatchList_tmp; - SALOME_ResourcesCatalog_Handler* handler = - new SALOME_ResourcesCatalog_Handler(_resourcesList_tmp); - const char* aFilePath = (*_path_resources_it).c_str(); + SALOME_ResourcesCatalog_Handler *handler( new SALOME_ResourcesCatalog_Handler(_resourcesList_tmp) ); + const char *aFilePath( (*_path_resources_it).c_str() ); FILE* aFile = fopen(aFilePath, "r"); if (aFile != NULL) @@ -458,8 +457,17 @@ const MapOfParserResourcesType& ResourcesManager_cpp::ParseXmlFiles() for (MapOfParserResourcesType_it i = _resourcesList_tmp.begin(); i != _resourcesList_tmp.end(); ++i) { MapOfParserResourcesType_it j = _resourcesList.find(i->first); - if (i->second.HostName == "localhost" || i->second.HostName == Kernel_Utils::GetHostname()) + if (i->second.HostName == DEFAULT_RESOURCE_NAME || i->second.HostName == Kernel_Utils::GetHostname()) { + MapOfParserResourcesType_it it0(_resourcesList.find(DEFAULT_RESOURCE_NAME)); + if(it0!=_resourcesList.end()) + { + ParserResourcesType& localhostElt((*it0).second); + localhostElt.DataForSort._nbOfNodes=(*i).second.DataForSort._nbOfNodes; + localhostElt.DataForSort._nbOfProcPerNode=(*i).second.DataForSort._nbOfProcPerNode; + localhostElt.DataForSort._CPUFreqMHz=(*i).second.DataForSort._CPUFreqMHz; + localhostElt.DataForSort._memInMB=(*i).second.DataForSort._memInMB; + } RES_MESSAGE("Resource " << i->first << " is not added because it is the same " "machine as default local resource \"" << DEFAULT_RESOURCE_NAME << "\""); }