From: ribes Date: Wed, 29 Jun 2011 06:39:00 +0000 (+0000) Subject: Adding new protocol: srun X-Git-Tag: V6_3_1rc1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3204f47505170056cb2a3e11cff5be19b0dbed77;p=modules%2Fkernel.git Adding new protocol: srun --- diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 34b40d258..fd92d7aba 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -626,6 +626,8 @@ SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer command = "rsh "; else if (resInfo.Protocol == ssh) command = "ssh "; + else if (resInfo.Protocol == srun) + command = "srun -n 1 -N 1 --share --nodelist="; else throw SALOME_Exception("Unknown protocol"); @@ -1001,6 +1003,18 @@ SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer commandRcp += _TmpFileName; status = system(commandRcp.c_str()); } + + else if (resInfo.Protocol == srun) + { + command = "srun -n 1 -N 1 --share --nodelist="; + std::string commandRcp = "rcp "; + commandRcp += _TmpFileName; + commandRcp += " "; + commandRcp += resInfo.HostName; + commandRcp += ":"; + commandRcp += _TmpFileName; + status = system(commandRcp.c_str()); + } else throw SALOME_Exception("Unknown protocol"); @@ -1035,6 +1049,8 @@ std::string SALOME_ContainerManager::GetMPIZeroNode(const std::string machine, c command = "rsh "; else if (resInfo.Protocol == ssh) command = "ssh "; + else if (resInfo.Protocol == srun) + command = "srun -n 1 -N 1 --share --nodelist="; else throw SALOME_Exception("Unknown protocol"); diff --git a/src/Launcher/Launcher_Job_SALOME.cxx b/src/Launcher/Launcher_Job_SALOME.cxx index 5cd3835de..187548295 100644 --- a/src/Launcher/Launcher_Job_SALOME.cxx +++ b/src/Launcher/Launcher_Job_SALOME.cxx @@ -84,7 +84,9 @@ Launcher::Job_SALOME::buildSalomeScript(Batch::Parametre params) std::string resource_protocol = "ssh"; if (_resource_definition.ClusterInternalProtocol == rsh) resource_protocol = "rsh"; - + else if (_resource_definition.ClusterInternalProtocol == srun) + resource_protocol = "srun"; + launch_script_stream << "if [ \"x$LIBBATCH_NODEFILE\" != \"x\" ]; then " << std::endl; launch_script_stream << "CATALOG_FILE=" << "CatalogResources_" << _launch_date << ".xml" << std::endl; launch_script_stream << "export USER_CATALOG_RESOURCES_FILE=" << "$CATALOG_FILE" << std::endl; diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index 27adbdd41..54efedf58 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -310,7 +310,10 @@ SALOME_ResourcesCatalog_Handler::ProcessMember(xmlNodePtr member_descr, ParserRe resource.Protocol = rsh; break; case 's': - resource.Protocol = ssh; + if (protocol[1] == 's') + resource.Protocol = ssh; + else + resource.Protocol = srun; break; default: std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; @@ -335,7 +338,10 @@ SALOME_ResourcesCatalog_Handler::ProcessMember(xmlNodePtr member_descr, ParserRe resource.ClusterInternalProtocol = rsh; break; case 's': - resource.ClusterInternalProtocol = ssh; + if (iprotocol[1] == 's') + resource.ClusterInternalProtocol = ssh; + else + resource.ClusterInternalProtocol = srun; break; default: std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; @@ -462,7 +468,10 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser resource.Protocol = rsh; break; case 's': - resource.Protocol = ssh; + if (protocol[1] == 's') + resource.Protocol = ssh; + else + resource.Protocol = srun; break; default: // If it'not in all theses cases, the protocol is affected to rsh @@ -483,7 +492,10 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser resource.ClusterInternalProtocol = rsh; break; case 's': - resource.ClusterInternalProtocol = ssh; + if (iprotocol[1] == 's') + resource.ClusterInternalProtocol = ssh; + else + resource.ClusterInternalProtocol = srun; break; default: // If it'not in all theses cases, the protocol is affected to rsh @@ -688,6 +700,9 @@ void SALOME_ResourcesCatalog_Handler::PrepareDocToXmlFile(xmlDocPtr theDoc) case ssh: xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "ssh"); break; + case srun: + xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "srun"); + break; default: xmlNewProp(node, BAD_CAST test_protocol, BAD_CAST "rsh"); } @@ -700,6 +715,9 @@ void SALOME_ResourcesCatalog_Handler::PrepareDocToXmlFile(xmlDocPtr theDoc) case ssh: xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "ssh"); break; + case srun: + xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "srun"); + break; default: xmlNewProp(node, BAD_CAST test_cluster_internal_protocol, BAD_CAST "rsh"); } diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index 64ed93896..31d99920f 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -172,6 +172,8 @@ ParserResourcesType::PrintAccessProtocolType() const { if (Protocol == rsh) return "rsh"; + else if (Protocol == srun) + return "srun"; else return "ssh"; } @@ -181,6 +183,8 @@ ParserResourcesType::PrintClusterInternalProtocol() const { if (ClusterInternalProtocol == rsh) return "rsh"; + else if (ClusterInternalProtocol == srun) + return "srun"; else return "ssh"; } diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx index f0f77b991..39b732dca 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx @@ -41,7 +41,7 @@ #pragma warning(disable:4251) // Warning DLL Interface ... #endif -enum AccessProtocolType {rsh, ssh}; +enum AccessProtocolType {rsh, ssh, srun}; enum AccessModeType {interactive, batch}; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 85c833416..3d0b9f48f 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -218,10 +218,14 @@ SALOME_ResourcesManager::GetResourceDefinition(const char * name) p_ptr->protocol = "rsh"; else if( resource.Protocol == ssh ) p_ptr->protocol = "ssh"; + else if( resource.Protocol == srun ) + p_ptr->protocol = "srun"; if( resource.ClusterInternalProtocol == rsh ) p_ptr->iprotocol = "rsh"; else if( resource.ClusterInternalProtocol == ssh ) p_ptr->iprotocol = "ssh"; + else if( resource.ClusterInternalProtocol == srun ) + p_ptr->iprotocol = "srun"; p_ptr->username = CORBA::string_dup(resource.UserName.c_str()); p_ptr->applipath = CORBA::string_dup(resource.AppliPath.c_str()); p_ptr->componentList.length(resource.ComponentsList.size()); @@ -345,6 +349,8 @@ SALOME_ResourcesManager::AddResource(const Engines::ResourceDefinition& new_reso resource.Protocol = rsh; else if (protocol == "ssh") resource.Protocol = ssh; + else if (protocol == "srun") + resource.Protocol = srun; else if (protocol == "") resource.Protocol = rsh; else { @@ -359,6 +365,8 @@ SALOME_ResourcesManager::AddResource(const Engines::ResourceDefinition& new_reso resource.ClusterInternalProtocol = rsh; else if (iprotocol == "ssh") resource.ClusterInternalProtocol = ssh; + else if (iprotocol == "srun") + resource.ClusterInternalProtocol = srun; else if (iprotocol == "") resource.ClusterInternalProtocol = rsh; else {