Salome HOME
BUG 0020024: a --gdb-session option to runSalome ...
[modules/kernel.git] / src / Batch / MpiImpl.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.hxx : 
22  *
23  * Auteur : Bernard SECHER - CEA/DEN
24  * Date   : Juillet 2007
25  * Projet : SALOME
26  *
27  */
28
29 #ifndef _BL_MPIIMPL_H_
30 #define _BL_MPIIMPL_H_
31
32 #include "Batch_Defines.hxx"
33 #include <string>
34
35 class BATCH_EXPORT MpiImplException
36 {
37 public:
38   const std::string msg;
39   
40   MpiImplException(const std::string m) : msg(m) {}
41 };
42
43 class BATCH_EXPORT MpiImpl
44 {
45 public:
46   // Constructeur et destructeur
47   MpiImpl(); // constrcuctor
48   virtual ~MpiImpl(); //Destructor
49   
50   virtual std::string size() = 0; // get number of process of current job
51   virtual std::string rank() = 0; // get process number of current job
52   virtual std::string boot(const std::string machinefile, const unsigned int nbnodes) = 0; // get boot command
53   virtual std::string run(const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute) = 0; // get run command
54   virtual std::string halt() = 0; // get stop command
55
56 protected:
57
58 private:
59
60 };
61
62 class BATCH_EXPORT MpiImpl_LAM : public MpiImpl
63 {
64 public:
65   // Constructeur et destructeur
66   MpiImpl_LAM(); // constructor
67   virtual ~MpiImpl_LAM(); //Destructor
68
69   std::string size(); // get number of process of current job
70   std::string rank(); // get process number of current job
71   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
72   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
73   std::string halt(); // get stop command
74
75 protected:
76   
77 private:
78
79 };
80
81 class BATCH_EXPORT MpiImpl_MPICH1 : public MpiImpl
82 {
83 public:
84   // Constructeur et destructeur
85   MpiImpl_MPICH1(); // constructor
86   virtual ~MpiImpl_MPICH1(); //Destructor
87   
88   std::string size(); // get number of process of current job
89   std::string rank(); // get process number of current job
90   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
91   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
92   std::string halt(); // get stop command
93
94 protected:
95   
96 private:
97
98 };
99
100 class BATCH_EXPORT MpiImpl_MPICH2 : public MpiImpl
101 {
102 public:
103   // Constructeur et destructeur
104   MpiImpl_MPICH2(); // constructor
105   virtual ~MpiImpl_MPICH2(); //Destructor
106
107   std::string size(); // get number of process of current job
108   std::string rank(); // get process number of current job
109   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
110   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
111   std::string halt(); // get stop command
112
113 protected:
114
115 private:
116
117 };
118
119 class BATCH_EXPORT MpiImpl_OPENMPI : public MpiImpl
120 {
121 public:
122   // Constructeur et destructeur
123   MpiImpl_OPENMPI(); // constructor
124   virtual ~MpiImpl_OPENMPI(); //Destructor
125
126   std::string size(); // get number of process of current job
127   std::string rank(); // get process number of current job
128   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
129   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
130   std::string halt(); // get stop command
131
132 protected:
133
134 private:
135
136 };
137
138 class BATCH_EXPORT MpiImpl_SLURM : public MpiImpl
139 {
140 public:
141   // Constructeur et destructeur
142   MpiImpl_SLURM(); // constructor
143   virtual ~MpiImpl_SLURM(); //Destructor
144
145   std::string size(); // get number of process of current job
146   std::string rank(); // get process number of current job
147   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
148   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
149   std::string halt(); // get stop command
150
151 protected:
152
153 private:
154
155 };
156
157 #endif