]> SALOME platform Git repositories - tools/libbatch.git/blobdiff - src/Local/Batch_FactBatchManager_Local.cxx
Salome HOME
deactivate rlimits for jobs launched with BatchManager_Local (fix bug PAL #2354)
[tools/libbatch.git] / src / Local / Batch_FactBatchManager_Local.cxx
index 46fb1302ff7838ebcedd0e5c84feb14b1f3edcf7..16f6f47f33fd0b0aec3baf481e822f29d3134d38 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
  * Date   : Septembre 2004
  * Projet : SALOME 2
  *
+ * Refactored by Renaud Barate (EDF R&D) in September 2009 to use
+ * CommunicationProtocol classes and merge Local_SH, Local_RSH and Local_SSH batch
+ * managers.
+ *
  */
 
-#include <string>
+#include <Batch_config.h>
+
 #include "Batch_BatchManager_Local.hxx"
 #include "Batch_FactBatchManager_Local.hxx"
-//#include "utilities.h"
 
 namespace Batch {
 
-//   static FactBatchManager_Local sFBM_Local;
+#ifdef HAS_SH
+  static FactBatchManager_Local sFBM_Local_SH("SH", SH);
+#endif
+
+#ifdef HAS_RSH
+  static FactBatchManager_Local sFBM_Local_RSH("RSH", RSH);
+#endif
+
+#ifdef HAS_SSH
+  static FactBatchManager_Local sFBM_Local_SSH("SSH", SSH);
+#endif
 
   // Constructeur
-  FactBatchManager_Local::FactBatchManager_Local() : FactBatchManager("Local")
+  FactBatchManager_Local::FactBatchManager_Local(const char * name,
+                                                 CommunicationProtocolType protocolType)
+    : FactBatchManager(name),
+      _protocolType(protocolType)
   {
     // Nothing to do
   }
@@ -50,11 +67,10 @@ namespace Batch {
   }
 
   // Functor
-//   BatchManager * FactBatchManager_Local::operator() (const char * hostname) const
-//   {
-//     // MESSAGE("Building new BatchManager_Local on host '" << hostname << "'");
-//     return new BatchManager_Local(this, hostname);
-//   }
-
+  BatchManager * FactBatchManager_Local::operator() (const char * hostname) const
+  {
+    // MESSAGE("Building new BatchManager_Local on host '" << hostname << "'");
+    return new BatchManager_Local(this, hostname, _protocolType);
+  }
 
 }