75 enum EDistrib { kUnknown, kLSB, kSLURM, kMPI, kPBS, kSGE, kEc };
89 TCluster(
const char* name,
const char *nodeList, Int_t nnode);
107 void setWorkingDirectory(TString localWorkingDirectory);
108 void setRemoteWorkingDirectory();
111 URANIE::DataServer::TDataServer* _tds;
156 void setClusterUserAuth(TString user ,TString authentification_method=
"public_key"){
158 _sClusterUserAuthMethod=authentification_method;
164 virtual void setCluster(TString cluster_name){
165 _sClusterName = cluster_name;
168 virtual void setCluster(TCluster *cluster);
174 TString getClusterName()
const{
175 return _sClusterName;
181 TString getClusterIP()
const{
188 TString setClusterIP()
const{
195 void setSkeleton(TString skeleton){
196 _sSkeletonHeader = skeleton;
202 TString getSkeleton()
const{
203 return _sSkeletonHeader;
210 void setOutputHeaderName(TString oHeaderName){
212 const char *tail = strrchr(oHeaderName.Data(),
'/');
213 _sOutputHeader = tail ? tail + 1 : oHeaderName.Data();
215 _sOutputHeader=basename(oHeaderName);
232 void setJobID(TString jobid){
233 _sJobID.push_back(jobid);
241 void setNRetries(Int_t retries){
250 TString getOutputHeaderName()
const{
251 return _sOutputHeader;
258 TString getOutputHeaderPath()
const{
259 return _sOutputHeaderPath;
266 TString getClusterUser()
const{
267 return _sClusterUser;
274 TString getClusterUserAuthMethod()
const{
275 return _sClusterUserAuthMethod;
282 TString getRemotePath()
const{
283 return _sRemoteWorkingDirectory;
290 TString getOutputSsh()
const{
298 TString getSplitName()
const{
306 TString getJobID(Int_t index)
const{
307 return _sJobID.at(index);
313 void setNumberOfCores(Int_t ncores){
314 _nAllocatedCores = ncores;
320 Int_t getNumberOfCores()
const{
321 return _nAllocatedCores;
326 void preTreatment(Option_t *option=
"");
333 void addClusterDirective(TString directive, TString value);
339 void setJobName(TString path){
346 TString getJobName(){
361 Int_t connectSSH(TString cluster_name , TString user, TString authentification_method);
366 Int_t verify_knownhostSSH();
372 Int_t openSFTPChannel();
378 Int_t sendCompiledBinary(std::list<TString> filenames);
384 Int_t sendInputFiles(Int_t start, Int_t end);
391 Int_t retrieveInputFiles(
const char * localFolder);
398 Int_t closeSFTPChannel();
404 void setRemotePath(TString remotePath){
405 if (!remotePath.EndsWith(
"/"))
407 remotePath.Append(
"/");
409 _sRemoteWorkingDirectory = remotePath;
416 void setDataServer(URANIE::DataServer::TDataServer *tds){
428 Bool_t isConnected(){
432 virtual void selectHeader(TString SkeletonHeaderName=
"./",TString localHeaderFolderPath=gSystem->pwd() ) {UNUSED(SkeletonHeaderName,localHeaderFolderPath); cout <<
"base" <<endl;};
433 virtual void generateHeader(Option_t *option =
"") {UNUSED(option); cout <<
"base" <<endl;};
434 virtual void generateHeaderSplit(Option_t *option =
"") {UNUSED(option); cout <<
"base" <<endl;};
435 TString getJobStatusCommand(std::list<std::pair<TString, std::pair<int, int> > > JobList) {UNUSED(JobList);
return "base";};
436 TString getJobStatusCommand(TString JobIDs) {UNUSED(JobIDs);
return "base";};
437 TString checkJobStatus(TString JobId, TString Command) {UNUSED(JobId,Command);
return "base";};
438 void substituteDirectives(TString infilePath, TString outFilePath, std::map<TString,TString> ListOfDirectives);
441 void execRemoteCommand(TString command);
442 virtual TString submitJob(TString command);
444 void replaceHeaderKey(std::string& source,
const std::string& from,
const std::string& to);
453 ssh_session _sSshSession;
458 sftp_session _sFtpSession;
459 ssh_session *_ptrsshSession;
464 sftp_session * _ptrsftp;
475 TString _sSkeletonHeader;
479 TString _sOutputHeader;
487 TString _sWorkingDirectory;
491 TString _sOutputHeaderPath;
499 TString _slocalHeaderFolderPath;
503 Int_t _nAllocatedCores;
513 TString _sRemoteWorkingDirectory;
522 TString _sClusterUser;
527 TString _sClusterUserAuthMethod;
532 TString _sClusterName;
545 vector<TString> _sJobID;
549 Bool_t _sUserBinary=kFALSE;
553 TString _sConnectionProtocol=
"ssh";
558 std::map<TString,TString> _sListClusterDirectives;