From be1907fb3507ec5122cc9f34b293748fb648620c Mon Sep 17 00:00:00 2001 From: secher Date: Tue, 15 May 2007 10:31:06 +0000 Subject: [PATCH] add compo list in StartContainer() method, and remove compoPath and PrereqFile in resources catalog --- idl/SALOME_ContainerManager.idl | 6 +- src/Container/Makefile.am | 14 +---- src/Container/SALOME_ContainerManager.cxx | 9 +-- src/Container/SALOME_ContainerManager.hxx | 5 +- src/LifeCycleCORBA/Makefile.am | 18 +++++- .../SALOME_FileTransferCORBA.cxx | 3 +- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 15 ++++- .../Test/LifeCycleCORBATest.cxx | 5 +- .../TestContainerManager.cxx | 15 +++-- .../SALOME_ResourcesCatalog_Handler.cxx | 52 +++++---------- .../SALOME_ResourcesCatalog_Handler.hxx | 3 - .../SALOME_ResourcesCatalog_Parser.cxx | 58 ++++++++++------- .../SALOME_ResourcesCatalog_Parser.hxx | 8 +-- .../SALOME_ResourcesManager.cxx | 63 ++++++++----------- .../SALOME_ResourcesManager.hxx | 7 +-- src/SALOMELocalTrace/LocalTraceBufferPool.hxx | 2 +- 16 files changed, 141 insertions(+), 142 deletions(-) rename src/{Container => LifeCycleCORBA}/TestContainerManager.cxx (91%) diff --git a/idl/SALOME_ContainerManager.idl b/idl/SALOME_ContainerManager.idl index 04980beab..cdd128f72 100644 --- a/idl/SALOME_ContainerManager.idl +++ b/idl/SALOME_ContainerManager.idl @@ -45,6 +45,7 @@ struct MachineParameters Type to transmit list of machines. */ typedef sequence MachineList; + typedef sequence CompoList; /*! exception thrown if a computer is not found in the catalog @@ -64,12 +65,13 @@ struct MachineParameters in MachineList possibleComputers); Container StartContainer( in MachineParameters params, - in ResPolicy policy); + in ResPolicy policy, + in CompoList componentList ); string FindFirst(in MachineList possibleComputers); MachineList GetFittingResources( in MachineParameters params, - in string componentName ) + in CompoList componentList ) raises (SALOME::SALOME_Exception); MachineParameters GetMachineParameters( in string hostname ); diff --git a/src/Container/Makefile.am b/src/Container/Makefile.am index d929d7277..a41b9009b 100644 --- a/src/Container/Makefile.am +++ b/src/Container/Makefile.am @@ -67,7 +67,6 @@ COMMON_CPPFLAGS=\ -I$(srcdir)/../Basics \ -I$(srcdir)/../SALOMELocalTrace \ -I$(srcdir)/../NamingService \ - -I$(srcdir)/../LifeCycleCORBA \ -I$(srcdir)/../Utils \ -I$(srcdir)/../Registry \ -I$(srcdir)/../Notification \ @@ -82,7 +81,6 @@ COMMON_LIBS =\ ../Notification/libSalomeNotification.la \ ../ResourcesManager/libSalomeResourcesManager.la \ ../NamingService/libSalomeNS.la \ - ../LifeCycleCORBA/libSalomeLifeCycleCORBA.la \ ../Utils/libOpUtil.la \ ../SALOMELocalTrace/libSALOMELocalTrace.la \ ../Basics/libSALOMEBasics.la \ @@ -123,7 +121,7 @@ libSalomeContainer_la_LIBADD =\ # Executables targets # =============================================================== # -bin_PROGRAMS = SALOME_Container SALOME_ContainerManagerServer TestContainerManager +bin_PROGRAMS = SALOME_Container SALOME_ContainerManagerServer SALOME_Container_SOURCES =\ SALOME_Container.cxx \ SALOME_Container_SignalsHandler.cxx @@ -149,13 +147,3 @@ SALOME_ContainerManagerServer_LDADD =\ $(COMMON_LIBS) \ ../Basics/libSALOMEBasics.la -TestContainerManager_SOURCES =\ - TestContainerManager.cxx - -TestContainerManager_CPPFLAGS=\ - $(COMMON_CPPFLAGS) - -TestContainerManager_LDADD =\ - libSalomeContainer.la \ - $(COMMON_LIBS) \ - ../Basics/libSALOMEBasics.la diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 33cc6c579..0bbea7465 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -286,9 +286,10 @@ StartContainer(const Engines::MachineParameters& params, Engines::Container_ptr SALOME_ContainerManager:: StartContainer(const Engines::MachineParameters& params, - Engines::ResPolicy policy) + Engines::ResPolicy policy, + const Engines::CompoList& componentList) { - Engines::MachineList_var possibleComputers = GetFittingResources(params,""); + Engines::MachineList_var possibleComputers = GetFittingResources(params,componentList); return StartContainer(params,possibleComputers,policy); } @@ -301,14 +302,14 @@ StartContainer(const Engines::MachineParameters& params, Engines::MachineList * SALOME_ContainerManager:: GetFittingResources(const Engines::MachineParameters& params, - const char *componentName) + const Engines::CompoList& componentList) { MESSAGE("SALOME_ContainerManager::GetFittingResources"); Engines::MachineList *ret=new Engines::MachineList; vector vec; try { - vec = _ResManager->GetFittingResources(params,componentName); + vec = _ResManager->GetFittingResources(params,componentList); } catch(const SALOME_Exception &ex) { diff --git a/src/Container/SALOME_ContainerManager.hxx b/src/Container/SALOME_ContainerManager.hxx index 25c4c1f6e..42f727c12 100644 --- a/src/Container/SALOME_ContainerManager.hxx +++ b/src/Container/SALOME_ContainerManager.hxx @@ -64,11 +64,12 @@ public: Engines::Container_ptr StartContainer(const Engines::MachineParameters& params, - Engines::ResPolicy policy); + Engines::ResPolicy policy, + const Engines::CompoList& componentList); Engines::MachineList * GetFittingResources(const Engines::MachineParameters& params, - const char *componentName); + const Engines::CompoList& componentList); char* FindFirst(const Engines::MachineList& possibleComputers); diff --git a/src/LifeCycleCORBA/Makefile.am b/src/LifeCycleCORBA/Makefile.am index 6bee2cf3c..d6ab39e71 100644 --- a/src/LifeCycleCORBA/Makefile.am +++ b/src/LifeCycleCORBA/Makefile.am @@ -50,11 +50,13 @@ salomeinclude_HEADERS = \ # This local variable defines the list of CPPFLAGS common to all target in this package. COMMON_CPPFLAGS=\ + @QT_MT_INCLUDES@ \ -I$(srcdir)/../Basics \ -I$(srcdir)/../SALOMELocalTrace \ -I$(srcdir)/../SALOMETraceCollector \ -I$(srcdir)/../NamingService \ -I$(srcdir)/../Utils \ + -I$(srcdir)/../Container \ -I$(srcdir)/../ResourcesManager \ -I$(top_builddir)/salome_adm/unix \ -I$(top_builddir)/idl \ @@ -97,7 +99,7 @@ libSalomeLifeCycleCORBA_la_LIBADD = $(COMMON_LIBS) # Executables targets # =============================================================== # -bin_PROGRAMS = Test_LifeCycleCORBA +bin_PROGRAMS = Test_LifeCycleCORBA TestContainerManager Test_LifeCycleCORBA_SOURCES = Test_LifeCycleCORBA.cxx Test_LifeCycleCORBA_CPPFLAGS =\ -I$(srcdir)/../Registry \ @@ -112,6 +114,20 @@ Test_LifeCycleCORBA_LDADD = \ $(COMMON_LIBS) \ @CORBA_LIBS@ +TestContainerManager_SOURCES = TestContainerManager.cxx +TestContainerManager_CPPFLAGS =\ + -I$(srcdir)/../Registry \ + -I$(srcdir)/../Notification \ + $(COMMON_CPPFLAGS) + +TestContainerManager_LDADD = \ + libSalomeLifeCycleCORBA.la \ + ../Registry/libRegistry.la \ + ../Notification/libSalomeNotification.la \ + ../Container/libSalomeContainer.la \ + $(COMMON_LIBS) \ + @CORBA_LIBS@ + #CPPFLAGS += $(PYTHON_INCLUDES) $(QT_MT_INCLUDES) #LDFLAGS += -lSalomeNS -lOpUtil -lSALOMELocalTrace -lSalomeContainer -lSalomeResourcesManager diff --git a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx index 8f7aa6ca7..1503a2841 100644 --- a/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_FileTransferCORBA.cxx @@ -122,8 +122,9 @@ string SALOME_FileTransferCORBA::getLocalFile(string localFile) params.container_name = _containerName.c_str(); params.hostname = _refMachine.c_str(); + Engines::CompoList clist; Engines::MachineList_var listOfMachines = - contManager->GetFittingResources(params, ""); + contManager->GetFittingResources(params, clist); container = contManager->FindOrStartContainer(params, listOfMachines); diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index ace68d25b..ab84068df 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -122,8 +122,11 @@ SALOME_LifeCycleCORBA::FindComponent(const Engines::MachineParameters& params, if (! isKnownComponentClass(componentName)) return Engines::Component::_nil(); + Engines::CompoList clist; + clist.length(1); + clist[0] = componentName; Engines::MachineList_var listOfMachines = - _ContManager->GetFittingResources(params, componentName); + _ContManager->GetFittingResources(params, clist); Engines::Component_var compo = _FindComponent(params, componentName, @@ -153,8 +156,11 @@ SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params, if (! isKnownComponentClass(componentName)) return Engines::Component::_nil(); + Engines::CompoList clist; + clist.length(1); + clist[0] = componentName; Engines::MachineList_var listOfMachines = - _ContManager->GetFittingResources(params, componentName); + _ContManager->GetFittingResources(params, clist); Engines::Component_var compo = _LoadComponent(params, componentName, @@ -186,8 +192,11 @@ FindOrLoad_Component(const Engines::MachineParameters& params, if (! isKnownComponentClass(componentName)) return Engines::Component::_nil(); + Engines::CompoList clist; + clist.length(1); + clist[0] = componentName; Engines::MachineList_var listOfMachines = - _ContManager->GetFittingResources(params,componentName); + _ContManager->GetFittingResources(params,clist); Engines::Component_var compo = _FindComponent(params, componentName, diff --git a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx index a1a582770..dbcca2882 100644 --- a/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx +++ b/src/LifeCycleCORBA/Test/LifeCycleCORBATest.cxx @@ -681,8 +681,11 @@ string LifeCycleCORBATest::GetRemoteHost() Engines::MachineParameters params; _LCC.preSet(params); // empty params to get all the machines + Engines::CompoList clist; + clist.length(1); + clist[0] = "SalomeTestComponent"; Engines::MachineList_var hostList = - containerManager->GetFittingResources(params,"SalomeTestComponent"); + containerManager->GetFittingResources(params,clist); CPPUNIT_ASSERT(hostList->length() > 1); string localHost = GetHostname(); diff --git a/src/Container/TestContainerManager.cxx b/src/LifeCycleCORBA/TestContainerManager.cxx similarity index 91% rename from src/Container/TestContainerManager.cxx rename to src/LifeCycleCORBA/TestContainerManager.cxx index ca20a1057..75ecf1d53 100644 --- a/src/Container/TestContainerManager.cxx +++ b/src/LifeCycleCORBA/TestContainerManager.cxx @@ -61,6 +61,10 @@ int main (int argc, char * argv[]) Engines::ContainerManager_var _ContManager=Engines::ContainerManager::_narrow(obj); Engines::MachineParameters p; + Engines::CompoList clist; + clist.length(2); + clist[0] = "MED"; + clist[1] = "GEOM"; p.hostname = ""; p.OS = "LINUX"; @@ -74,26 +78,27 @@ int main (int argc, char * argv[]) for(int i=0;i<10;i++){ sprintf(st,"cycl_%d",i); p.container_name = CORBA::string_dup(st); - cont = _ContManager->StartContainer(p,Engines::P_CYCL); + cont = _ContManager->StartContainer(p,Engines::P_CYCL,clist); if(CORBA::is_nil(cont)) error = true; } for(int i=0;i<10;i++){ sprintf(st,"first_%d",i); p.container_name = CORBA::string_dup(st); - cont = _ContManager->StartContainer(p,Engines::P_FIRST); + cont = _ContManager->StartContainer(p,Engines::P_FIRST,clist); if(CORBA::is_nil(cont)) error = true; } p.container_name = CORBA::string_dup("best"); - cont = _ContManager->StartContainer(p,Engines::P_BEST); + cont = _ContManager->StartContainer(p,Engines::P_BEST,clist); if(CORBA::is_nil(cont)) bestImplemented = false; else bestImplemented = true; SALOME_LifeCycleCORBA LCC(_NS); - compo = LCC.FindOrLoad_Component("FactoryServer","GEOM"); + p.container_name = CORBA::string_dup("FactoryServer"); + compo = LCC.FindOrLoad_Component(p,"SMESH"); if(CORBA::is_nil(compo)) error = true; - compo = LCC.FindOrLoad_Component("FactoryServer","GEOM"); + compo = LCC.FindOrLoad_Component(p,"SMESH"); if(CORBA::is_nil(compo)) error = true; _NS->Change_Directory("/Containers"); diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index 53162f87c..8263ca440 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -58,8 +58,6 @@ SALOME_ResourcesCatalog_Handler(MapOfParserResourcesType& listOfResources): test_appli_path = "appliPath"; test_modules = "modules"; test_module_name = "moduleName"; - test_module_path = "modulePath"; - test_pre_req_file_path = "preReqFilePath"; test_os = "OS"; test_mem_in_mb = "memInMB"; test_cpu_freq_mhz = "CPUFreqMHz"; @@ -127,6 +125,8 @@ startElement( const QString&, const QString& name, const QXmlAttributes& attrs ) { + if( name.compare(QString(test_machine)) == 0 ) + _resource.Clear(); for (int i = 0;i < attrs.count();i++) { QString qName(attrs.localName(i)); @@ -187,12 +187,6 @@ startElement( const QString&, if ((qName.compare(QString(test_module_name)) == 0)) previous_module_name = content; - if ((qName.compare(QString(test_module_path)) == 0)) - previous_module_path = content; - - if ((qName.compare(QString(test_pre_req_file_path)) == 0)) - _resource.PreReqFilePath = content; - if ((qName.compare(QString(test_os)) == 0)) _resource.OS = content; @@ -228,7 +222,7 @@ endElement(const QString&, const QString& qName) { if ((qName.compare(QString(test_modules)) == 0)) - _resource.ModulesPath[previous_module_name] = previous_module_path; + _resource.ModulesList.push_back(previous_module_name); if ((qName.compare(QString(test_machine)) == 0)){ int nbnodes = _resource.DataForSort._nbOfNodes; @@ -239,12 +233,8 @@ endElement(const QString&, inode[0] = '\0' ; sprintf(inode,"%s%d",clusterNode.c_str(),i+1); std::string nodeName(inode); -// _resource.DataForSort._nbOfNodes = 1; _resource.DataForSort._hostName = nodeName ; _resources_list[nodeName] = _resource; - //cout << "SALOME_ResourcesCatalog_Handler::endElement _resources_list[" - // << nodeName << "] = _resource " << _resource.DataForSort._hostName.c_str() - // << endl ; } } else @@ -279,21 +269,11 @@ bool SALOME_ResourcesCatalog_Handler::characters(const QString& chars) bool SALOME_ResourcesCatalog_Handler::endDocument() { -// for (map::const_iterator iter = -// _resources_list.begin(); -// iter != _resources_list.end(); -// iter++) -// { -// SCRUTE((*iter).second.Alias); -// SCRUTE((*iter).second.UserName); -// SCRUTE((*iter).second.AppliPath); -// SCRUTE((*iter).second.PreReqFilePath); -// SCRUTE((*iter).second.OS); -// SCRUTE((*iter).second.Protocol); -// SCRUTE((*iter).second.Mode); -// } + map::const_iterator it; + for(it=_resources_list.begin();it!=_resources_list.end();it++) + (*it).second.Print(); -// MESSAGE("This is the end of document"); + MESSAGE("This is the end of document"); return true; } @@ -388,21 +368,17 @@ void SALOME_ResourcesCatalog_Handler::PrepareDocToXmlFile(QDomDocument& doc) eltRoot.setAttribute((char *)test_user_name, (*iter).second.UserName.c_str()); - for (map::const_iterator iter2 = - (*iter).second.ModulesPath.begin(); - iter2 != (*iter).second.ModulesPath.end(); + for (vector::const_iterator iter2 = + (*iter).second.ModulesList.begin(); + iter2 != (*iter).second.ModulesList.end(); iter2++) { - QDomElement rootForModulesPaths = doc.createElement(test_modules); - rootForModulesPaths.setAttribute(test_module_name, - (*iter2).first.c_str()); - rootForModulesPaths.setAttribute(test_module_path, - (*iter2).second.c_str()); - eltRoot.appendChild(rootForModulesPaths); + QDomElement rootForModulesList = doc.createElement(test_modules); + rootForModulesList.setAttribute(test_module_name, + (*iter2).c_str()); + eltRoot.appendChild(rootForModulesList); } - eltRoot.setAttribute(test_pre_req_file_path, - (*iter).second.PreReqFilePath.c_str()); eltRoot.setAttribute(test_os, (*iter).second.OS.c_str()); eltRoot.setAttribute(test_mem_in_mb, (*iter).second.DataForSort._memInMB); diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.hxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.hxx index 497f0dddf..49e42c3f8 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.hxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.hxx @@ -71,7 +71,6 @@ class SALOME_ResourcesCatalog_Handler : public QXmlDefaultHandler QString errorProt; std::string content; std::string previous_module_name; - std::string previous_module_path; ParserResourcesType _resource; MapOfParserResourcesType& _resources_list; @@ -87,8 +86,6 @@ class SALOME_ResourcesCatalog_Handler : public QXmlDefaultHandler const char *test_appli_path; const char *test_modules; const char *test_module_name; - const char *test_module_path; - const char *test_pre_req_file_path; const char *test_os; const char *test_mem_in_mb; const char *test_cpu_freq_mhz; diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index 49e594e42..4d4727f62 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -112,26 +112,42 @@ void ResourceDataToSort::Print() const SCRUTE(_memInMB); } -void ParserResourcesType::Print() +void ParserResourcesType::Print() const { - MESSAGE("##############*****"); - MESSAGE("HostName : " << DataForSort._hostName); - MESSAGE("Alias : " << Alias); - MESSAGE("Protocol : " << Protocol); - MESSAGE("Mode : " << Mode); - MESSAGE("UserName : " << UserName); - MESSAGE("Modules : "); - int i = 1; - - for (std::map::iterator iter = ModulesPath.begin(); - iter != ModulesPath.end(); - iter++) - { - MESSAGE("Module " << i++ << " called : " << (*iter).first - << " with path : " << (*iter).second); - } - - MESSAGE("PreReqFilePath : " << PreReqFilePath); - MESSAGE("OS : " << OS); - DataForSort.Print(); + ostringstream oss; + oss << endl << + "HostName : " << DataForSort._hostName << endl << + "Alias : " << Alias << endl << + "NbOfNodes : " << DataForSort._nbOfNodes << endl << + "NbOfProcPerNode : " << DataForSort._nbOfProcPerNode << endl << + "CPUFreqMHz : " << DataForSort._CPUFreqMHz << endl << + "MemInMB : " << DataForSort._memInMB << endl << + "Protocol : " << Protocol << endl << + "Mode : " << Mode << endl << + "UserName : " << UserName << endl << + "AppliPath : " << AppliPath << endl << + "OS : " << OS << endl << + "Modules : " << endl; + + for(int i=0;i #include -typedef std::map MapOfModulesPath; - enum AccessProtocolType {rsh, ssh}; enum AccessModeType {interactive, batch}; @@ -76,11 +74,11 @@ struct ParserResourcesType AccessModeType Mode; std::string UserName; std::string AppliPath; - MapOfModulesPath ModulesPath; - std::string PreReqFilePath; + std::vector ModulesList; std::string OS; - void Print(); + void Print() const; + void Clear(); }; typedef std::map MapOfParserResourcesType; diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 2637bd5e2..72073dbfa 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -121,7 +121,7 @@ SALOME_ResourcesManager::~SALOME_ResourcesManager() vector SALOME_ResourcesManager:: GetFittingResources(const Engines::MachineParameters& params, - const char *moduleName) + const Engines::CompoList& componentList) throw(SALOME_Exception) { // MESSAGE("ResourcesManager::GetFittingResources"); @@ -179,7 +179,7 @@ throw(SALOME_Exception) { SelectOnlyResourcesWithOS(ret, params.OS); - KeepOnlyResourcesWithModule(ret, moduleName); + KeepOnlyResourcesWithModule(ret, componentList); if (ret.size() == 0) SelectOnlyResourcesWithOS(ret, params.OS); @@ -226,16 +226,16 @@ throw(SALOME_Exception) int SALOME_ResourcesManager:: AddResourceInCatalog(const Engines::MachineParameters& paramsOfNewResources, - const map& modulesOnNewResources, - const char *environPathOfPrerequired, + const vector& modulesOnNewResources, const char *alias, const char *userName, AccessModeType mode, AccessProtocolType prot) throw(SALOME_Exception) { - map::const_iterator iter = - modulesOnNewResources.find("KERNEL"); + vector::const_iterator iter = find(modulesOnNewResources.begin(), + modulesOnNewResources.end(), + "KERNEL"); if (iter != modulesOnNewResources.end()) { @@ -245,8 +245,7 @@ throw(SALOME_Exception) newElt.Protocol = prot; newElt.Mode = mode; newElt.UserName = userName; - newElt.ModulesPath = modulesOnNewResources; - newElt.PreReqFilePath = environPathOfPrerequired; + newElt.ModulesList = modulesOnNewResources; newElt.OS = paramsOfNewResources.OS; newElt.DataForSort._memInMB = paramsOfNewResources.mem_mb; newElt.DataForSort._CPUFreqMHz = paramsOfNewResources.cpu_clock; @@ -628,7 +627,7 @@ SALOME_ResourcesManager::BuildCommand command += machine; command += " "; - string path = (*(resInfo.ModulesPath.find("KERNEL"))).second; + string path = getenv("KERNEL_ROOT_DIR"); command += path; command += "/bin/salome/"; @@ -689,17 +688,27 @@ throw(SALOME_Exception) void SALOME_ResourcesManager::KeepOnlyResourcesWithModule ( vector& hosts, - const char *moduleName) const + const Engines::CompoList& componentList) const throw(SALOME_Exception) { for (vector::iterator iter = hosts.begin(); iter != hosts.end();) { MapOfParserResourcesType::const_iterator it = _resourcesList.find(*iter); - const map& mapOfModulesOfCurrentHost = - (((*it).second).ModulesPath); - - if (mapOfModulesOfCurrentHost.find(moduleName) == - mapOfModulesOfCurrentHost.end()) + const vector& mapOfModulesOfCurrentHost = (((*it).second).ModulesList); + + bool erasedHost = false; + if( mapOfModulesOfCurrentHost.size() > 0 ){ + for(int i=0;i::const_iterator itt = find(mapOfModulesOfCurrentHost.begin(), + mapOfModulesOfCurrentHost.end(), + componentList[i]); + if (itt == mapOfModulesOfCurrentHost.end()){ + erasedHost = true; + break; + } + } + } + if(erasedHost) hosts.erase(iter); else iter++; @@ -805,27 +814,6 @@ SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer // --- set env vars - tempOutputFile << "source " << resInfo.PreReqFilePath << endl; - - for (map::const_iterator iter = resInfo.ModulesPath.begin(); - iter != resInfo.ModulesPath.end(); - iter++) - { - string curModulePath((*iter).second); - tempOutputFile << (*iter).first << "_ROOT_DIR=" << curModulePath << endl; - tempOutputFile << "export " << (*iter).first << "_ROOT_DIR" << endl; - tempOutputFile << "LD_LIBRARY_PATH=" << curModulePath - << "/lib/salome" << ":${LD_LIBRARY_PATH}" << endl; - tempOutputFile << "PYTHONPATH=" << curModulePath << "/bin/salome:" - << curModulePath << "/lib/salome:" << curModulePath - << "/lib/python${PYTHON_VERSION}/site-packages/salome:"; - tempOutputFile << curModulePath - << "/lib/python${PYTHON_VERSION}/site-packages/salome/shared_modules:${PYTHONPATH}" - << endl; - } - - tempOutputFile << "export LD_LIBRARY_PATH" << endl; - tempOutputFile << "export PYTHONPATH" << endl; tempOutputFile << "export SALOME_trace=local" << endl; // mkr : 27.11.2006 : PAL13967 - Distributed supervision graphs - Problem with "SALOME_trace" //tempOutputFile << "source " << resInfo.PreReqFilePath << endl; @@ -853,8 +841,7 @@ SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer #endif } - tempOutputFile << (*(resInfo.ModulesPath.find("KERNEL"))).second - << "/bin/salome/"; + tempOutputFile << getenv("KERNEL_ROOT_DIR") << "/bin/salome/"; if (params.isMPI) { diff --git a/src/ResourcesManager/SALOME_ResourcesManager.hxx b/src/ResourcesManager/SALOME_ResourcesManager.hxx index 0d9c65137..5cd696156 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.hxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.hxx @@ -65,7 +65,7 @@ class RESOURCESMANAGER_EXPORT SALOME_ResourcesManager std::vector GetFittingResources(const Engines::MachineParameters& params, - const char *moduleName) + const Engines::CompoList& componentList) throw(SALOME_Exception); std::string FindFirst(const Engines::MachineList& listOfMachines); @@ -86,8 +86,7 @@ class RESOURCESMANAGER_EXPORT SALOME_ResourcesManager int AddResourceInCatalog (const Engines::MachineParameters& paramsOfNewResources, - const std::map& modulesOnNewResources, - const char *environPathOfPrerequired, + const std::vector& modulesOnNewResources, const char *alias, const char *userName, AccessModeType mode, @@ -116,7 +115,7 @@ class RESOURCESMANAGER_EXPORT SALOME_ResourcesManager throw(SALOME_Exception); void KeepOnlyResourcesWithModule(std::vector& hosts, - const char *moduleName) const + const Engines::CompoList& componentList) const throw(SALOME_Exception); void AddOmninamesParams(std::string& command) const; diff --git a/src/SALOMELocalTrace/LocalTraceBufferPool.hxx b/src/SALOMELocalTrace/LocalTraceBufferPool.hxx index 85845ea2f..1575b186a 100644 --- a/src/SALOMELocalTrace/LocalTraceBufferPool.hxx +++ b/src/SALOMELocalTrace/LocalTraceBufferPool.hxx @@ -26,7 +26,7 @@ #define TRACE_BUFFER_SIZE 256 // number of entries in circular buffer // must be power of 2 -#define MAX_TRACE_LENGTH 256 // messages are truncated at this size +#define MAX_TRACE_LENGTH 1024 // messages are truncated at this size #include #include -- 2.39.2