Salome HOME
merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev2_29Jul08)
[modules/kernel.git] / src / Batch / Batch_BatchManager_eLSF.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20 /*
21  * BatchManager_eLSF.hxx : emulation of LSF client
22  *
23  * Auteur : Bernard SECHER - CEA DEN
24  * Mail   : mailto:bernard.secher@cea.fr
25  * Date   : Thu Apr 24 10:17:22 2008
26  * Projet : PAL Salome 
27  *
28  */
29
30 #ifndef _BATCHMANAGER_eLSF_H_
31 #define _BATCHMANAGER_eLSF_H_
32
33
34 #include "Batch_JobId.hxx"
35 #include "Batch_JobInfo.hxx"
36 #include "Batch_JobInfo_eLSF.hxx"
37 #include "Batch_InvalidArgumentException.hxx"
38 #include "Batch_ConnexionFailureException.hxx"
39 #include "Batch_APIInternalFailureException.hxx"
40 #include "Batch_NotYetImplementedException.hxx"
41 #include "Batch_BatchManager.hxx"
42 #include "Batch_BatchManager_eClient.hxx"
43
44 namespace Batch {
45
46   class Job;
47   class JobId;
48   class JobInfo;
49   class FactBatchManager;
50
51   class BatchManager_eLSF : public BatchManager_eClient
52   {
53   public:
54     // Constructeur et destructeur
55     BatchManager_eLSF(const FactBatchManager * parent, const char * host="localhost", const char * protocol="ssh", const char * mpiImpl="indif") throw(InvalidArgumentException,ConnexionFailureException); // connexion a la machine host
56     virtual ~BatchManager_eLSF();
57
58     // Recupere le nom du serveur par defaut
59     // static string BatchManager_LSF::getDefaultServer();
60
61     // Methodes pour le controle des jobs
62     virtual const JobId submitJob(const Job & job); // soumet un job au gestionnaire
63     virtual void deleteJob(const JobId & jobid); // retire un job du gestionnaire
64     virtual void holdJob(const JobId & jobid); // suspend un job en file d'attente
65     virtual void releaseJob(const JobId & jobid); // relache un job suspendu
66     virtual void alterJob(const JobId & jobid, const Parametre & param, const Environnement & env); // modifie un job en file d'attente
67     virtual void alterJob(const JobId & jobid, const Parametre & param); // modifie un job en file d'attente
68     virtual void alterJob(const JobId & jobid, const Environnement & env); // modifie un job en file d'attente
69     virtual JobInfo queryJob(const JobId & jobid); // renvoie l'etat du job
70     virtual bool isRunning(const JobId & jobid); // teste si un job est present en machine
71
72     virtual void setParametre(const JobId & jobid, const Parametre & param) { return alterJob(jobid, param); } // modifie un job en file d'attente
73     virtual void setEnvironnement(const JobId & jobid, const Environnement & env) { return alterJob(jobid, env); } // modifie un job en file d'attente
74
75
76   protected:
77     void buildBatchScript(const Job & job) throw(EmulationException);
78     std::string getWallTime(const long edt);
79
80   private:
81
82 #ifdef SWIG
83   public:
84     // Recupere le l'identifiant d'un job deja soumis au BatchManager
85     //virtual const JobId getJobIdByReference(const string & ref) { return BatchManager::getJobIdByReference(ref); }
86     virtual const JobId getJobIdByReference(const char * ref) { return BatchManager::getJobIdByReference(ref); }
87 #endif
88
89   };
90
91 }
92
93 #endif