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