From: ribes Date: Thu, 17 Feb 2011 14:20:08 +0000 (+0000) Subject: Adding a new batch type in resource manager: ll for LoadLeveler from IBM X-Git-Tag: Start_BR_19998_21191~68 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=db5c267a400d75d43cfe6f064efceb3eb3446656;p=modules%2Fkernel.git Adding a new batch type in resource manager: ll for LoadLeveler from IBM --- diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index 20851ed2a..484517390 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -106,10 +106,10 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) //default resources _resource.Clear(); - _resource.HostName = Kernel_Utils::GetHostname(); - _resource.Name = Kernel_Utils::GetHostname(); - _resource.DataForSort._Name = Kernel_Utils::GetHostname(); - _resources_list[Kernel_Utils::GetHostname()] = _resource; + _resource.HostName = Kernel_Utils::GetHostname(); + _resource.Name = Kernel_Utils::GetHostname(); + _resource.DataForSort._Name = Kernel_Utils::GetHostname(); + _resources_list[Kernel_Utils::GetHostname()] = _resource; // Get the document root node xmlNodePtr aCurNode = xmlDocGetRootElement(theDoc); @@ -126,15 +126,15 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) bool Ok = ProcessMachine(aCurNode, _resource); if (Ok) { - // Adding a resource - if(_resource.HostName == "localhost") - { - _resource.HostName = Kernel_Utils::GetHostname(); - } - std::map::const_iterator iter = _resources_list.find(_resource.Name); - if (iter != _resources_list.end()) - RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !"); - _resources_list[_resource.Name] = _resource; + // Adding a resource + if(_resource.HostName == "localhost") + { + _resource.HostName = Kernel_Utils::GetHostname(); + } + std::map::const_iterator iter = _resources_list.find(_resource.Name); + if (iter != _resources_list.end()) + RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !"); + _resources_list[_resource.Name] = _resource; } } // Cas de la déclaration d'un cluster @@ -143,10 +143,10 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) _resource.Clear(); if(ProcessCluster(aCurNode, _resource)) { - std::map::const_iterator iter = _resources_list.find(_resource.Name); - if (iter != _resources_list.end()) - RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !"); - _resources_list[_resource.Name] = _resource; + std::map::const_iterator iter = _resources_list.find(_resource.Name); + if (iter != _resources_list.end()) + RES_INFOS("Warning resource " << _resource.Name << " already added, keep last resource found !"); + _resources_list[_resource.Name] = _resource; } } aCurNode = aCurNode->next; @@ -531,6 +531,8 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser resource.Batch = ssh_batch; else if (aBatch == "ccc") resource.Batch = ccc; + else if (aBatch == "ll") + resource.Batch = ll; else resource.Batch = none; } @@ -729,6 +731,9 @@ void SALOME_ResourcesCatalog_Handler::PrepareDocToXmlFile(xmlDocPtr theDoc) case ssh_batch: xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "ssh_batch"); break; + case ll: + xmlNewProp(node, BAD_CAST test_batch, BAD_CAST "ll"); + break; default: xmlNewProp(node, BAD_CAST test_batch, BAD_CAST ""); } diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index f84d26b2c..aa7098266 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -207,6 +207,8 @@ ParserResourcesType::PrintBatchType() const return "sge"; else if (Batch == ccc) return "ccc"; + else if (Batch == ll) + return "ll"; else return "ssh"; } diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx index d376e5545..08fb578ca 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx @@ -45,7 +45,7 @@ enum AccessProtocolType {rsh, ssh}; enum AccessModeType {interactive, batch}; -enum BatchType {none, pbs, lsf, sge, ssh_batch, ccc}; +enum BatchType {none, pbs, lsf, sge, ssh_batch, ccc, ll}; enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, slurm, prun}; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 454b9696a..281496eb3 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -256,6 +256,8 @@ SALOME_ResourcesManager::GetResourceDefinition(const char * name) p_ptr->batch = "ccc"; else if( resource.Batch == ssh_batch ) p_ptr->batch = "ssh"; + else if( resource.Batch == ll ) + p_ptr->batch = "ll"; return p_ptr; } @@ -287,6 +289,8 @@ SALOME_ResourcesManager::AddResource(const Engines::ResourceDefinition& new_reso resource.Batch = ccc; else if (aBatch == "ssh_batch") resource.Batch = ssh_batch; + else if (aBatch == "ll") + resource.Batch = ll; else if (aBatch == "") resource.Batch = none; else {