Salome HOME
Update copyrights
[tools/libbatch.git] / src / Core / Batch_MpiImpl.hxx
1 //  Copyright (C) 2007-2012  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.
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 "Batch_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
50 protected:
51
52 private:
53
54 };
55
56 class BATCH_EXPORT MpiImpl_LAM : public MpiImpl
57 {
58 public:
59   // Constructeur et destructeur
60   MpiImpl_LAM(); // constructor
61   virtual ~MpiImpl_LAM(); //Destructor
62
63   std::string size(); // get number of process of current job
64   std::string rank(); // get process number of current job
65   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
66   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
67   std::string halt(); // get stop command
68
69 protected:
70   
71 private:
72
73 };
74
75 class BATCH_EXPORT MpiImpl_MPICH1 : public MpiImpl
76 {
77 public:
78   // Constructeur et destructeur
79   MpiImpl_MPICH1(); // constructor
80   virtual ~MpiImpl_MPICH1(); //Destructor
81   
82   std::string size(); // get number of process of current job
83   std::string rank(); // get process number of current job
84   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
85   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
86   std::string halt(); // get stop command
87
88 protected:
89   
90 private:
91
92 };
93
94 class BATCH_EXPORT MpiImpl_MPICH2 : public MpiImpl
95 {
96 public:
97   // Constructeur et destructeur
98   MpiImpl_MPICH2(); // constructor
99   virtual ~MpiImpl_MPICH2(); //Destructor
100
101   std::string size(); // get number of process of current job
102   std::string rank(); // get process number of current job
103   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
104   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
105   std::string halt(); // get stop command
106
107 protected:
108
109 private:
110
111 };
112
113 class BATCH_EXPORT MpiImpl_OPENMPI : public MpiImpl
114 {
115 public:
116   // Constructeur et destructeur
117   MpiImpl_OPENMPI(); // constructor
118   virtual ~MpiImpl_OPENMPI(); //Destructor
119
120   std::string size(); // get number of process of current job
121   std::string rank(); // get process number of current job
122   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
123   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
124   std::string halt(); // get stop command
125
126 protected:
127
128 private:
129
130 };
131
132 class BATCH_EXPORT MpiImpl_SLURM : public MpiImpl
133 {
134 public:
135   // Constructeur et destructeur
136   MpiImpl_SLURM(); // constructor
137   virtual ~MpiImpl_SLURM(); //Destructor
138
139   std::string size(); // get number of process of current job
140   std::string rank(); // get process number of current job
141   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
142   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
143   std::string halt(); // get stop command
144
145 protected:
146
147 private:
148
149 };
150
151 class BATCH_EXPORT MpiImpl_PRUN : public MpiImpl
152 {
153 public:
154   // Constructeur et destructeur
155   MpiImpl_PRUN(); // constructor
156   virtual ~MpiImpl_PRUN(); //Destructor
157
158   std::string size(); // get number of process of current job
159   std::string rank(); // get process number of current job
160   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
161   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
162   std::string halt(); // get stop command
163
164 protected:
165
166 private:
167
168 };
169
170 #endif