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
20 #ifndef __LAUNCHER_HXX__
21 #define __LAUNCHER_HXX__
24 # ifdef LAUNCHER_EXPORTS
25 # define LAUNCHER_EXPORT __declspec(dllexport)
27 # define LAUNCHER_EXPORT __declspec(dllimport)
30 # define LAUNCHER_EXPORT
33 #include <SALOME_ResourcesCatalog_Parser.hxx>
34 #include "ResourcesManager.hxx"
42 class BatchManager_eClient;
47 std::string batch_directory;
48 std::string expected_during_time;
50 unsigned long nb_proc;
53 class LAUNCHER_EXPORT LauncherException
56 const std::string msg;
58 LauncherException(const std::string m) : msg(m) {}
61 class LAUNCHER_EXPORT Launcher_cpp
68 long submitSalomeJob(const std::string fileToExecute ,
69 const std::vector<std::string>& filesToExport ,
70 const std::vector<std::string>& filesToImport ,
71 const batchParams& batch_params,
72 const machineParams& params) throw(LauncherException);
74 std::string querySalomeJob( const long jobId, const machineParams& params) throw(LauncherException);
75 void deleteSalomeJob( const long jobId, const machineParams& params) throw(LauncherException);
76 void getResultSalomeJob( const std::string directory, const long jobId, const machineParams& params ) throw(LauncherException);
78 void SetResourcesManager( ResourcesManager_cpp* rm ) { _ResManager = rm; }
82 std::string buildSalomeCouplingScript(const std::string fileToExecute, const std::string dirForTmpFiles, const ParserResourcesType& params);
83 MpiImpl *FactoryMpiImpl(MpiImplType mpiImpl) throw(LauncherException);
84 Batch::BatchManager_eClient *FactoryBatchManager( const ParserResourcesType& params ) throw(LauncherException);
85 std::string getTmpDirForBatchFiles();
86 std::string getRemoteFile( std::string remoteDir, std::string localFile );
87 std::string getHomeDir(const ParserResourcesType& p, const std::string & tmpdir);
89 std::map <std::string,Batch::BatchManager_eClient*> _batchmap;
90 std::map < std::pair<std::string,long> , Batch::Job* > _jobmap;
91 ResourcesManager_cpp *_ResManager;
92 bool check(const batchParams& batch_params);
93 long getWallTime(std::string edt);
94 long getRamSize(std::string mem);