From: Bernard Sécher Date: Tue, 28 Apr 2015 14:27:58 +0000 (+0200) Subject: Reduced dependencies on Launcher part. Removed SALOME_LAUNCHER_ONLY mode. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fbsr%2Flauncher;p=modules%2Fkernel.git Reduced dependencies on Launcher part. Removed SALOME_LAUNCHER_ONLY mode. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e86dea3be..ab2e7838e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,6 @@ CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" OFF CMAKE_DEPENDENT_OPTION(SALOME_USE_MPI "Use MPI containers" ${SALOME_USE_MPI} "NOT SALOME_LIGHT_ONLY" OFF) MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_LIBBATCH SALOME_USE_SIMAN SALOME_PACO_PARALLEL SALOME_USE_PORTMANAGER) -SET(SALOME_LAUNCHER_ONLY OFF) # deprecated option: Build only the Launcher part # Required prerequisites # Find "big" prerequisites first - they reference themselves many others @@ -206,52 +205,47 @@ INCLUDE(CMakePackageConfigHelpers) # List of targets in this project we want to make visible to the rest of the world. # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" -IF(SALOME_LAUNCHER_ONLY) - SET(_${PROJECT_NAME}_exposed_targets - SALOMEBasics ResourcesManager Launcher) -ELSE() - SET(_${PROJECT_NAME}_exposed_targets - SALOMEBasics SALOMELocalTrace SalomeHDFPersist OpUtil) +SET(_${PROJECT_NAME}_exposed_targets + SALOMEBasics SALOMELocalTrace SalomeHDFPersist OpUtil) - # CORBA specific targets: - IF(NOT SALOME_LIGHT_ONLY) +# CORBA specific targets: +IF(NOT SALOME_LIGHT_ONLY) + LIST(APPEND _${PROJECT_NAME}_exposed_targets + DF SalomeLoggerServer with_loggerTraceCollector SalomeNS SalomeGenericObj + Registry SalomeCatalog ResourcesManager SalomeResourcesManager + SalomeNotification SalomeContainer SalomeSDS Launcher SalomeLauncher + SalomeLifeCycleCORBA SalomeDSClient TOOLSDS SalomeKernelHelpers + SalomeDSImpl SalomeDS SalomeCommunication SalomeDSCContainer) + # Temporary solution for package src\DSC on windows + IF(NOT WIN32) LIST(APPEND _${PROJECT_NAME}_exposed_targets - DF SalomeLoggerServer with_loggerTraceCollector SalomeNS SalomeGenericObj - Registry SalomeCatalog ResourcesManager SalomeResourcesManager - SalomeNotification SalomeContainer SalomeSDS Launcher SalomeLauncher - SalomeLifeCycleCORBA SalomeDSClient TOOLSDS SalomeKernelHelpers - SalomeDSImpl SalomeDS SalomeCommunication SalomeDSCContainer) - # Temporary solution for package src\DSC on windows - IF(NOT WIN32) - LIST(APPEND _${PROJECT_NAME}_exposed_targets - CalciumC SalomeCalcium SalomeDatastream SalomePalm SalomeDSCSupervBasic - SalomeDSCSuperv) - IF(SALOME_PACO_PARALLEL) - LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeParallelDSCContainer) - ENDIF() + CalciumC SalomeCalcium SalomeDatastream SalomePalm SalomeDSCSupervBasic + SalomeDSCSuperv) + IF(SALOME_PACO_PARALLEL) + LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeParallelDSCContainer) ENDIF() ENDIF() +ENDIF() - # MPI specific targets: - IF(SALOME_USE_MPI) - LIST(APPEND _${PROJECT_NAME}_exposed_targets - SalomeMPIContainer SalomeTestMPIComponentEngine) - ENDIF() +# MPI specific targets: +IF(SALOME_USE_MPI) + LIST(APPEND _${PROJECT_NAME}_exposed_targets + SalomeMPIContainer SalomeTestMPIComponentEngine) +ENDIF() - # Test targets: - IF(SALOME_BUILD_TESTS) - LIST(APPEND _${PROJECT_NAME}_exposed_targets SALOMELocalTraceTest UnitTests) - IF(NOT SALOME_LIGHT_ONLY) - LIST(APPEND _${PROJECT_NAME}_exposed_targets - SALOMETraceCollectorTest UtilsTest NamingServiceTest SalomeTestComponentEngine - LifeCycleCORBATest SalomeKernelHelpersTest SALOMEDSImplTest SALOMEDSTest) - ENDIF() +# Test targets: +IF(SALOME_BUILD_TESTS) + LIST(APPEND _${PROJECT_NAME}_exposed_targets SALOMELocalTraceTest UnitTests) + IF(NOT SALOME_LIGHT_ONLY) + LIST(APPEND _${PROJECT_NAME}_exposed_targets + SALOMETraceCollectorTest UtilsTest NamingServiceTest SalomeTestComponentEngine + LifeCycleCORBATest SalomeKernelHelpersTest SALOMEDSImplTest SALOMEDSTest) ENDIF() +ENDIF() - # PACO specific targets: - IF(SALOME_PACO_PARALLEL) - LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeParallelContainer) - ENDIF() +# PACO specific targets: +IF(SALOME_PACO_PARALLEL) + LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeParallelContainer) ENDIF() IF(NOT SALOME_LIGHT_ONLY) diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index e2e042cd8..f62bd4e81 100755 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -26,10 +26,8 @@ INSTALL(FILES CatalogModulePersonnel.xml_skel DESTINATION ${SALOME_KERNEL_INSTAL SALOME_CONFIGURE_FILE(CatalogResources.xml.in CatalogResources.xml INSTALL ${SALOME_KERNEL_INSTALL_RES_DATA}) -IF(NOT SALOME_LAUNCHER_ONLY) - INSTALL(FILES channel.cfg SALOMEDS_Resources DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) - SALOME_CONFIGURE_FILE(KERNELCatalog.xml.in KERNELCatalog.xml INSTALL ${SALOME_KERNEL_INSTALL_RES_DATA}) -ENDIF() +INSTALL(FILES channel.cfg SALOMEDS_Resources DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) +SALOME_CONFIGURE_FILE(KERNELCatalog.xml.in KERNELCatalog.xml INSTALL ${SALOME_KERNEL_INSTALL_RES_DATA}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0303f3840..9a028e422 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -75,28 +75,24 @@ SET(SUBDIR_CPPUNIT_CORBA ) SET(SUBDIR_CPPUNIT_GENERAL UnitTests) -IF(SALOME_LAUNCHER_ONLY) - SET(SUBDIRS Basics ResourcesManager Launcher) -ELSE() - SET(SUBDIRS ${SUBDIR_BASE}) - IF(NOT SALOME_LIGHT_ONLY) - LIST(APPEND SUBDIRS ${SUBDIR_CORBA}) - ENDIF() +SET(SUBDIRS ${SUBDIR_BASE}) +IF(NOT SALOME_LIGHT_ONLY) + LIST(APPEND SUBDIRS ${SUBDIR_CORBA}) +ENDIF() - IF(SALOME_USE_MPI) - LIST(APPEND SUBDIRS ${SUBDIR_MPI}) - ENDIF(SALOME_USE_MPI) +IF(SALOME_USE_MPI) + LIST(APPEND SUBDIRS ${SUBDIR_MPI}) +ENDIF(SALOME_USE_MPI) - IF(SALOME_BUILD_TESTS) - LIST(APPEND SUBDIRS ${SUBDIR_CPPUNIT_BASE} ${SUBDIR_CPPUNIT_GENERAL}) - IF(NOT SALOME_LIGHT_ONLY) - LIST(APPEND SUBDIRS ${SUBDIR_CPPUNIT_CORBA}) - ENDIF() +IF(SALOME_BUILD_TESTS) + LIST(APPEND SUBDIRS ${SUBDIR_CPPUNIT_BASE} ${SUBDIR_CPPUNIT_GENERAL}) + IF(NOT SALOME_LIGHT_ONLY) + LIST(APPEND SUBDIRS ${SUBDIR_CPPUNIT_CORBA}) ENDIF() +ENDIF() - IF(SALOME_PACO_PARALLEL) - LIST(APPEND SUBDIRS ${SUBDIR_PARALLEL}) - ENDIF() +IF(SALOME_PACO_PARALLEL) + LIST(APPEND SUBDIRS ${SUBDIR_PARALLEL}) ENDIF() # For salome test @@ -109,4 +105,4 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileInstall.cmake FOREACH(_dir ${SUBDIRS}) ADD_SUBDIRECTORY(${_dir}) -ENDFOREACH() \ No newline at end of file +ENDFOREACH() diff --git a/src/Launcher/CMakeLists.txt b/src/Launcher/CMakeLists.txt index 6f9ea884e..2215a729a 100755 --- a/src/Launcher/CMakeLists.txt +++ b/src/Launcher/CMakeLists.txt @@ -26,7 +26,6 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIR} - ${MPI_CXX_INCLUDE_PATH} ${LIBBATCH_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/salome_adm ${CMAKE_CURRENT_SOURCE_DIR}/../Basics @@ -41,7 +40,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/idl ) -ADD_DEFINITIONS(${MPI_DEFINITIONS} ${LIBXML2_DEFINITIONS} ${OMNIORB_DEFINITIONS}) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${OMNIORB_DEFINITIONS}) IF(SALOME_USE_LIBBATCH) ADD_DEFINITIONS(-DWITH_LIBBATCH) ENDIF(SALOME_USE_LIBBATCH) @@ -58,7 +57,6 @@ SET(COMMON_LIBS SALOMEBasics SalomeIDLKernel ${LIBBATCH_LIBRARIES} - ${MPI_CXX_LIBRARIES} ${OMNIORB_LIBRARIES} ${LIBXML2_LIBRARIES} ${PYTHON_LIBRARIES} @@ -77,43 +75,40 @@ SET(Launcher_SOURCES ) ADD_LIBRARY(Launcher ${Launcher_SOURCES}) -TARGET_LINK_LIBRARIES(Launcher ResourcesManager ${LIBBATCH_LIBRARIES} ${MPI_CXX_LIBRARIES} ${LIBXML2_LIBS}) +TARGET_LINK_LIBRARIES(Launcher ResourcesManager ${LIBBATCH_LIBRARIES} ${LIBXML2_LIBS}) INSTALL(TARGETS Launcher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) SET(TestLauncher_LIBS ${LIBXML2_LIBRARIES} ResourcesManager Launcher - OpUtil ${LIBBATCH_LIBRARIES} ) +# TestLauncher needs only (and must need only) libxml, libbatch, ResourceManager and Launcher libraries! ADD_EXECUTABLE(TestLauncher TestLauncher.cxx) TARGET_LINK_LIBRARIES(TestLauncher ${TestLauncher_LIBS}) INSTALL(TARGETS TestLauncher DESTINATION ${SALOME_INSTALL_BINS}) -IF(NOT SALOME_LAUNCHER_ONLY) - ADD_LIBRARY(SalomeLauncher BatchTest.cxx SALOME_Launcher.cxx) - TARGET_LINK_LIBRARIES(SalomeLauncher Launcher ${COMMON_LIBS}) - INSTALL(TARGETS SalomeLauncher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +ADD_LIBRARY(SalomeLauncher BatchTest.cxx SALOME_Launcher.cxx) +TARGET_LINK_LIBRARIES(SalomeLauncher Launcher ${COMMON_LIBS}) +INSTALL(TARGETS SalomeLauncher EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - SET(SALOME_LauncherServer_LIBS - Launcher - SalomeLauncher - SalomeSDS - SALOMEBasics - SALOMELocalTrace - ${LIBBATCH_LIBRARIES} - ${MPI_CXX_LIBRARIES} - ${OMNIORB_LIBRARIES} - ${LIBXML2_LIBRARIES} - ${PYTHON_LIBRARIES} - ) +SET(SALOME_LauncherServer_LIBS + Launcher + SalomeLauncher + SalomeSDS + SALOMEBasics + SALOMELocalTrace + ${LIBBATCH_LIBRARIES} + ${OMNIORB_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${PYTHON_LIBRARIES} +) - ADD_EXECUTABLE(SALOME_LauncherServer SALOME_LauncherServer.cxx) - TARGET_LINK_LIBRARIES(SALOME_LauncherServer ${SALOME_LauncherServer_LIBS}) - INSTALL(TARGETS SALOME_LauncherServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) -ENDIF() +ADD_EXECUTABLE(SALOME_LauncherServer SALOME_LauncherServer.cxx) +TARGET_LINK_LIBRARIES(SALOME_LauncherServer ${SALOME_LauncherServer_LIBS}) +INSTALL(TARGETS SALOME_LauncherServer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS}) SET(COMMON_HEADERS_HXX BatchTest.hxx @@ -129,3 +124,4 @@ SET(COMMON_HEADERS_HXX SALOME_Launcher_defs.hxx ) INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS}) +INSTALL(FILES testLauncher.xml DESTINATION ${SALOME_KERNEL_INSTALL_RES_DATA}) diff --git a/src/Launcher/TestLauncher.cxx b/src/Launcher/TestLauncher.cxx index 56f776557..fe7655cd2 100755 --- a/src/Launcher/TestLauncher.cxx +++ b/src/Launcher/TestLauncher.cxx @@ -18,14 +18,24 @@ // #include "Launcher.hxx" +#include +#include int main(int argc, char** argv) { + std::string xmlfile(""); try { Launcher_cpp *lcpp = new Launcher_cpp(); ResourcesManager_cpp *rcpp = new ResourcesManager_cpp(); lcpp->SetResourcesManager(rcpp); + if(!getenv("KERNEL_ROOT_DIR")) + throw ResourcesException("you must define KERNEL_ROOT_DIR environment variable!! -> cannot load testLauncher.xml"); + xmlfile = getenv("KERNEL_ROOT_DIR"); + xmlfile += "/share/salome/resources/kernel/testLauncher.xml"; + + long jobid = lcpp->createJobWithFile(xmlfile.c_str(),"localhost"); + lcpp->launchJob(jobid); delete lcpp; delete rcpp; std::cout << "test OK" << std::endl; diff --git a/src/Launcher/testLauncher.xml b/src/Launcher/testLauncher.xml new file mode 100644 index 000000000..6dc2ca300 --- /dev/null +++ b/src/Launcher/testLauncher.xml @@ -0,0 +1,10 @@ +
+ + localhost + + 1 + testLauncher.output + ls > testLauncher.output +
+ + diff --git a/src/ResourcesManager/CMakeLists.txt b/src/ResourcesManager/CMakeLists.txt index e03e9754f..d91f687d2 100755 --- a/src/ResourcesManager/CMakeLists.txt +++ b/src/ResourcesManager/CMakeLists.txt @@ -49,21 +49,19 @@ SET(ResourcesManager_SOURCES ADD_DEFINITIONS(${OMNIORB_DEFINITIONS} ${LIBXML2_DEFINITIONS}) ADD_LIBRARY(ResourcesManager ${ResourcesManager_SOURCES}) -TARGET_LINK_LIBRARIES(ResourcesManager SALOMEBasics OpUtil ${LIBXML2_LIBRARIES}) +TARGET_LINK_LIBRARIES(ResourcesManager SALOMEBasics ${LIBXML2_LIBRARIES}) INSTALL(TARGETS ResourcesManager EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -IF(NOT SALOME_LAUNCHER_ONLY) - SET(SalomeResourcesManager_SOURCES - SALOME_ResourcesManager.cxx - SALOME_ResourcesManager_Client.cxx - SALOME_ResourcesManager_Common.cxx - ) - ADD_LIBRARY(SalomeResourcesManager ${SalomeResourcesManager_SOURCES}) - TARGET_LINK_LIBRARIES(SalomeResourcesManager ResourcesManager ${COMMON_LIBS}) - INSTALL(TARGETS SalomeResourcesManager EXPORT ${PROJECT_NAME}TargetGroup +SET(SalomeResourcesManager_SOURCES + SALOME_ResourcesManager.cxx + SALOME_ResourcesManager_Client.cxx + SALOME_ResourcesManager_Common.cxx +) +ADD_LIBRARY(SalomeResourcesManager ${SalomeResourcesManager_SOURCES}) +TARGET_LINK_LIBRARIES(SalomeResourcesManager ResourcesManager ${COMMON_LIBS}) +INSTALL(TARGETS SalomeResourcesManager EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -ENDIF() SET(COMMON_HEADERS_HXX ResourcesManager.hxx diff --git a/src/ResourcesManager/ResourcesManager.cxx b/src/ResourcesManager/ResourcesManager.cxx index c90c6019d..484b856b7 100644 --- a/src/ResourcesManager/ResourcesManager.cxx +++ b/src/ResourcesManager/ResourcesManager.cxx @@ -39,8 +39,6 @@ #include -#include "Utils_SALOME_Exception.hxx" - #define MAX_SIZE_FOR_HOSTNAME 256; using namespace std; @@ -328,9 +326,10 @@ ResourcesManager_cpp::GetFittingResources(const resourceParams& params) throw(Re void ResourcesManager_cpp::AddResourceInCatalog(const ParserResourcesType & new_resource) { - if (new_resource.Name == DEFAULT_RESOURCE_NAME) - throw SALOME_Exception((string("Cannot modify default local resource \"") + - DEFAULT_RESOURCE_NAME + "\"").c_str()); + if (new_resource.Name == DEFAULT_RESOURCE_NAME){ + std::string error("Cannot modify default local resource \"" + DEFAULT_RESOURCE_NAME + "\""); + throw ResourcesException(error); + } // TODO - Add minimal check _resourcesList[new_resource.Name] = new_resource; } @@ -343,9 +342,10 @@ ResourcesManager_cpp::AddResourceInCatalog(const ParserResourcesType & new_resou void ResourcesManager_cpp::DeleteResourceInCatalog(const char * name) { - if (DEFAULT_RESOURCE_NAME == name) - throw SALOME_Exception((string("Cannot delete default local resource \"") + - DEFAULT_RESOURCE_NAME + "\"").c_str()); + if (DEFAULT_RESOURCE_NAME == name){ + std::string error("Cannot delete default local resource \"" + DEFAULT_RESOURCE_NAME + "\""); + throw ResourcesException(error); + } MapOfParserResourcesType_it it = _resourcesList.find(name); if (it != _resourcesList.end()) _resourcesList.erase(name); diff --git a/src/ResourcesManager/ResourcesManager.hxx b/src/ResourcesManager/ResourcesManager.hxx index 670f50d27..948f20d22 100644 --- a/src/ResourcesManager/ResourcesManager.hxx +++ b/src/ResourcesManager/ResourcesManager.hxx @@ -66,14 +66,6 @@ struct RESOURCESMANAGER_EXPORT resourceParams std::vector resourceList; }; -class RESOURCESMANAGER_EXPORT ResourcesException -{ -public: - const std::string msg; - - ResourcesException(const std::string m) : msg(m) {} -}; - class RESOURCESMANAGER_EXPORT ResourcesManager_cpp { diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index b35613a34..2c138d2da 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -28,7 +28,6 @@ // #include "SALOME_ResourcesCatalog_Handler.hxx" #include "Basics_Utils.hxx" -#include "Utils_SALOME_Exception.hxx" #include #include #include @@ -291,7 +290,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMember(xmlNodePtr member_descr, ParserRe { resource.setAccessProtocolTypeStr((const char *)protocol); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl; @@ -313,7 +312,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMember(xmlNodePtr member_descr, ParserRe { resource.setClusterInternalProtocolStr((const char *)iprotocol); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning found a machine with a bad protocol" << std::endl; std::cerr << "SALOME_ResourcesCatalog_Handler::ProcessMember : Warning this machine will not be added" << std::endl; @@ -463,7 +462,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setResourceTypeStr((const char*)type); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { cerr << "Warning, invalid type \"" << (const char*)type << "\" for resource \"" << resource.Name << "\", using default value \"" << resource.getResourceTypeStr() << @@ -498,7 +497,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setAccessProtocolTypeStr((const char *)protocol); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { cerr << "Warning, invalid protocol \"" << (const char*)protocol << "\" for resource \"" << resource.Name << "\", using default value \"" << @@ -514,7 +513,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setClusterInternalProtocolStr((const char *)iprotocol); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { cerr << "Warning, invalid internal protocol \"" << (const char*)iprotocol << "\" for resource \"" << resource.Name << "\", using default value \"" << @@ -532,7 +531,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setBatchTypeStr((const char *)batch); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { cerr << "Warning, invalid batch manager \"" << (const char*)batch << "\" for resource \"" << resource.Name << "\", using default value \"" << @@ -548,7 +547,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setMpiImplTypeStr((const char *)mpi); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { cerr << "Warning, invalid MPI implementation \"" << (const char*)mpi << "\" for resource \"" << resource.Name << "\", using default value \"" << @@ -613,7 +612,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setCanLaunchBatchJobsStr((const char *)can_launch_batch_jobs); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { cerr << "Warning, invalid can_launch_batch_jobs parameter value \"" << (const char*)can_launch_batch_jobs << "\" for resource \"" << resource.Name << @@ -629,7 +628,7 @@ SALOME_ResourcesCatalog_Handler::ProcessMachine(xmlNodePtr machine_descr, Parser { resource.setCanRunContainersStr((const char *)can_run_containers); } - catch (const SALOME_Exception & e) + catch (const ResourcesException & e) { cerr << "Warning, invalid can_run_containers parameter value \"" << (const char*)can_run_containers << "\" for resource \"" << resource.Name << diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx index 799798c91..896834528 100644 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx @@ -21,7 +21,6 @@ // #include "SALOME_ResourcesCatalog_Parser.hxx" -#include "Utils_SALOME_Exception.hxx" #include #include @@ -170,7 +169,7 @@ std::string ParserResourcesType::protocolToString(AccessProtocolType protocol) case blaunch: return "blaunch"; default: - throw SALOME_Exception("Unknown protocol"); + throw ResourcesException("Unknown protocol"); } } @@ -189,7 +188,7 @@ AccessProtocolType ParserResourcesType::stringToProtocol(const std::string & pro else if (protocolStr == "blaunch") return blaunch; else - throw SALOME_Exception((string("Unknown protocol ") + protocolStr).c_str()); + throw ResourcesException((string("Unknown protocol ") + protocolStr).c_str()); } ostream & operator<<(ostream &os, const ParserResourcesType &prt) @@ -249,7 +248,7 @@ ParserResourcesType::getResourceTypeStr() const case single_machine: return "single_machine"; default: - throw SALOME_Exception("Unknown resource type"); + throw ResourcesException("Unknown resource type"); } } @@ -279,7 +278,7 @@ ParserResourcesType::getBatchTypeStr() const case coorm: return "coorm"; default: - throw SALOME_Exception("Unknown batch type"); + throw ResourcesException("Unknown batch type"); } } @@ -305,7 +304,7 @@ ParserResourcesType::getMpiImplTypeStr() const case prun: return "prun"; default: - throw SALOME_Exception("Unknown MPI implementation type"); + throw ResourcesException("Unknown MPI implementation type"); } } @@ -331,7 +330,7 @@ void ParserResourcesType::setResourceTypeStr(const string & resourceTypeStr) else if (resourceTypeStr == "single_machine") type = single_machine; else - throw SALOME_Exception((string("Unknown resource type ") + resourceTypeStr).c_str()); + throw ResourcesException((string("Unknown resource type ") + resourceTypeStr).c_str()); } void ParserResourcesType::setBatchTypeStr(const string & batchTypeStr) @@ -357,7 +356,7 @@ void ParserResourcesType::setBatchTypeStr(const string & batchTypeStr) else if (batchTypeStr == "" || batchTypeStr == "none" || batchTypeStr == "ssh_batch") Batch = none; else - throw SALOME_Exception((string("Unknown batch type ") + batchTypeStr).c_str()); + throw ResourcesException((string("Unknown batch type ") + batchTypeStr).c_str()); } void ParserResourcesType::setMpiImplTypeStr(const string & mpiImplTypeStr) @@ -379,7 +378,7 @@ void ParserResourcesType::setMpiImplTypeStr(const string & mpiImplTypeStr) else if (mpiImplTypeStr == "" || mpiImplTypeStr == "no mpi") mpi = nompi; else - throw SALOME_Exception((string("Unknown MPI implementation type ") + mpiImplTypeStr).c_str()); + throw ResourcesException((string("Unknown MPI implementation type ") + mpiImplTypeStr).c_str()); } void ParserResourcesType::setClusterInternalProtocolStr(const string & internalProtocolTypeStr) @@ -394,7 +393,7 @@ void ParserResourcesType::setCanLaunchBatchJobsStr(const string & canLaunchBatch else if (canLaunchBatchJobsStr == "false") can_launch_batch_jobs = false; else - throw SALOME_Exception((string("Invalid boolean value for can_launch_batch_jobs: ") + + throw ResourcesException((string("Invalid boolean value for can_launch_batch_jobs: ") + canLaunchBatchJobsStr).c_str()); } @@ -405,6 +404,6 @@ void ParserResourcesType::setCanRunContainersStr(const string & canRunContainers else if (canRunContainersStr == "false") can_run_containers = false; else - throw SALOME_Exception((string("Invalid boolean value for can_run_containers: ") + + throw ResourcesException((string("Invalid boolean value for can_run_containers: ") + canRunContainersStr).c_str()); } diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx index 9688367ca..9989e64ff 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx @@ -49,6 +49,14 @@ enum BatchType {none, pbs, lsf, sge, ccc, ll, slurm, vishnu, oar, coorm}; enum MpiImplType {nompi, lam, mpich1, mpich2, openmpi, ompi, slurmmpi, prun}; +class RESOURCESMANAGER_EXPORT ResourcesException +{ +public: + const std::string msg; + + ResourcesException(const std::string m) : msg(m) {} +}; + class RESOURCESMANAGER_EXPORT ResourceDataToSort {