Salome HOME
Merge class BatchManager_eClient into class BatchManager
[tools/libbatch.git] / src / Core / Batch_BatchManager.hxx
index 1deb9ff2cc5c638e6771381b9eac9a76c5391447..12086f7b03560d0a944a6deb68a60514d17755a5 100644 (file)
@@ -39,6 +39,8 @@
 #include "Batch_JobId.hxx"
 #include "Batch_JobInfo.hxx"
 #include "Batch_InvalidArgumentException.hxx"
+#include "Batch_CommunicationProtocol.hxx"
+#include "Batch_MpiImpl.hxx"
 
 namespace Batch {
 
@@ -51,8 +53,9 @@ namespace Batch {
   {
   public:
     // Constructeur et destructeur
-    //BatchManager(std::string host="localhost") throw(InvalidArgumentException); // connexion a la machine host
-    BatchManager(const Batch::FactBatchManager * parent, const char * host="localhost") throw(InvalidArgumentException); // connexion a la machine host
+    BatchManager(const Batch::FactBatchManager * parent, const char * host = "localhost",
+                 const char * username = "",
+                 CommunicationProtocolType protocolType = SSH, const char * mpiImpl = "nompi");
     virtual ~BatchManager();
     virtual std::string __repr__() const;
 
@@ -72,12 +75,23 @@ namespace Batch {
     virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference) = 0; // ajoute un nouveau job sans le soumettre
     virtual std::string waitForJobEnd(const Batch::JobId & jobid, long timeout = -1,
                                       long initSleepTime = 1, long maxSleepTime = 600);
+    virtual void importOutputFiles( const Job & job, const std::string directory );
+    bool importDumpStateFile( const Job & job, const std::string directory );
+
+    // Get the underlying communication protocol
+    const CommunicationProtocol & getProtocol() const;
 
   protected:
     std::string _hostname; // serveur ou tourne le BatchManager
     // std::map< const std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
     std::map< std::string, const Batch::JobId * > jobid_map; // table des jobs deja soumis
     const Batch::FactBatchManager * _parent;
+    const CommunicationProtocol & _protocol; // protocol to access _hostname
+    const std::string _username; // username to access _hostname
+    MpiImpl *_mpiImpl; // Mpi implementation to launch executable in batch script
+
+    MpiImpl* FactoryMpiImpl(std::string mpiImpl);
+    void exportInputFiles(const Job & job);
 
   private: