Salome HOME
- Add a new method for resuming jobs
authorribes <ribes>
Fri, 23 Jul 2010 11:33:40 +0000 (11:33 +0000)
committerribes <ribes>
Fri, 23 Jul 2010 11:33:40 +0000 (11:33 +0000)
- Add a new method in eClient for username (we need to modify all eClient
    to use param['USER'])

19 files changed:
src/CCC/Batch_BatchManager_eCCC.cxx
src/CCC/Batch_BatchManager_eCCC.hxx
src/Core/Batch_BatchManager.hxx
src/Core/Batch_BatchManager_eClient.cxx
src/Core/Batch_BatchManager_eClient.hxx
src/Core/Batch_JobId.cxx
src/Core/Batch_JobId.hxx
src/LSF/Batch_BatchManager_LSF.cxx
src/LSF/Batch_BatchManager_LSF.hxx
src/LSF/Batch_BatchManager_eLSF.cxx
src/LSF/Batch_BatchManager_eLSF.hxx
src/Local/Batch_BatchManager_Local.cxx
src/Local/Batch_BatchManager_Local.hxx
src/PBS/Batch_BatchManager_PBS.cxx
src/PBS/Batch_BatchManager_PBS.hxx
src/PBS/Batch_BatchManager_ePBS.cxx
src/PBS/Batch_BatchManager_ePBS.hxx
src/SGE/Batch_BatchManager_eSGE.cxx
src/SGE/Batch_BatchManager_eSGE.hxx

index c476002de5d843367c5c036e58af70b4389d2f57..fe2d9e399bf54c6590de4d2b533893fdcee847c7 100644 (file)
@@ -125,6 +125,13 @@ namespace Batch {
     return id;
   }
 
