1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 * Auteur : Bernard SECHER - CEA/DEN
29 #ifndef _BL_BATCHMANAGER_H_
30 #define _BL_BATCHMANAGER_H_
35 #include "Utils_SALOME_Exception.hxx"
36 #include <SALOMEconfig.h>
38 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
39 #include "MpiImpl.hxx"
41 namespace BatchLight {
46 std::string hostname; // serveur ou tourne le BatchManager
47 std::string protocol; // protocole d'acces au serveur: ssh ou rsh
48 std::string username; // username d'acces au serveur
49 std::string applipath; // path of apllication directory on server
50 std::vector<std::string> modulesList; // list of Salome modules installed on server
51 unsigned int nbnodes; // number of nodes on cluster
52 unsigned int nbprocpernode; // number of processors on each node
53 std::string mpiImpl; // mpi implementation
59 // Constructeur et destructeur
60 BatchManager(const batchParams& p) throw(SALOME_Exception); // connexion a la machine host
61 virtual ~BatchManager();
63 // Methodes pour le controle des jobs : virtuelles pures
64 const int submitJob(BatchLight::Job* job); // soumet un job au gestionnaire
65 virtual void deleteJob(const int & jobid) = 0; // retire un job du gestionnaire
66 virtual std::string queryJob(const int & jobid) = 0; // renvoie l'etat du job
67 void importOutputFiles( const char *directory, const CORBA::Long jobId ) throw(SALOME_Exception);
73 std::map <int,const BatchLight::Job *> _jobmap;
74 std::string _dirForTmpFiles; // repertoire temporaire sur le serveur
75 std::string _TmpFileName;
76 std::string _fileNameToExecute;
78 virtual int submit() throw(SALOME_Exception) = 0;
79 void setDirForTmpFiles();
80 void exportInputFiles( const char *fileToExecute, const Engines::FilesList filesToExportList ) throw(SALOME_Exception);
81 virtual void buildSalomeCouplingScript( const char *fileToExecute ) throw(SALOME_Exception) = 0;
82 virtual void buildSalomeBatchScript( const int nbproc ) throw(SALOME_Exception) = 0;
84 std::string BuildTemporaryFileName() const;
86 MpiImpl *FactoryMpiImpl(std::string mpiImpl) throw(SALOME_Exception);