Salome HOME
Copyright update 2021
[tools/libbatch.git] / src / Core / MpiImpl.hxx
1 // Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef _BL_MPIIMPL_H_
24 #define _BL_MPIIMPL_H_
25
26 #include "Defines.hxx"
27 #include <string>
28
29 class BATCH_EXPORT MpiImplException
30 {
31 public:
32   const std::string msg;
33   
34   MpiImplException(const std::string m) : msg(m) {}
35 };
36
37 class BATCH_EXPORT MpiImpl
38 {
39 public:
40   // Constructeur et destructeur
41   MpiImpl(); // constrcuctor
42   virtual ~MpiImpl(); //Destructor
43   
44   virtual std::string size() = 0; // get number of process of current job
45   virtual std::string rank() = 0; // get process number of current job
46   virtual std::string boot(const std::string machinefile, const unsigned int nbnodes) = 0; // get boot command
47   virtual std::string run(const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute) = 0; // get run command
48   virtual std::string halt() = 0; // get stop command
49   virtual std::string name() = 0; // name of mpi implementation
50
51 protected:
52
53 private:
54
55 };
56
57 class BATCH_EXPORT MpiImpl_LAM : public MpiImpl
58 {
59 public:
60   // Constructeur et destructeur
61   MpiImpl_LAM(); // constructor
62   virtual ~MpiImpl_LAM(); //Destructor
63
64   std::string size(); // get number of process of current job
65   std::string rank(); // get process number of current job
66   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
67   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
68   std::string halt(); // get stop command
69   std::string name(); // name of mpi implementation
70
71 protected:
72   
73 private:
74
75 };
76
77 class BATCH_EXPORT MpiImpl_MPICH1 : public MpiImpl
78 {
79 public:
80   // Constructeur et destructeur
81   MpiImpl_MPICH1(); // constructor
82   virtual ~MpiImpl_MPICH1(); //Destructor
83   
84   std::string size(); // get number of process of current job
85   std::string rank(); // get process number of current job
86   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
87   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
88   std::string halt(); // get stop command
89   std::string name(); // name of mpi implementation
90
91 protected:
92   
93 private:
94
95 };
96
97 class BATCH_EXPORT MpiImpl_MPICH2 : public MpiImpl
98 {
99 public:
100   // Constructeur et destructeur
101   MpiImpl_MPICH2(); // constructor
102   virtual ~MpiImpl_MPICH2(); //Destructor
103
104   std::string size(); // get number of process of current job
105   std::string rank(); // get process number of current job
106   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
107   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
108   std::string halt(); // get stop command
109   std::string name(); // name of mpi implementation
110
111 protected:
112
113 private:
114
115 };
116
117 class BATCH_EXPORT MpiImpl_OPENMPI : public MpiImpl
118 {
119 public:
120   // Constructeur et destructeur
121   MpiImpl_OPENMPI(); // constructor
122   virtual ~MpiImpl_OPENMPI(); //Destructor
123
124   std::string size(); // get number of process of current job
125   std::string rank(); // get process number of current job
126   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
127   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
128   std::string halt(); // get stop command
129   std::string name(); // name of mpi implementation
130
131 protected:
132
133 private:
134
135 };
136
137 class BATCH_EXPORT MpiImpl_OMPI : public MpiImpl
138 {
139 public:
140   // Constructeur et destructeur
141   MpiImpl_OMPI(); // constructor
142   virtual ~MpiImpl_OMPI(); //Destructor
143
144   std::string size(); // get number of process of current job
145   std::string rank(); // get process number of current job
146   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
147   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
148   std::string halt(); // get stop command
149   std::string name(); // name of mpi implementation
150
151 protected:
152
153 private:
154
155 };
156
157 class BATCH_EXPORT MpiImpl_SLURM : public MpiImpl
158 {
159 public:
160   // Constructeur et destructeur
161   MpiImpl_SLURM(); // constructor
162   virtual ~MpiImpl_SLURM(); //Destructor
163
164   std::string size(); // get number of process of current job
165   std::string rank(); // get process number of current job
166   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
167   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
168   std::string halt(); // get stop command
169   std::string name(); // name of mpi implementation
170
171 protected:
172
173 private:
174
175 };
176
177 class BATCH_EXPORT MpiImpl_PRUN : public MpiImpl
178 {
179 public:
180   // Constructeur et destructeur
181   MpiImpl_PRUN(); // constructor
182   virtual ~MpiImpl_PRUN(); //Destructor
183
184   std::string size(); // get number of process of current job
185   std::string rank(); // get process number of current job
186   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
187   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
188   std::string halt(); // get stop command
189   std::string name(); // name of mpi implementation
190
191 protected:
192
193 private:
194
195 };
196
197 #endif