Salome HOME
updated copyright message
[modules/kernel.git] / src / ResourcesManager / SALOME_ResourcesCatalog_Parser.cxx
index 38d312ff19f9aeabc05633fe452bcf8b2ccec198..037297f17830b2f0166b73492098c351894f1b00 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -21,7 +21,6 @@
 //
 
 #include "SALOME_ResourcesCatalog_Parser.hxx"
-#include "Utils_SALOME_Exception.hxx"
 #include <iostream>
 #include <sstream>
 
@@ -133,9 +132,9 @@ void ResourceDataToSort::Print() const
 
 
 ParserResourcesType::ParserResourcesType()
-: type(single_machine),
-  Protocol(ssh),
+: Protocol(ssh),
   ClusterInternalProtocol(ssh),
+  type(single_machine),
   Batch(none),
   mpi(nompi),
   nbOfProc(1),
@@ -169,8 +168,10 @@ std::string ParserResourcesType::protocolToString(AccessProtocolType protocol)
     return "pbsdsh";
   case blaunch:
     return "blaunch";
+  case rsync:
+    return "rsync";
   default:
-    throw SALOME_Exception("Unknown protocol");
+    throw ResourcesException("Unknown protocol");
   }
 }
 
@@ -188,8 +189,10 @@ AccessProtocolType ParserResourcesType::stringToProtocol(const std::string & pro
     return pbsdsh;
   else if (protocolStr == "blaunch")
     return blaunch;
+  else if (protocolStr == "rsync")
+    return rsync;
   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 +252,7 @@ ParserResourcesType::getResourceTypeStr() const
   case single_machine:
     return "single_machine";
   default:
-    throw SALOME_Exception("Unknown resource type");
+    throw ResourcesException("Unknown resource type");
   }
 }
 
@@ -279,7 +282,7 @@ ParserResourcesType::getBatchTypeStr() const
   case coorm:
     return "coorm";
   default:
-    throw SALOME_Exception("Unknown batch type");
+    throw ResourcesException("Unknown batch type");
   }
 }
 
@@ -305,7 +308,7 @@ ParserResourcesType::getMpiImplTypeStr() const
   case prun:
     return "prun";
   default:
-    throw SALOME_Exception("Unknown MPI implementation type");
+    throw ResourcesException("Unknown MPI implementation type");
   }
 }
 
@@ -331,7 +334,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 +360,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 +382,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 +397,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 +408,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());
 }