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.9.0
/* @license-end */
TLauncher.h
Go to the documentation of this file.
1
2// 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 "TCode.h"
54#include "TDataServer.h"
55#include "UMessageLogger.h"
56#include "UExceptions.h"
57
58#include <iostream>
59#include <fstream>
60#include <iomanip>
61
62using std::cout;
63using std::endl;
64using std::cerr;
65using std::setw;
66
67namespace URANIE
68{
69namespace Launcher
70{
71class TLauncher: public TNamed
72{
73protected:
74 // the mutable declaration is needed to use the logger in const methods
75 URANIE::DataServer::UMessageLogger *_fLogger; // message logger
76
78
83 void setNoIntermediateSaved(Bool_t bbool = kTRUE)
84 {
86 }
87
88public:
90 TString _sdraw; // Variables to visualize
91 TString _sopt; // Option of visualisation
92 TString _scut; // Selection of visualisation
93 TString _sdirectory;
97 TString _sInputNames;
98 TString _sInputTypes;
99 Bool_t _bsave;
100 Bool_t _bclean;
101 Bool_t _blog;
102 Bool_t _DoLogger;
107 Int_t _nprocs;
108 Int_t _nMaxSave;
109 Int_t _delay;
111 URANIE::DataServer::TDataServer *_tds;
112 vector<URANIE::DataServer::UEntry*> _InputVector, _OutputVector;
113
114 //---------------------------------------------
118
119 virtual void createResultsDirectory(Option_t *option = "");
121
127 URANIE::DataServer::TDSNtupleD* createNtupleDFile(TString &sntlname, TString &slabelvarname, TString &slabelvartype);
128
130
137
138public:
139 //---------------------------------------------
143
146 TLauncher(URANIE::DataServer::TDataServer *tds, TCode *code, Option_t *option="");
148 virtual ~TLauncher();
150
151 //---------------------------------------------
155
156 virtual void run(Option_t *option = "");
157
158protected:
160 virtual void init(Option_t *option = "");
162 virtual void terminate(Option_t *option = "");
164 virtual void clean(Option_t *option = "");
166
167 //---------------------------------------------
171
179public:
180 void setWorkingDirectory(TString str);
182
186 {
187 return _sworkingDirectory;
188 }
189
191
195 void setPreProCommand(TString sCommand) { _sPreProCommand = sCommand;}
196
198
200
204 void setPostProCommand(TString sCommand) { _sPostProCommand = sCommand;}
206
208
214 void setSave(Int_t nSave = -1);
215
218 {
220 _bsave = kFALSE;
221 }
222
224
227 Bool_t getSave()
228 {
229 return _bsave;
230 }
231
233
237 void setClean(Bool_t bbool = kTRUE)
238 {
239 _bclean = bbool;
240 }
241
243
246 Bool_t getClean()
247 {
248 return _bclean;
249 }
250
252
256 void setDrawProgressBar(Bool_t bbool = kTRUE)
257 {
258 _bdrawProgressBar = bbool;
259 }
260
262
266 {
267 return _bdrawProgressBar;
268 }
269
271
275 {
277 }
278
280
283 void addSaveFile(TString sfile);
285
292 void setVarDraw(TString str, TString select = "", TString opt = "")
293 {
294 _sdraw = str;
295 _scut = select;
296 _sopt = opt;
297 }
298
300
301 //---------------------------------------------
305 inline void setProcsPerJob(int procs)
306 {
307 _nprocs = procs;
308 }
309 inline int getProcsPerJob()
310 {
311 return _nprocs;
312 }
314 void setDelay(int delay)
315 {
316 _delay = delay;
317 }
319
320 //---------------------------------------------
324 void setLog()
325 {
326 _blog = kTRUE;
327 }
328 void unsetLog()
329 {
330 _blog = kFALSE;
331 }
333 {
334 _blog = _blog ? kFALSE : kTRUE;
335 }
336 Bool_t getLog()
337 {
338 return _blog;
339 }
340 virtual void printLog(Option_t *option = "");
342
346 {
347 _bemptyMasterNode = kTRUE;
348 }
350 {
351 _bemptyMasterNode = kFALSE;
352 }
354
355 ClassDef(URANIE::Launcher::TLauncher, ID_LAUNCHER)
356 //Classe de
357};
358
359} // Fin du namespace Launcher
360} // Fin du namespace URANIE
361#endif
Interface of the class URANIE::Launcher::TCode.
#define MAX_PATTERN
Definition TLauncher.h:45
Description of the class TCode.
Definition TCode.h:46
Description of the class TLauncher.
Definition TLauncher.h:72
Bool_t getLog()
Definition TLauncher.h:336
void addSaveFile(TString sfile)
Defines the output file to save during the launching process.
TString _sdraw
Definition TLauncher.h:90
URANIE::DataServer::UMessageLogger * _fLogger
Definition TLauncher.h:75
TString _sdirectory
Current directory.
Definition TLauncher.h:93
TString _sInputNames
Definition TLauncher.h:97
TCode * _code
Definition TLauncher.h:89
TString _sPostProCommand
The prepro command after each parralel computation.
Definition TLauncher.h:96
Bool_t _DoLogger
Boolean to edit the log.
Definition TLauncher.h:102
virtual void createResultsDirectory(Option_t *option="")
Builts Results directory, no available options.
TString _scut
Definition TLauncher.h:92
TString _sopt
Definition TLauncher.h:91
Bool_t getNoIntermediateSaved()
Get the clean flag.
Definition TLauncher.h:274
void setDelay(int delay)
Definition TLauncher.h:314
void setSave(Int_t nSave=-1)
Activates the save mode and sets number of max saves to perform.
TString _sPreProCommand
The prepro command before each parralel computation.
Definition TLauncher.h:95
void setPreProCommand(TString sCommand)
Set the \it "prepro" command to execute before each parallel computation.
Definition TLauncher.h:195
Int_t _nMaxSave
The authorized number of saves.
Definition TLauncher.h:108
void setNoIntermediateSaved(Bool_t bbool=kTRUE)
Set the "only final file" flag.
Definition TLauncher.h:83
Int_t _delay
Definition TLauncher.h:109
Int_t _nprocs
The number of process for one job.
Definition TLauncher.h:107
Bool_t _bsave
Saves all the computation files in each directory.
Definition TLauncher.h:99
void setDrawProgressBar(Bool_t bbool=kTRUE)
Set the "draw progress bar" flag.
Definition TLauncher.h:256
vector< URANIE::DataServer::UEntry * > _InputVector
Pointer vers un TDS.
Definition TLauncher.h:112
URANIE::DataServer::TDSNtupleD * createNtupleDFile(TString &sntlname, TString &slabelvarname, TString &slabelvartype)
Create the ntupleD to store the output results.
void changeLog()
Definition TLauncher.h:332
virtual void init(Option_t *option="")
Init phase of the code.
void setWorkingDirectory(TString str)
Sets the working directory where to realize the computations.
Bool_t _bemptyMasterNode
Definition TLauncher.h:106
Bool_t _blog
Boolean to edit the log.
Definition TLauncher.h:101
TString getWorkingDirectory()
Gets the working directory.
Definition TLauncher.h:185
Bool_t _DoMultiDump
Boolean to edit the log.
Definition TLauncher.h:103
vector< URANIE::DataServer::UEntry * > _OutputVector
Definition TLauncher.h:112
Bool_t getDrawProgressBar()
Get the clean flag.
Definition TLauncher.h:265
void unsetSave()
Desactivates the save mode and unsets the specified number of max saves.
Definition TLauncher.h:217
void unsetLog()
Definition TLauncher.h:328
void setLog()
Definition TLauncher.h:324
void setEmptyMasterNode()
Definition TLauncher.h:345
virtual void printLog(Option_t *option="")
virtual void terminate(Option_t *option="")
Terminate phase of the code.
virtual void clean(Option_t *option="")
Cleans the working directory of the code.
URANIE::DataServer::TDataServer * _tds
Definition TLauncher.h:111
TLauncher(URANIE::DataServer::TDataServer *tds, TCode *code, Option_t *option="")
Constructor with a dataserver.
int getProcsPerJob()
Definition TLauncher.h:309
void initiateTheEntryVector()
Create fill correctly the UEntry vectors.
void setPostProCommand(TString sCommand)
Set the \it "postpro" command to execute after each parallel computation.
Definition TLauncher.h:204
TString _sInputTypes
Definition TLauncher.h:98
void setProcsPerJob(int procs)
Definition TLauncher.h:305
TLauncher()
Default constructor.
virtual void run(Option_t *option="")
Runs phase of the code.
void unsetEmptyMasterNode()
Definition TLauncher.h:349
Bool_t getClean()
Get the clean flag.
Definition TLauncher.h:246
TString _sworkingDirectory
The Working directory.
Definition TLauncher.h:94
Bool_t _bclean
Cleans the Working Directory before runing the code.
Definition TLauncher.h:100
Bool_t _bnoIntermediateSaved
Boolean to decide whether to keep or not the intermediate state.
Definition TLauncher.h:105
Bool_t _bdrawProgressBar
Boolean to know if the progress bar has to be drawn.
Definition TLauncher.h:104
void setVarDraw(TString str, TString select="", TString opt="")
Activates and defines the graphics during the launching.
Definition TLauncher.h:292
TList * _listOfSaveFile
temporisation in seconds between first and last execution on a batch system
Definition TLauncher.h:110
void setClean(Bool_t bbool=kTRUE)
Set the clean flag.
Definition TLauncher.h:237
virtual ~TLauncher()
Default destructor.
TString getPostProCommand()
Definition TLauncher.h:205
TString getPreProCommand()
Definition TLauncher.h:197
Bool_t getSave()
Get the save flag.
Definition TLauncher.h:227
Definition TCluster.h:67