English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Launcher: TLauncher.h Source File
Uranie / Launcher  v4.10.0
/* @license-end */
TLauncher.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2024 CEA/DES
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as published
6 // by the Free Software Foundation, either version 3 of the License, or any
7 // later version.
8 //
9 // This program 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
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 // $Id$
19 // $Author$
20 // $Date$
21 // $Revision$
22 // $State$
24 
42 #ifndef TLAUNCHER_H
43 #define TLAUNCHER_H
44 
45 #define MAX_PATTERN 980
46 
47 //ROOT
48 #include "Rtypes.h"
49 #include "TString.h"
50 
51 // Uranie
52 #include "Launcher.h"
53 #include "TLauncherEnv.h"
54 #include "TCode.h"
55 #include "TDataServer.h"
56 #include "UMessageLogger.h"
57 #include "UExceptions.h"
58 
59 #include <iostream>
60 #include <fstream>
61 #include <iomanip>
62 
63 using std::cout;
64 using std::endl;
65 using std::cerr;
66 using std::setw;
67 
68 namespace URANIE
69 {
70 namespace Launcher
71 {
72 
73 class TLauncher: public TLauncherEnv
74 {
75 protected:
76  // the mutable declaration is needed to use the logger in const methods
77  URANIE::DataServer::UMessageLogger *_fLogger; // message logger
78 
80 
85  void setNoIntermediateSaved(Bool_t bbool = kTRUE)
86  {
87  _bnoIntermediateSaved = bbool;
88  }
89 
90 public:
91  TString _sdraw; // Variables to visualize
92  TString _sopt; // Option of visualisation
93  TString _scut; // Selection of visualisation
94  TString _sPreProCommand;
95  TString _sPostProCommand;
96  TString _sInputNames;
97  TString _sInputTypes;
98  Bool_t _bsave;
99  Bool_t _bclean;
100  Bool_t _DoLogger;
101  Bool_t _DoMultiDump;
105  Int_t _nprocs;
106  Int_t _nMaxSave;
108  URANIE::DataServer::TDataServer *_tds;
109  vector<URANIE::DataServer::UEntry*> _InputVector, _OutputVector;
110 
111  //---------------------------------------------
115  // ENV virtual void createResultsDirectory(Option_t *option = "");
118 
124  URANIE::DataServer::TDSNtupleD* createNtupleDFile(TString &sntlname, TString &slabelvarname, TString &slabelvartype);
125 
127 
132  void initiateTheEntryVector();
134 
135 public:
136  //---------------------------------------------
140  TLauncher();
143  TLauncher(URANIE::DataServer::TDataServer *tds, TCode *code, Option_t *option="");
145  virtual ~TLauncher();
147 
148  //---------------------------------------------
152  virtual void run(Option_t *option = "");
154 
155 protected:
157  virtual void init(Option_t *option = "");
159  virtual void terminate(Option_t *option = "");
161  virtual void clean(Option_t *option = "");
163 
164  //---------------------------------------------
168 
176 public:
178 
182  void setPreProCommand(TString sCommand) { _sPreProCommand = sCommand;}
183 
184  TString getPreProCommand() { return _sPreProCommand;}
185 
187 
191  void setPostProCommand(TString sCommand) { _sPostProCommand = sCommand;}
192  TString getPostProCommand() { return _sPostProCommand;}
193 
195 
201  void setSave(Int_t nSave = -1);
202 
204  void unsetSave()
205  {
207  _bsave = kFALSE;
208  }
209 
211 
214  Bool_t getSave()
215  {
216  return _bsave;
217  }
218 
220 
224  void setClean(Bool_t bbool = kTRUE)
225  {
226  _bclean = bbool;
227  }
228 
230 
233  Bool_t getClean()
234  {
235  return _bclean;
236  }
237 
239 
243  void setDrawProgressBar(Bool_t bbool = kTRUE)
244  {
245  _bdrawProgressBar = bbool;
246  }
247 
249 
253  {
254  return _bdrawProgressBar;
255  }
256 
258 
262  {
263  return _bnoIntermediateSaved;
264  }
265 
267 
270  void addSaveFile(TString sfile);
272 
279  void setVarDraw(TString str, TString select = "", TString opt = "")
280  {
281  _sdraw = str;
282  _scut = select;
283  _sopt = opt;
284  }
285 
287 
288  //---------------------------------------------
292  inline void setProcsPerJob(int procs)
293  {
294  _nprocs = procs;
295  }
296  inline int getProcsPerJob()
297  {
298  return _nprocs;
299  }
301 
302  virtual void printLog(Option_t *option = "");
303 
308  {
309  _bemptyMasterNode = kTRUE;
310  }
312  {
313  _bemptyMasterNode = kFALSE;
314  }
316 
317  ClassDef(URANIE::Launcher::TLauncher, ID_LAUNCHER)
318  //Classe de
319 };
320 
321 } // Fin du namespace Launcher
322 } // Fin du namespace URANIE
323 #endif
Definition: TCluster.h:66
Bool_t _DoMultiDump
Boolean to edit the log.
Definition: TLauncher.h:101
virtual ~TLauncher()
Default destructor.
Bool_t _bdrawProgressBar
Boolean to know if the progress bar has to be drawn.
Definition: TLauncher.h:102
Bool_t getSave()
Get the save flag.
Definition: TLauncher.h:214
Definition: TLauncherEnv.h:53
URANIE::DataServer::TDSNtupleD * createNtupleDFile(TString &sntlname, TString &slabelvarname, TString &slabelvartype)
Builts Results directory, no available options.
TString _sopt
Definition: TLauncher.h:92
Bool_t _bemptyMasterNode
Definition: TLauncher.h:104
working dir for launcher code
void setSave(Int_t nSave=-1)
Activates the save mode and sets number of max saves to perform.
void unsetSave()
Desactivates the save mode and unsets the specified number of max saves.
Definition: TLauncher.h:204
vector< URANIE::DataServer::UEntry * > _OutputVector
Definition: TLauncher.h:109
Bool_t getClean()
Get the clean flag.
Definition: TLauncher.h:233
void setPreProCommand(TString sCommand)
Sets the working directory where to realize the computations.
Definition: TLauncher.h:182
TLauncher()
Default constructor.
TString _sPostProCommand
The prepro command after each parralel computation.
Definition: TLauncher.h:95
TList * _listOfSaveFile
The list of output files to save with the number of run.
Definition: TLauncher.h:107
void initiateTheEntryVector()
Create fill correctly the UEntry vectors.
void setProcsPerJob(int procs)
Definition: TLauncher.h:292
vector< URANIE::DataServer::UEntry * > _InputVector
Pointer vers un TDS.
Definition: TLauncher.h:109
Int_t _nprocs
The number of process for one job.
Definition: TLauncher.h:105
virtual void run(Option_t *option="")
Runs phase of the code.
Int_t _nMaxSave
The authorized number of saves.
Definition: TLauncher.h:106
void unsetEmptyMasterNode()
Definition: TLauncher.h:311
virtual void clean(Option_t *option="")
Cleans the working directory of the code.
void setNoIntermediateSaved(Bool_t bbool=kTRUE)
Set the "only final file" flag.
Definition: TLauncher.h:85
TString getPostProCommand()
Definition: TLauncher.h:192
void setEmptyMasterNode()
Definition: TLauncher.h:307
Bool_t getNoIntermediateSaved()
Get the clean flag.
Definition: TLauncher.h:261
Bool_t _bnoIntermediateSaved
Boolean to decide whether to keep or not the intermediate state.
Definition: TLauncher.h:103
#define MAX_PATTERN
Definition: TLauncher.h:45
void setDrawProgressBar(Bool_t bbool=kTRUE)
Set the "draw progress bar" flag.
Definition: TLauncher.h:243
int getProcsPerJob()
Definition: TLauncher.h:296
void setClean(Bool_t bbool=kTRUE)
Set the clean flag.
Definition: TLauncher.h:224
URANIE::DataServer::UMessageLogger * _fLogger
Definition: TLauncher.h:77
virtual void printLog(Option_t *option="")
TString _sPreProCommand
The prepro command before each parralel computation.
Definition: TLauncher.h:94
Bool_t getDrawProgressBar()
Get the clean flag.
Definition: TLauncher.h:252
virtual void terminate(Option_t *option="")
Terminate phase of the code.
Bool_t _DoLogger
Boolean to edit the log.
Definition: TLauncher.h:100
void addSaveFile(TString sfile)
Defines the output file to save during the launching process.
Bool_t _bclean
Cleans the Working Directory before runing the code.
Definition: TLauncher.h:99
Interface of the class URANIE::Launcher::TCode.
TString getPreProCommand()
Definition: TLauncher.h:184
Description of the class TLauncher.
Definition: TLauncher.h:73
TString _sInputTypes
Definition: TLauncher.h:97
TString _sdraw
Definition: TLauncher.h:91
Bool_t _bsave
Saves all the computation files in each directory.
Definition: TLauncher.h:98
TString _scut
Definition: TLauncher.h:93
Description of the class TCode.
Definition: TCode.h:48
virtual void init(Option_t *option="")
Init phase of the code.
TString _sInputNames
Definition: TLauncher.h:96
void setVarDraw(TString str, TString select="", TString opt="")
Activates and defines the graphics during the launching.
Definition: TLauncher.h:279
void setPostProCommand(TString sCommand)
Set the "postpro" command to execute after each parallel computation.
Definition: TLauncher.h:191
URANIE::DataServer::TDataServer * _tds
Definition: TLauncher.h:108