From 7aaf9d699f5739a5cc05241a9b3294e092101c5c Mon Sep 17 00:00:00 2001 From: ribes Date: Thu, 28 Feb 2008 15:42:27 +0000 Subject: [PATCH] - Add HostName to resource's informations --- src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx | 1 + src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx | 3 ++- src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx | 1 + src/ResourcesManager/SALOME_ResourcesManager.cxx | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index 0b85c6bfb..659b3162a 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -123,6 +123,7 @@ void SALOME_ResourcesCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc) { xmlChar* hostname = xmlGetProp(aCurNode, (const xmlChar*)test_hostname); _resource.DataForSort._hostName = (const char*)hostname; + _resource.HostName = (const char*)hostname; xmlFree(hostname); } else diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index e20dbfc6a..d0a75adb8 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -116,7 +116,7 @@ void ParserResourcesType::Print() const { ostringstream oss; oss << endl << - "HostName : " << DataForSort._hostName << endl << + "HostName : " << HostName << endl << "Alias : " << Alias << endl << "NbOfNodes : " << DataForSort._nbOfNodes << endl << "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << endl << @@ -145,6 +145,7 @@ void ParserResourcesType::Clear() DataForSort._nbOfProcPerNode = 1; DataForSort._CPUFreqMHz = 0; DataForSort._memInMB = 0; + HostName = ""; Alias = ""; Protocol = rsh; Mode = interactive; diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx index f8af1dbcd..975ca4b30 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx @@ -73,6 +73,7 @@ class ResourceDataToSort struct ParserResourcesType { ResourceDataToSort DataForSort; + std::string HostName; std::string Alias; AccessProtocolType Protocol; AccessModeType Mode; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index ea88da8f8..55b71c8a1 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -1154,7 +1154,7 @@ Engines::MachineParameters* SALOME_ResourcesManager::GetMachineParameters(const ParserResourcesType resource = _resourcesList[string(hostname)]; Engines::MachineParameters *p_ptr = new Engines::MachineParameters; p_ptr->container_name = CORBA::string_dup(""); - p_ptr->hostname = CORBA::string_dup("hostname"); + p_ptr->hostname = CORBA::string_dup(resource.HostName.c_str()); p_ptr->alias = CORBA::string_dup(resource.Alias.c_str()); if( resource.Protocol == rsh ) p_ptr->protocol = "rsh"; -- 2.39.2