]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Reduced dependencies on Launcher part. Removed SALOME_LAUNCHER_ONLY mode.
authorBernard Sécher <bernard.secher@cea.fr>
Tue, 28 Apr 2015 14:27:58 +0000 (16:27 +0200)
committervsr <vsr@opencascade.com>
Wed, 29 Apr 2015 07:34:41 +0000 (10:34 +0300)
12 files changed:
CMakeLists.txt
resources/CMakeLists.txt
src/CMakeLists.txt
src/Launcher/CMakeLists.txt
src/Launcher/TestLauncher.cxx
src/Launcher/testLauncher.xml [new file with mode: 0644]
src/ResourcesManager/CMakeLists.txt
src/ResourcesManager/ResourcesManager.cxx
src/ResourcesManager/ResourcesManager.hxx
src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Parser.cxx
src/ResourcesManager/SALOME_ResourcesCatalog_Parser.hxx

index e86dea3bec93ae86589a669b0d977b3f92163d09..ab2e7838ee240c55416d685ccfcda8613c5436d4 100755 (executable)
@@ -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)
index e2e042cd840fb7d3562ced054af451a843669b66..f62bd4e81d9c56cda33634dfded1bbc9337fb9de 100755 (executable)
@@ -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})
 
 
 
index 0303f3840be8873f3c367e4ad55d6fa647ce253a..9a028e422ecd92467ee9f93b6b7b8450ea359e17 100755 (executable)
@@ -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()
index 6f9ea884e0a6cc0bfcc19b8153bdf8aa560248a9..2215a729a43bf890845fb7ded26996d03d2ac936 100755 (executable)
@@ -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})
index 56f77655740b36f77bbe059f216ea08e56a76dbd..fe7655cd2f360f26d7340145b377fae139a26d7e 100755 (executable)
 //
 
 #include "Launcher.hxx"
+#include <iostream>
+#include <string>
 
 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 (file)
index 0000000..6dc2ca3
--- /dev/null
@@ -0,0 +1,10 @@
+<main>
+ <machine-list>
+   <machine work-directory="/tmp/testLauncher">localhost</machine>
+ </machine-list>
+ <nb-processes>1</nb-processes>
+ <output-file>testLauncher.output</output-file>
+ <command>ls > testLauncher.output</command>
+</main>
+
+
index e03e9754f33e489c0e657296daff3edd63633789..d91f687d20b26fd4c26c5f786384869c61a3821d 100755 (executable)
@@ -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
index c90c6019d095517e19b2c59259f1c66c526e8167..484b856b7f1b3655e554d9517ec16eb96c365bb2 100644 (file)
@@ -39,8 +39,6 @@
 
 #include <algorithm>
 
-#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);
index 670f50d27aed8d71c501ac4539d630aca1e13202..948f20d2239424e8d1131508b5b7a18ff00d89c1 100644 (file)
@@ -66,14 +66,6 @@ struct RESOURCESMANAGER_EXPORT resourceParams
   std::vector<std::string> resourceList;
 };
 
-class RESOURCESMANAGER_EXPORT ResourcesException
-{
-public:
-  const std::string msg;
-
-  ResourcesException(const std::string m) : msg(m) {}
-};
-
 class RESOURCESMANAGER_EXPORT ResourcesManager_cpp
   {
 
index b35613a34ae1d8c1c1e2d11fe41b1e1884526d8e..2c138d2da2dd0ab7b4bf14d1c6fc8cb3932ddec9 100755 (executable)
@@ -28,7 +28,6 @@
 //
 #include "SALOME_ResourcesCatalog_Handler.hxx"
 #include "Basics_Utils.hxx"
-#include "Utils_SALOME_Exception.hxx"
 #include <iostream>
 #include <sstream>
 #include <map>
@@ -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 <<
index 799798c91aa759ecef7fa3a9b172657d50d74e2a..8968345283649bb5d84e82760998bf8bdc91b26c 100644 (file)
@@ -21,7 +21,6 @@
 //
 
 #include "SALOME_ResourcesCatalog_Parser.hxx"
-#include "Utils_SALOME_Exception.hxx"
 #include <iostream>
 #include <sstream>
 
@@ -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());
 }
index 9688367ca0a7d3de5e33978561c9e691179677d2..9989e64ff0492b6eb3fa3b230a1f7668038ae1c9 100755 (executable)
@@ -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
   {