Salome HOME
merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev2_29Jul08)
[modules/kernel.git] / src / Batch / Batch_BatchManager_eClient.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 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_eClient_H_
31 #define _BATCHMANAGER_eClient_H_
32
33
34 #include "MpiImpl.hxx"
35 #include "Batch_BatchManager.hxx"
36
37 namespace Batch {
38
39   class Job;
40
41   class EmulationException
42   {
43   public:
44     const std::string msg;
45     
46     EmulationException(const std::string m) : msg(m) {}
47   };
48
49   class BatchManager_eClient : public BatchManager
50   {
51   public:
52     // Constructeur et destructeur
53     BatchManager_eClient(const Batch::FactBatchManager * parent, const char* host="localhost", const char* protocol="ssh", const char* mpiImpl="indif");
54     virtual ~BatchManager_eClient();
55     void importOutputFiles( const Job & job, const std::string directory ) throw(EmulationException);
56
57   protected:
58     std::string _protocol; // protocol to access _hostname
59     std::string _username; // username to access _hostname
60     MpiImpl *_mpiImpl; // Mpi implementation to launch executable in batch script
61
62     std::string BuildTemporaryFileName() const;
63     void RmTmpFile(std::string & TemporaryFileName);
64     MpiImpl* FactoryMpiImpl(string mpiImpl) throw(EmulationException);
65     void exportInputFiles(const Job & job) throw(EmulationException);
66
67   private:
68
69   };
70
71 }
72
73 #endif