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.9.0
/* @license-end */
TLauncherMulti.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
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
63using std::cout;
64using std::endl;
65using std::list;
66using std::string;
67using std::istringstream;
68
69namespace URANIE
70{
71namespace Launcher
72{
73
74struct job
75{
76 pid_t pid;
77 list<string> hostlist;
79};
80
81class TLauncherMulti: public TNamed
82{
83public:
84 //enum EDistrib { kUnknown, kLSB, kSLURM, kMPI, kPBS, kSGE };
85private:
86 //EDistrib _edistrib; ///< The type of distribution
88 Bool_t _blog;
89 Bool_t _bemptyMasterNode; //Boolean for strategy of parallel runs
90 Bool_t _bmultidump; //Boolean for strategy of parallel runs
92
93 int njobs_; // Number of job to run
94
95 TString exe_; // Binary to execute
96 int procsperjob_; // Number of procs per job
97
98 int nb_avail_procs_; // Number of available procs
99 int nb_total_procs_; //Number of procs allocated by the system
100 int delay_; //number of seconds for temporisation between first and last proc
101 list<string> hostslist_; // List of available procs
102
103 list<job> runningjobs_; // List of running jobs
104
106
107public:
109 TLauncherMulti(const char* name, const char* title, Option_t *option,
110 Bool_t emptyMasterNode, Int_t delay, bool dumpmulti=false);
112
113 void createHostsList(Option_t *option);
114 void defineJob(const char* exe, int njobs, int nprocs);
115
116 void waitForProcs();
117
118 void createJob(int iteration);
119 void run(TCode* code, Option_t *option);
120
121 void waitAll();
122
123 inline int getJobsNumber()
124 {
125 return njobs_;
126 }
127 inline int getAvailableProcs()
128 {
129 return nb_avail_procs_;
130 }
131
132 inline void setWorkingDir(TString sdir)
133 {
134 _sworkingDirectory = sdir;
135 }
136
137 void mergeAll(const int niteration);
138 void display();//TString str, TString cut, TString opt);
139
140 //---------------------------------------------
144 void setLog()
145 {
146 _blog = kTRUE;
147 }
148 void unsetLog()
149 {
150 _blog = kFALSE;
151 }
153 {
154 _blog = _blog ? kFALSE : kTRUE;
155 }
156 Bool_t getLog()
157 {
158 return _blog;
159 }
160 virtual void printLog(Option_t *option = "");
162
163 ClassDef(URANIE::Launcher::TLauncherMulti, ID_LAUNCHER)
164 // Classe TLauncherMulti
165};
166
167} // Fin du namespace Launcher
168} // Fin du namespace URANIE
169#endif
170
Interface of the class URANIE::Launcher::TCluster.
Interface of the class URANIE::Launcher::TCode.
Interface of the class URANIE::Launcher::TLSFCluster.
Interface of the class URANIE::Launcher::TLoadLevelerCluster.
Interface of the class URANIE::Launcher::TLocalHostCluster.
Interface of class URANIE::Launcher::TSGECluster.
Description of the class TCluster.
Definition TCluster.h:71
Description of the class TCode.
Definition TCode.h:46
Description of the class TLauncherMulti.
Definition TLauncherMulti.h:82
TString exe_
Definition TLauncherMulti.h:95
Bool_t getLog()
Definition TLauncherMulti.h:156
list< job > runningjobs_
Definition TLauncherMulti.h:103
int nb_avail_procs_
Definition TLauncherMulti.h:98
void changeLog()
Definition TLauncherMulti.h:152
void createHostsList(Option_t *option)
Definition TLauncherMulti.cxx:91
void setLog()
Definition TLauncherMulti.h:144
list< string > hostslist_
Definition TLauncherMulti.h:101
TString _sworkingDirectory
Root of working directories.
Definition TLauncherMulti.h:91
pid_t _masterpid
Pid of the master.
Definition TLauncherMulti.h:105
void defineJob(const char *exe, int njobs, int nprocs)
Definition TLauncherMulti.cxx:214
TLauncherMulti()
Definition TLauncherMulti.cxx:62
int getAvailableProcs()
Definition TLauncherMulti.h:127
int njobs_
Definition TLauncherMulti.h:93
void waitAll()
Definition TLauncherMulti.cxx:404
void unsetLog()
Definition TLauncherMulti.h:148
void mergeAll(const int niteration)
Definition TLauncherMulti.cxx:435
TCluster * _edistrib
Definition TLauncherMulti.h:87
void waitForProcs()
Definition TLauncherMulti.cxx:230
void run(TCode *code, Option_t *option)
Definition TLauncherMulti.cxx:388
Bool_t _bmultidump
Definition TLauncherMulti.h:90
~TLauncherMulti()
Definition TLauncherMulti.cxx:84
void display()
Definition TLauncherMulti.cxx:471
int getJobsNumber()
Definition TLauncherMulti.h:123
virtual void printLog(Option_t *option="")
Definition TLauncherMulti.cxx:494
void setWorkingDir(TString sdir)
Definition TLauncherMulti.h:132
void createJob(int iteration)
Definition TLauncherMulti.cxx:288
Bool_t _bemptyMasterNode
Definition TLauncherMulti.h:89
Bool_t _blog
Boolean to edit the log.
Definition TLauncherMulti.h:88
int delay_
Definition TLauncherMulti.h:100
int nb_total_procs_
Definition TLauncherMulti.h:99
int procsperjob_
Definition TLauncherMulti.h:96
Definition TCluster.h:67
Definition TLauncherMulti.h:75
pid_t pid
Definition TLauncherMulti.h:76
list< string > hostlist
Definition TLauncherMulti.h:77
int testnumber
Definition TLauncherMulti.h:78