English Français

Documentation / Developer's manual

Available modules

Calibration,  DataServer,  Launcher,  MetaModelOptim,  Modeler,  Optimizer,  ReLauncher,  Reliability,  ReOptimizer,  Sampler,  Sensitivity,  UncertModeler,  XmlProblem,   Uranie / Launcher: TEcCluster.h Source File
Uranie / Launcher v4.9.0
/* @license-end */
TEcCluster.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 TECCLUSTER_H
42#define TECCLUSTER_H
43
44#include <iostream>
45#include <sstream>
46#include <TPRegexp.h>
47
48using std::cout;
49using std::endl;
50using std::istringstream;
51using std::string;
52#define BUF_SIZE 128
53//ROOT
54#include "Rtypes.h"
55
56// Uranie
57#include "TCluster.h"
58#include "TCode.h"
59
60namespace URANIE
61{
62namespace Launcher
63{
64//#pragma clang diagnostic push
65//#pragma clang diagnostic ignored "-Winconsistent-missing-override"
66class TEcCluster: public TCluster
67{
68private:
69 static const char *nodeList();
70
71public:
72#ifdef WITH_LIBSSH
73 EDistrib _edistrib=EDistrib::kEc;
74#endif
75 static bool eligible();
76
77 //---------------------------------------------
81
82 TEcCluster();
83#ifdef WITH_LIBSSH
84 TEcCluster(URANIE::DataServer::TDataServer *tds, TCode *code);
85 TEcCluster(TCode *code);
86#endif
87
91
92 //---------------------------------------------
96
97 void init() override;
98 void getCommandPrefix(char *, char *) override;
100
101 //---------------------------------------------
105 void setLog()
106 {
107 _blog = kTRUE;
108 }
109 void unsetLog()
110 {
111 _blog = kFALSE;
112 }
114 {
115 _blog = _blog ? kFALSE : kTRUE;
116 }
117 Bool_t getLog()
118 {
119 return _blog;
120 }
121 virtual void printLog(Option_t *option = "") override;
123 // These functions , will always return 0 due ecmwf plafform being connected in every command send.
125
129#ifdef WITH_LIBSSH
130 virtual void setCluster(TString cluster_name) override
131 {
132 _sClusterName = cluster_name;
133 _sClusterIP="ecaccess.ecmwf.int";
134 _eType="kEc";
135 _sConnectionProtocol="ecaccess";
136 _sConnected=kTRUE;
137 cluster_name.ToLower();
138 if ( cluster_name.Contains("cca") )
139 {
140 _sGateWay="cca";
141 }
142 else if ( cluster_name.Contains("ccb") )
143 {
144 _sGateWay="ccb";
145 }
146 else if ( cluster_name.Contains("ecgate") )
147 {
148 _sGateWay="ecgate";
149 }
150 else
151 {
152 _sGateWay="cca";
153 }
154
155 }
156 Int_t sendHeader() ;
157 Int_t sendCompiledBinary(std::list<TString> filenames) ;
158
159 Int_t retrieveInputFiles(const char * localFolder) ;
160
161 TString getJobStatusCommand(std::list<std::pair<TString, std::pair<int, int> > > JobList);
162 TString checkJobStatus(TString JobId, TString Command) ;
163
164 Int_t closeSFTPChannel()
165 {
166 return 0;
167 }
168
169 Int_t sendInputFiles(Int_t start, Int_t end);
170 TString submitJob(TString command) override;
171 virtual void selectHeader(TString SkeletonHeaderName="header_skeleton.in",TString localHeaderFolderPath=gSystem->pwd() ) override;
172 virtual void generateHeader(Option_t *option = "") override;
173 virtual void generateHeaderSplit(Option_t *option = "") override;
174#endif
175 TString GetFromPipe(const char *command, bool output = false);
176public:
177};
178//#pragma clang diagnostic pop
179
180} // Fin du namespace Launcher
181} // Fin du namespace URANIE
182#endif
Interface of the class URANIE::Launcher::TCluster.
Interface of the class URANIE::Launcher::TCode.
Description of the class TCluster.
Definition TCluster.h:71
Bool_t _blog
Boolean to edit the log.
Definition TCluster.h:73
Description of the class TCode.
Definition TCode.h:46
Description of the class TEcCluster.
Definition TEcCluster.h:67
void unsetLog()
Definition TEcCluster.h:109
~TEcCluster()
Default destructor.
Definition TEcCluster.cxx:72
TString GetFromPipe(const char *command, bool output=false)
Sets the Cluster name.
Definition TEcCluster.cxx:327
static const char * nodeList()
Bool_t getLog()
Definition TEcCluster.h:117
void setLog()
Definition TEcCluster.h:105
void init() override
Construct and return the list of nodes.
Definition TEcCluster.cxx:82
void getCommandPrefix(char *, char *) override
Definition TEcCluster.cxx:321
void changeLog()
Definition TEcCluster.h:113
TEcCluster()
Default constructor.
Definition TEcCluster.cxx:48
virtual void printLog(Option_t *option="") override
Definition TEcCluster.cxx:353
Definition TCluster.h:67