Salome HOME
merge from V4_1_0_maintainance branch (from tag mergeto_BR_QT4_Dev2_29Jul08)
[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 <string>
33
34 class MpiImplException
35 {
36 public:
37   const std::string msg;
38   
39   MpiImplException(const std::string m) : msg(m) {}
40 };
41
42 class MpiImpl
43 {
44 public:
45   // Constructeur et destructeur
46   MpiImpl(); // constrcuctor
47   virtual ~MpiImpl(); //Destructor
48   
49   virtual std::string size() = 0; // get number of process of current job
50   virtual std::string rank() = 0; // get process number of current job
51   virtual std::string boot(const std::string machinefile, const unsigned int nbnodes) = 0; // get boot command
52   virtual std::string run(const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute) = 0; // get run command
53   virtual std::string halt() = 0; // get stop command
54
55 protected:
56
57 private:
58
59 };
60
61 class MpiImpl_LAM : public MpiImpl
62 {
63 public:
64   // Constructeur et destructeur
65   MpiImpl_LAM(); // constructor
66   virtual ~MpiImpl_LAM(); //Destructor
67
68   std::string size(); // get number of process of current job
69   std::string rank(); // get process number of current job
70   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
71   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
72   std::string halt(); // get stop command
73
74 protected:
75   
76 private:
77
78 };
79
80 class MpiImpl_MPICH1 : public MpiImpl
81 {
82 public:
83   // Constructeur et destructeur
84   MpiImpl_MPICH1(); // constructor
85   virtual ~MpiImpl_MPICH1(); //Destructor
86   
87   std::string size(); // get number of process of current job
88   std::string rank(); // get process number of current job
89   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
90   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
91   std::string halt(); // get stop command
92
93 protected:
94   
95 private:
96
97 };
98
99 class MpiImpl_MPICH2 : public MpiImpl
100 {
101 public:
102   // Constructeur et destructeur
103   MpiImpl_MPICH2(); // constructor
104   virtual ~MpiImpl_MPICH2(); //Destructor
105
106   std::string size(); // get number of process of current job
107   std::string rank(); // get process number of current job
108   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
109   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
110   std::string halt(); // get stop command
111
112 protected:
113
114 private:
115
116 };
117
118 class MpiImpl_OPENMPI : public MpiImpl
119 {
120 public:
121   // Constructeur et destructeur
122   MpiImpl_OPENMPI(); // constructor
123   virtual ~MpiImpl_OPENMPI(); //Destructor
124
125   std::string size(); // get number of process of current job
126   std::string rank(); // get process number of current job
127   std::string boot( const std::string machinefile, const unsigned int nbnodes); // get boot command
128   std::string run( const std::string machinefile, const unsigned int nbproc, const std::string fileNameToExecute); // get run command
129   std::string halt(); // get stop command
130
131 protected:
132
133 private:
134
135 };
136
137 class MpiImpl_SLURM : public MpiImpl
138 {
139 public:
140   // Constructeur et destructeur
141   MpiImpl_SLURM(); // constructor
142   virtual ~MpiImpl_SLURM(); //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
150 protected:
151
152 private:
153
154 };
155
156 #endif