+  // Ce manager permet de faire de la reprise
+  const Batch::JobId
+  BatchManager_eCCC::addJob(const Batch::Job & job, const std::string reference)
+  {
+    return JobId(this, reference);
+  }
+
   // Methode pour le controle des jobs : retire un job du gestionnaire
   void BatchManager_eCCC::deleteJob(const JobId & jobid)
   {
index 5a149a5e7361b8b4490afb58c67b068d9ffa45ae..9548267695aba8ed1db50d0f333bc5ebcce539f8 100644 (file)
@@ -65,6 +65,7 @@ namespace Batch {
     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
 
+    virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference); // ajoute un nouveau job sans le soumettre
 
   protected:
     void buildBatchScript(const Job & job);
index d19a183ea213b014ec93b42f2d10d9385090d425..2974d81bb4f4168adda1debe2b5613353d6f8973 100644 (file)
@@ -69,6 +69,7 @@ namespace Batch {
     virtual void alterJob(const Batch::JobId & jobid, const Batch::Parametre & param) = 0; // modifie un job en file d'attente
     virtual void alterJob(const Batch::JobId & jobid, const Batch::Environnement & env) = 0; // modifie un job en file d'attente
     virtual Batch::JobInfo queryJob(const Batch::JobId & jobid) = 0; // renvoie l'etat du job
+    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);
 
index 83716f148c00a7ec5a0e5b63a58ccd1b6d9e9bac..1a6a488a952ffb8d5bfc5089c8b2e384cef42c7b 100644 (file)
@@ -81,7 +81,6 @@ namespace Batch {
     Parametre params = job.getParametre();
     Versatile V = params[INFILE];
     Versatile::iterator Vit;
-    _username = string(params[USER]);
 
     status = _protocol.makeDirectory(string(params[TMPDIR]) + "/logs", _hostname, _username);
     if(status) {
index 7641ec9ea1eac42b842f7d1791ed901d43ef1d8d..188a2df7158f664e478f8ae87989da0ba0bdb179 100644 (file)
@@ -53,6 +53,8 @@ namespace Batch {
     virtual ~BatchManager_eClient();
     void importOutputFiles( const Job & job, const std::string directory ) throw(EmulationException);
 
+    void setUsername(const std::string & username) {_username = username;}
+
   protected:
     const CommunicationProtocol & _protocol; // protocol to access _hostname
     std::string _username; // username to access _hostname
index 453e47aed017d8ef6e21c75f9eceae4eb55c306e..05ad4f9aee5de02ce2404825fac14880a962f429 100644 (file)
@@ -76,6 +76,12 @@ namespace Batch {
     return _reference;
   }
 
+  // Permet de recharger un job depuis un fichier
+  void JobId::setReference(const std::string & new_reference)
+  {
+    _reference = new_reference;
+  }
+
   // Methode pour le controle du job : retire le job du gestionnaire
   void JobId::deleteJob() const
   {
index 2e0a0afc79a531397c708615ea1d6f55a501ee52..f0a446eadbc8680515c5a41f8186d260fbade4da 100644 (file)
@@ -62,6 +62,9 @@ namespace Batch {
     // Accesseur pour la reference interne
     virtual std::string getReference() const;
 
+    // Permet de recharger un job depuis un fichier
+    virtual void setReference(const std::string & new_reference);
+
     // Methodes pour le controle du job
     virtual void deleteJob() const; // retire un job du gestionnaire
     virtual void holdJob() const; // suspend un job en file d'attente
index 082615115933e669ba5da11b3384b5912bf2a110..5fe0649a298124d7c608dbbca09b6b3597bcf7af 100644 (file)
@@ -82,6 +82,13 @@ namespace Batch {
     return id;
   }
 
+  // Ce manager permet de faire de la reprise
+  const Batch::JobId
+  BatchManager_LSF::addJob(const Batch::Job & job, const std::string reference)
+  {
+    return JobId(this, reference);
+  }
+
   // Methode pour le controle des jobs : retire un job du gestionnaire
   void BatchManager_LSF::deleteJob(const JobId & jobid)
   {
index 38c9e3636fcb68f4926d7b8509a3390e567e0071..498ac7bc8690921ae052cfa193069db8d3199628 100644 (file)
@@ -77,6 +77,7 @@ namespace Batch {
     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
 
+    virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference); // ajoute un nouveau job sans le soumettre
 
   protected:
     int _connect; // LSF connect id
index f5fc22da23c297cdd106ff26704751e732f5cf87..fc36f7f48c8fb629572e258f6f50cf32e66bfa14 100644 (file)
@@ -125,6 +125,13 @@ namespace Batch {
     return id;
   }
 
+  // Ce manager permet de faire de la reprise
+  const Batch::JobId
+  BatchManager_eLSF::addJob(const Batch::Job & job, const std::string reference)
+  {
+    return JobId(this, reference);
+  }
+
   // Methode pour le controle des jobs : retire un job du gestionnaire
   void BatchManager_eLSF::deleteJob(const JobId & jobid)
   {
index a0cc9dba98ff5bef2d51fd0a5e7ef75f65407fab..632a044139e859ee33d08ee02bef01741af8ad45 100644 (file)
@@ -65,6 +65,7 @@ namespace Batch {
     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
 
+    virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference); // ajoute un nouveau job sans le soumettre
 
   protected:
     void buildBatchScript(const Job & job);
index 4456fec50f5498f080cfd1acf1666f514bc48441..7e0c0b040116c6153d467456bcf5b9ae5ae01a0b 100644 (file)
@@ -246,6 +246,14 @@ namespace Batch {
   }
 
 
+  // Ce manager ne peut pas reprendre un job
+  // On force donc l'état du job à erreur - pour cela on ne donne pas d'Id
+  // au JobId
+  const Batch::JobId
+  BatchManager_Local::addJob(const Batch::Job & job, const std::string reference)
+  {
+    return JobId(this, "undefined");
+  }
 
   // Methode pour le controle des jobs : teste si un job est present en machine
   bool BatchManager_Local::isRunning(const JobId & jobid)
index ec14db569bc67cc9cc7ec0aeb057c19355677489..069d0a6e0c5bb9db61d283b48f1f0a97e751e2e2 100644 (file)
@@ -142,6 +142,7 @@ namespace Batch {
     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
 
+    virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference); // ajoute un nouveau job sans le soumettre
 
   protected:
     int _connect; // Local connect id
index ba84a3a81413a717858e471895dd93d521d839a8..05ce5b04ddf6dc739d40d89c224cf4efff2ea14e 100644 (file)
@@ -136,6 +136,13 @@ namespace Batch {
     return id;
   }
 
+  // Ce manager permet de faire de la reprise
+  const Batch::JobId
+  BatchManager_PBS::addJob(const Batch::Job & job, const std::string reference)
+  {
+    return JobId(this, reference);
+  }
+
   // Methode pour le controle des jobs : retire un job du gestionnaire
   void BatchManager_PBS::deleteJob(const JobId & jobid)
   {
index 62f19e543adfc55486a2f19e9bdbf30906bd7c3f..581ed7cc994b02ae6c8e2afe3582e0fdafa11571 100644 (file)
@@ -78,6 +78,8 @@ namespace Batch {
     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
 
+    virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference); // ajoute un nouveau job sans le soumettre
+
 
   protected:
     std::string getErrorMessage(const char * operation) const;
index 75125443d32c6ae18d0414faa578796746efc793..2d0b43927478a4fe63ff0a9e3b33f5bf3fda891c 100644 (file)
@@ -121,6 +121,13 @@ namespace Batch {
     return id;
   }
 
+  // Ce manager permet de faire de la reprise
+  const Batch::JobId
+  BatchManager_ePBS::addJob(const Batch::Job & job, const std::string reference)
+  {
+    return JobId(this, reference);
+  }
+
   // Methode pour le controle des jobs : retire un job du gestionnaire
   void BatchManager_ePBS::deleteJob(const JobId & jobid)
   {
index 8ccc60c96c99a6b9964835d8d1035cc1da1d8ba7..452d59f2123036f042758768e9a5235339936081 100644 (file)
@@ -66,6 +66,7 @@ namespace Batch {
     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
 
+    virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference); // ajoute un nouveau job sans le soumettre
 
   protected:
     void buildBatchScript(const Job & job);
index a7f9d3fc5813484508803e964d29ed017be47205..32e2ecbd1958299db89c5de13035cd7324ae21aa 100644 (file)
@@ -120,6 +120,13 @@ namespace Batch {
     return id;
   }
 
+  // Ce manager permet de faire de la reprise
+  const Batch::JobId
+  BatchManager_eSGE::addJob(const Batch::Job & job, const std::string reference)
+  {
+    return JobId(this, reference);
+  }
+
   // Methode pour le controle des jobs : retire un job du gestionnaire
   void BatchManager_eSGE::deleteJob(const JobId & jobid)
   {
index 3d97404e7fa97cb6122e3c5fe0fa7c1a99315562..3743752b2c0fa2f1f9e7efbd17594f0b26d8b247 100644 (file)
@@ -65,6 +65,7 @@ namespace Batch {
     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
 
+    virtual const Batch::JobId addJob(const Batch::Job & job, const std::string reference); // ajoute un nouveau job sans le soumettre
 
   protected:
     void buildBatchScript(const Job & job);