]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Apply cpu/mem info on localhost in CatalogResources.xml to enforced default localhost...
authorAnthony Geay <anthony.geay@edf.fr>
Mon, 7 Mar 2016 10:34:02 +0000 (11:34 +0100)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 24 Mar 2016 17:10:06 +0000 (18:10 +0100)
src/ResourcesManager/ResourcesManager.cxx

index 14c4b680ad0dce6abd26912cfb9e9f70f665b8e7..03a0bf6847d35356505e60685af12c5eafc149d3 100644 (file)
@@ -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 << "\"");
             }