English Français

Documentation / Manuel développeur

Modules disponibles

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Launcher: TLauncherMulti.h Source File
Uranie / Launcher  v4.10.0
/* @license-end */
TLauncherMulti.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 
41 #ifndef TLAUNCHERMULTI_H
42 #define TLAUNCHERMULTI_H
43 
44 #include <string>
45 #include <list>
46 #include <sys/types.h>
47 #include <unistd.h>
48 
49 // Uranie
50 #include "Launcher.h"
51 #include "TCode.h"
52 #include "TCluster.h"
53 #include "TSlurmCluster.h"
54 #include "TLSFCluster.h"
55 #include "TSGECluster.h"
56 #include "TLocalHostCluster.h"
57 #include "TLoadLevelerCluster.h"
58 
59 #include <iostream>
60 #include <sstream>
61 #include <fstream>
62 
63 using std::cout;
64 using std::endl;
65 using std::list;
66 using std::string;
67 using std::istringstream;
68 
69 namespace URANIE
70 {
71 namespace Launcher
72 {
73 
74 class TLauncherMulti: public TNamed
75 {
76 private:
78  Bool_t _blog;
79  Bool_t _bemptyMasterNode; //Boolean for strategy of parallel runs
80  Bool_t _bmultidump; //Boolean for strategy of parallel runs
82 
83  int njobs_; // Number of job to run
84 
85  TString exe_; // Binary to execute
86  int procsperjob_; // Number of procs per job
87 
88  int nb_avail_procs_; // Number of available procs
89  int nb_total_procs_; //Number of procs allocated by the system
90  list<string> hostslist_; // List of available procs
91 
92 public:
94  TLauncherMulti(const char* name, const char* title, Option_t *option,
95  Bool_t emptyMasterNode, bool dumpmulti=false);
97 
98  void createHostsList(Option_t *option);
99  void defineJob(const char* exe, int njobs, int nprocs);
100 
101  bool availableRessource();
102  void createJob(forkcode * cur, TCode * code);
103 
104  inline int getJobsNumber()
105  {
106  return njobs_;
107  }
108  inline int getAvailableProcs()
109  {
110  return nb_avail_procs_;
111  }
112 
113  inline void setWorkingDir(TString sdir)
114  {
115  _sworkingDirectory = sdir;
116  }
117 
118  void mergeAll(const int niteration);
119  void display();//TString str, TString cut, TString opt);
120 
121  //---------------------------------------------
125  void setLog()
126  {
127  _blog = kTRUE;
128  }
129  void unsetLog()
130  {
131  _blog = kFALSE;
132  }
133  void changeLog()
134  {
135  _blog = _blog ? kFALSE : kTRUE;
136  }
137  Bool_t getLog()
138  {
139  return _blog;
140  }
141  virtual void printLog(Option_t *option = "");
143 
144  ClassDef(URANIE::Launcher::TLauncherMulti, ID_LAUNCHER)
145  // Classe TLauncherMulti
146 };
147 
148 } // Fin du namespace Launcher
149 } // Fin du namespace URANIE
150 #endif
151 
Definition: TCluster.h:66
void defineJob(const char *exe, int njobs, int nprocs)
Definition: TLauncherMulti.cxx:187
void setLog()
Definition: TLauncherMulti.h:125
void createJob(forkcode *cur, TCode *code)
Definition: TLauncherMulti.cxx:208
int nb_avail_procs_
Definition: TLauncherMulti.h:88
Interface of class URANIE::Launcher::TSGECluster.
int njobs_
Definition: TLauncherMulti.h:83
Description of the class TCluster.
Definition: TCluster.h:70
list< string > hostslist_
Definition: TLauncherMulti.h:90
int getAvailableProcs()
Definition: TLauncherMulti.h:108
struct unforkjob forkcode
Definition: TInputFile.h:53
void changeLog()
Definition: TLauncherMulti.h:133
virtual void printLog(Option_t *option="")
Definition: TLauncherMulti.cxx:320
Bool_t _bmultidump
Definition: TLauncherMulti.h:80
void setWorkingDir(TString sdir)
Definition: TLauncherMulti.h:113
void createHostsList(Option_t *option)
Definition: TLauncherMulti.cxx:91
Bool_t _blog
Boolean to edit the log.
Definition: TLauncherMulti.h:78
Interface of the class URANIE::Launcher::TCluster.
TString exe_
Definition: TLauncherMulti.h:85
Description of the class TLauncherMulti.
Definition: TLauncherMulti.h:74
void display()
Definition: TLauncherMulti.cxx:297
TString _sworkingDirectory
Root of working directories.
Definition: TLauncherMulti.h:81
Bool_t _bemptyMasterNode
Definition: TLauncherMulti.h:79
int nb_total_procs_
Definition: TLauncherMulti.h:89
int procsperjob_
Definition: TLauncherMulti.h:86
~TLauncherMulti()
Definition: TLauncherMulti.cxx:84
int getJobsNumber()
Definition: TLauncherMulti.h:104
TLauncherMulti()
Definition: TLauncherMulti.cxx:63
Interface of the class URANIE::Launcher::TCode.
bool availableRessource()
Definition: TLauncherMulti.cxx:203
Interface of the class URANIE::Launcher::TLSFCluster.
Bool_t getLog()
Definition: TLauncherMulti.h:137
Interface of the class URANIE::Launcher::TLoadLevelerCluster.
void mergeAll(const int niteration)
Definition: TLauncherMulti.cxx:262
Description of the class TCode.
Definition: TCode.h:48
TCluster * _edistrib
Definition: TLauncherMulti.h:77
void unsetLog()
Definition: TLauncherMulti.h:129
Interface of the class URANIE::Launcher::TLocalHostCluster.