Logo ROOT  
Reference Guide
TAlien.cxx
Go to the documentation of this file.
1 // @(#)root/alien:$Id: db925cce3e3dc34e650f92e7e84655fb84ef04e9 $
2 // Author: Andreas Peters 5/5/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 //////////////////////////////////////////////////////////////////////////
13 // //
14 // TAlien //
15 // //
16 // Class defining interface to TAlien GRID services. //
17 // //
18 // To force to connect to a running API Service, use //
19 // - TGrid::Connect("alien://<apihosturl>/","user"); //
20 // //
21 // If you want to use TGrid::Connect("alien://"); //
22 // you have to set the environment variables //
23 // export alien_API_HOST=<host> //
24 // export alien_API_PORT=<port> //
25 // export alien_API_USER=<user> //
26 // //
27 // //
28 // some examples: //
29 // -------------------------------------------------------------------- //
30 // connect in an initialized API environemnt (see above) //
31 // > TGrid::Connect("alien://"); //
32 // -> this is not thread safe //
33 // connect using an already established shell token: //
34 // > TGrid::Connect("alien://",0,0,"t"); //
35 // -> this is thread safe //
36 // -------------------------------------------------------------------- //
37 // change the working directory //
38 // > gGrid->Cd("/alice"); //=> returns 1 for success, 0 for error //
39 // //
40 // //
41 // -------------------------------------------------------------------- //
42 // get the working directory //
43 // > printf("Working Directory is %s\n",gGrid->Pwd()); //
44 // //
45 // //
46 // -------------------------------------------------------------------- //
47 // get a filename list of the working directory and print it //
48 // > TGridResult* result = gGrid->Ls("/alice"); //
49 // > Int_t i=0; //
50 // > while (result->GetFileName(i))\ //
51 // printf("File %s\n",result->GetFileName(i++)); //
52 // -------------------------------------------------------------------- //
53 // //
54 // get all file permissions //
55 // > TGridResult* result = gGrid->Ls("/alice","-la"); //
56 // > while (result->GetFileName(i))\ //
57 // printf("The permissions are %s\n",result->GetKey(i++,"permissions") //
58 // //
59 // => the defined keys for GetKey can be seen using result->Print(); //
60 // -------------------------------------------------------------------- //
61 //////////////////////////////////////////////////////////////////////////
62 
63 #include <stdlib.h>
64 #include "TAlien.h"
65 #include "TUrl.h"
66 #include "Riostream.h"
67 #include "TString.h"
68 #include "TObjString.h"
69 #include "TMap.h"
70 #include "TSystem.h"
71 #include "TAlienJDL.h"
72 #include "TAlienResult.h"
73 #include "TAlienJob.h"
74 #include "TAlienCollection.h"
75 #include "TAlienMasterJobStatus.h"
76 #include "TAlienJobStatusList.h"
77 #include "TAlienJobStatus.h"
78 #include "gapiUI.h"
79 #include "gapi_job_operations.h"
80 
81 using namespace std;
82 
83 
84 
86 
87 ////////////////////////////////////////////////////////////////////////////////
88 
89 TAlien::TAlien(const char *gridurl, const char *uid, const char * passwd,
90  const char *options)
91 {
92  gSystem->Unsetenv("GCLIENT_EXTRA_ARG");
93 
94  // Connect to the AliEn grid.
95  TUrl *gurl = new TUrl(gridurl);
96 
97  fGridUrl = gridurl;
98  fGrid = "alien";
99  if (!strlen(gurl->GetHost())) {
100  if (gSystem->Getenv("alien_API_HOST"))
101  fHost = gSystem->Getenv("alien_API_HOST");
102  else
103  fHost = "";
104  } else {
105  fHost = gurl->GetHost();
106  }
107 
108  if (gurl->GetPort()<=0) {
109  if (gSystem->Getenv("alien_API_PORT"))
110  fPort = atoi(gSystem->Getenv("alien_API_PORT"));
111  else
112  fPort = 0;
113  } else {
114  fPort = gurl->GetPort();
115  }
116 
117  if (!uid[0]) {
118  if (gSystem->Getenv("alien_API_USER")) {
119  fUser = gSystem->Getenv("alien_API_USER");
120  } else {
121  if (gSystem->Getenv("LOGNAME")) {
122  // we try the LOGNAME env
123  fUser = gSystem->Getenv("LOGNAME");
124  } else {
125  // we set the USER env
126  fUser = gSystem->Getenv("USER");
127  }
128  }
129  } else {
130  fUser = uid;
131  }
132 
133  fOptions = options;
134 
135  if (gDebug > 1)
136  Info("TAlien", "%s => %s port: %d user: %s",gridurl,fHost.Data(),fPort,fUser.Data());
137 
138  Bool_t fstoken;
139  fstoken = kFALSE;
140 
141  if (options && (options[0] == 't')) {
142  fGc = GapiUI::MakeGapiUI(kTRUE);
143  fstoken = kTRUE;
144  } else {
145  fGc = GapiUI::MakeGapiUI(kFALSE);
146  }
147 
148  if (!fGc) {
149  Error("TAlien", "could not connect to a alien service at:");
150  Error("TAlien", "host: %s port: %d user: %s", fHost.Data(), fPort, fUser.Data());
151  MakeZombie();
152  } else {
153  if (passwd) {
154  if (!passwd[0]) {
155  passwd = 0;
156  }
157  }
158  if (fstoken) {
159  if (!Command("motd")) {
160  Error("TAlien", "we have no valid connection ... I try to connect ...");
161  fGc->Connect(fHost, fPort, fUser, passwd);
162  }
163  } else {
164  fGc->Connect(fHost, fPort, fUser, passwd);
165  }
166 
167  char cwd[1024];
168  const char* cwdp=0;
169  cwdp=Pwd();
170  fHome=TString("/");
171  if (cwdp) {
172  sprintf(cwd,"%s",cwdp);
173  if (Cd("")) {
174  cwdp=Pwd();
175  if (cwdp) {
176  fHome = TString(cwdp);
177  }
178  }
179  }
180 
181  if (!fGc->Connected()) {
182  Error("TAlien", "could not authenticate at:");
183  Error("TAlien", "host: %s port: %d user: %s",fHost.Data(),fPort,fUser.Data());
184  MakeZombie();
185  } else {
186  gGrid = this;
187  Command("motd");
188  Stdout();
189  }
190  // export this UI to all POSIX functions like gapi_dir_xxx gapi_job_xxx
191  fGc->SetGapiUI(fGc);
192  }
193  delete gurl;
194 }
195 
196 ////////////////////////////////////////////////////////////////////////////////
197 /// do we need to delete fGc ? (rdm)
198 
200 {
201  if (gDebug > 1)
202  Info("~TAlien", "destructor called");
203 }
204 
205 ////////////////////////////////////////////////////////////////////////////////
206 /// Start an interactive AliEn shell.
207 
209 {
210  fGc->Shell();
211 }
212 
213 ////////////////////////////////////////////////////////////////////////////////
214 /// Escape \" by \\\".
215 
216 TString TAlien::Escape(const char *input)
217 {
218  if (!input)
219  return TString();
220 
221  TString output(input);
222  output.ReplaceAll("\"", "\\\"");
223 
224  return output;
225 }
226 
227 ////////////////////////////////////////////////////////////////////////////////
228 /// Submit a command to AliEn. Returns 0 in case of error.
229 
230 TGridJob *TAlien::Submit(const char *jdl)
231 {
232  if (!jdl)
233  return 0;
234 
235  TString command("submit =< ");
236  //command += Escape(jdl);
237  command += jdl;
238 
239  cout << command << endl;
240 
241  TGridResult* result = Command(command,kFALSE,kOUTPUT);
242  TAlienResult* alienResult = dynamic_cast<TAlienResult*>(result);
243  TList* list = dynamic_cast<TList*>(alienResult);
244  if (!list) {
245  if (result)
246  delete result;
247  return 0;
248  }
249 
250  alienResult->DumpResult();
251 
252  TString jobID = "0";
253 
254  TIterator* iter = list->MakeIterator();
255  TObject* object = 0;
256  while ((object = iter->Next()) != 0) {
257  TMap* map = dynamic_cast<TMap*>(object);
258 
259  TObject* jobIDObject = map->GetValue("jobId");
260  TObjString* jobIDStr = dynamic_cast<TObjString*>(jobIDObject);
261  if (jobIDStr) {
262  jobID = jobIDStr->GetString();
263  }
264  }
265  delete iter;
266  delete result;
267 
268  if (jobID == "0") {
269  Error("Submit", "error submitting job");
270  return 0;
271  }
272 
273  Info("Submit", "your job was submitted with the ID = %s", jobID.Data());
274 
275  return dynamic_cast<TGridJob*>(new TAlienJob(jobID));
276 }
277 
278 ////////////////////////////////////////////////////////////////////////////////
279 /// Create a Alien JDL.
280 
282 {
283  return new TAlienJDL();
284 }
285 
286 ////////////////////////////////////////////////////////////////////////////////
287 /// Get job status list.
288 
289 TGridJobStatusList *TAlien::Ps(const char* /*options*/, Bool_t verbose)
290 {
291  GAPI_JOBARRAY* gjobarray = gapi_queryjobs("-", gGrid->GetUser(), "-", "-", "-",
292  "-", "-", "-", "-");
293  if (!gjobarray)
294  return 0;
295 
296  if (gjobarray->size() == 0) {
297  delete gjobarray;
298  return 0;
299  }
300 
301  TGridJobStatusList* joblist = new TAlienJobStatusList();
302 
303  for (UInt_t i = 0; i < gjobarray->size(); i++ ) {
304  TMap* statusmap = new TMap();
305  GAPI_JOB gjob = gjobarray->at(i);
306  std::map<std::string, std::string>::const_iterator iter = gjob.gapi_jobmap.begin();
307  for (; iter != gjob.gapi_jobmap.end(); ++iter) {
308  // printf("Adding %s = %s\n", iter->first.c_str(),iter->second.c_str());
309  statusmap->Add(new TObjString(iter->first.c_str()), new TObjString(iter->second.c_str()));
310  }
311  TGridJobStatus *status = (TGridJobStatus*)new TAlienJobStatus(statusmap);
312  joblist->Add((TGridJobStatus*)status);
313  if (verbose) {
314  }
315  }
316  delete gjobarray;
317  return joblist;
318 }
319 
320 ////////////////////////////////////////////////////////////////////////////////
321 /// Kill a specific job.
322 
324 {
325  if (gapi_kill(atoi(jobid.Data())))
326  return kFALSE;
327  else
328  return kTRUE;
329 }
330 
331 ////////////////////////////////////////////////////////////////////////////////
332 /// Resubmit a specific job.
333 
335 {
336  if (gapi_resubmit(atoi(jobid.Data())))
337  return kFALSE;
338  else
339  return kTRUE;
340 }
341 
342 ////////////////////////////////////////////////////////////////////////////////
343 /// Execute AliEn command. Returns 0 in case or error.
344 
345 TGridResult *TAlien::Command(const char *command, bool interactive, UInt_t stream)
346 {
347  if (fGc) {
348  if (fGc->Command(command)) {
349  // command successful
350  TAlienResult* gresult = new TAlienResult();
351 
352  for (Int_t column = 0 ; column < (fGc->GetStreamColumns(stream)); column++) {
353  TMap *gmap = new TMap();
354  gmap->SetOwner(kTRUE);
355  for (Int_t row=0; row < fGc->GetStreamRows(stream,column); row++) {
356  gmap->Add((TObject*)(new TObjString(fGc->GetStreamFieldKey(stream,column,row))),
357  (TObject*)(new TObjString(fGc->GetStreamFieldValue(stream,column,row))));
358  }
359  gresult->Add(gmap);
360  }
361 
362  if (interactive) {
363  // write also stdout/stderr to the screen
364  fGc->DebugDumpStreams();
365  }
366  return gresult;
367  }
368  }
369  return 0;
370 }
371 
372 ////////////////////////////////////////////////////////////////////////////////
373 
375 {
376  return Command("locatesites");
377 }
378 
379 ////////////////////////////////////////////////////////////////////////////////
380 
382 {
383  if (fGc) {
384  fGc->PrintCommandStdout();
385  }
386 }
387 
388 ////////////////////////////////////////////////////////////////////////////////
389 
391 {
392  if (fGc) {
393  fGc->PrintCommandStderr();
394  }
395 }
396 
397 ////////////////////////////////////////////////////////////////////////////////
398 
399 TGridResult *TAlien::Query(const char *path, const char *pattern,
400  const char *conditions, const char *options)
401 {
402  TString cmdline = TString("find -z ") + TString(options) + TString(" ") + TString(path) + TString(" ") + TString(pattern) + TString(" ") + TString(conditions);
403  return Command(cmdline);
404 }
405 
406 ////////////////////////////////////////////////////////////////////////////////
407 
408 TGridResult *TAlien::OpenDataset(const char *lfn, const char *options)
409 {
410  TString cmdline = TString("getdataset") + TString(" ") + TString(options) + TString(" ") + TString(lfn);
411  return Command(cmdline, kTRUE);
412 }
413 
414 ////////////////////////////////////////////////////////////////////////////////
415 
417 {
418  TMap *gmap = new TMap();
419  for (Int_t row = 0; row < fGc->GetStreamRows(stream,column); row++) {
420  gmap->Add((TObject*)(new TObjString(fGc->GetStreamFieldKey(stream,column,row))),
421  (TObject*)(new TObjString(fGc->GetStreamFieldValue(stream,column,row))));
422  }
423  return gmap;
424 }
425 
426 ////////////////////////////////////////////////////////////////////////////////
427 
428 const char *TAlien::GetStreamFieldValue(UInt_t stream, UInt_t column, UInt_t row)
429 {
430  return fGc->GetStreamFieldValue(stream,column,row);
431 }
432 
433 ////////////////////////////////////////////////////////////////////////////////
434 
435 const char *TAlien::GetStreamFieldKey(UInt_t stream, UInt_t column, UInt_t row)
436 {
437  return fGc->GetStreamFieldKey(stream,column,row);
438 }
439 
440 ////////////////////////////////////////////////////////////////////////////////
441 
443 {
444  return fGc->GetStreamColumns(stream);
445 }
446 
447 //--- Catalogue Interface
448 
449 ////////////////////////////////////////////////////////////////////////////////
450 
451 TGridResult *TAlien::Ls(const char* ldn, Option_t* options, Bool_t verbose)
452 {
453  TString cmdline = TString("ls") + TString(" ") + TString(options) + TString(" ") + TString(ldn);
454 
455  return Command(cmdline, verbose);
456 }
457 
458 ////////////////////////////////////////////////////////////////////////////////
459 
460 Bool_t TAlien::Cd(const char* ldn, Bool_t verbose)
461 {
462  TString cmdline = TString("cd") + TString(" ") + TString(ldn);
463 
464  Command(cmdline, kFALSE);
465 
466  if (verbose) {
467  Stdout();
468  Stderr();
469  }
470 
471  const char* result = (GetStreamFieldValue(kOUTPUT,0,0));
472  if (result) {
473  if (strlen(result) > 0) {
474  if (atoi(result) == 1) {
475  return kTRUE;
476  }
477  }
478  }
479 
480  Error("Cd","Cannot change to directory %s\n",ldn);
481  if (!verbose) Stdout();
482  return kFALSE;
483 }
484 
485 ////////////////////////////////////////////////////////////////////////////////
486 
488 {
489  TString cmdline = TString("pwd");
490 
491  TGridResult* result = Command(cmdline, kFALSE, kENVIR);
492 
493  if (verbose) {
494  Stdout();
495  Stderr();
496  }
497 
498  if (result) {
499  TMap* resultmap = ((TMap*)result->At(0));
500  if (resultmap) {
501  TObjString* pwd = (TObjString*)resultmap->GetValue("pwd");
502  if (pwd) {
503  fPwd = pwd->GetName();
504  delete resultmap;
505  return fPwd;
506  } else {
507  delete resultmap;
508  return 0;
509  }
510  }
511  }
512 
513  Error("pwd","Cannot get current working directory\n");
514  if (!verbose) Stdout();
515  return 0;
516 }
517 
518 ////////////////////////////////////////////////////////////////////////////////
519 
520 Int_t TAlien::Mkdir(const char* ldn, Option_t* options, Bool_t verbose)
521 {
522  TString cmdline = TString("mkdir");
523  if (strlen(options)) {
524  cmdline += (TString(" ") + TString(options));
525  }
526 
527  cmdline += (TString(" -s ") + TString(ldn));
528 
529  Command(cmdline, kFALSE);
530 
531  if (verbose) {
532  Stdout();
533  Stderr();
534  }
535 
536  const char* result = (GetStreamFieldValue(kOUTPUT,0,0));
537  if (result) {
538  if (strlen(result) > 0) {
539  if (atoi(result) > 0) {
540  return atoi(result);
541  }
542  }
543  }
544 
545  Error("Mkdir","Cannot create directory %s\n",ldn);
546  if (!verbose) Stdout();
547  return 0;
548 }
549 
550 ////////////////////////////////////////////////////////////////////////////////
551 
552 Bool_t TAlien::Rmdir(const char* ldn, Option_t* options, Bool_t verbose)
553 {
554  TString cmdline = TString("rmdir");
555  if (strlen(options)) {
556  cmdline += (TString(" ") + TString(options));
557  } else {
558  cmdline += (TString(" -s ") + TString(ldn));
559  }
560 
561  Command(cmdline, kFALSE);
562 
563  if (verbose) {
564  Stdout();
565  Stderr();
566  }
567 
568  const char* result = (GetStreamFieldValue(kOUTPUT,0,0));
569  if (result) {
570  if (strlen(result) > 0) {
571  if (atoi(result) == 1) {
572  return kTRUE;
573  }
574  }
575  }
576 
577  Error("Rmdir","Cannot remove directory %s\n",ldn);
578  return kTRUE;
579 }
580 
581 ////////////////////////////////////////////////////////////////////////////////
582 
583 Bool_t TAlien::Register(const char* lfn, const char* turl, Long_t size, const char* se, const char* guid, Bool_t verbose)
584 {
585  TString cmdline = TString("register") + TString(" ") + TString(lfn) + TString(" ") + TString(turl);
586  if (se) {
587  cmdline += TString(" ");
588  cmdline += size;
589  cmdline += TString(" ");
590  cmdline += TString(se);
591  if (guid) {
592  cmdline += TString(" ");
593  cmdline += TString(guid);
594  }
595  }
596 
597  Command(cmdline, kFALSE);
598 
599  if (verbose) {
600  Stdout();
601  Stderr();
602  }
603 
604  const char* result = (GetStreamFieldValue(kOUTPUT,0,0));
605  if (result) {
606  if (strlen(result) > 0) {
607  if (atoi(result) == 1) {
608  return kTRUE;
609  }
610  }
611  }
612 
613  return kFALSE;
614 }
615 
616 ////////////////////////////////////////////////////////////////////////////////
617 
618 Bool_t TAlien::Rm(const char* lfn, Option_t* options, Bool_t verbose)
619 {
620  TString cmdline = TString("rm") + TString(" -s ") + TString(options) + TString(" ") + TString(lfn);
621 
622  Command(cmdline, kFALSE);
623 
624  if (verbose) {
625  Stdout();
626  Stderr();
627  }
628 
629  const char* result = (GetStreamFieldValue(kOUTPUT,0,0));
630  if (result) {
631  if (strlen(result) > 0) {
632  if (atoi(result) == 1) {
633  return kTRUE;
634  }
635  }
636  }
637 
638  Error("Rm","Cannot remove %s\n",lfn);
639  return kFALSE;
640 }
641 
642 ////////////////////////////////////////////////////////////////////////////////
643 /// Factory function for a TAlienCollection based on an XML file.
644 
645 TGridCollection *TAlien::OpenCollection(const char *collectionfile,
646  UInt_t maxentries)
647 {
648  TString path(collectionfile);
649  if (path.BeginsWith("alien://", TString::kIgnoreCase)) {
650  TAlien* alien = dynamic_cast<TAlien*> (gGrid);
651  if (!alien) {
652  Error("OpenCollection",
653  "Trying to read a collection, but gGrid not initialized with AliEn");
654  return 0;
655  }
656  TString lfn = path(strlen("alien://"), path.Length());
657  if (alien->Type(lfn) == kCollection) {
658  // it is a collection
659  TGridResult* gridResult = alien->GetCollection(lfn);
660  if (!gridResult) {
661  Error("OpenCollection",
662  "Could not retrieve collection %s from the catalog", collectionfile);
663  return 0;
664  }
665 
666  return TAlienCollection::OpenAlienCollection(gridResult);
667  }
668  }
669 
670  return TAlienCollection::Open(collectionfile, maxentries);
671 }
672 
673 ////////////////////////////////////////////////////////////////////////////////
674 /// Factory function fo a TAlienCollection based on a gGrid Query.
675 
677  Bool_t nogrouping)
678 {
679  return (TGridCollection*)TAlienCollection::OpenQuery(queryresult, nogrouping);
680 }
681 
682 ////////////////////////////////////////////////////////////////////////////////
683 /// returns the type of the given lfn
684 
686 {
687  TString cmdline = TString("type -z") + TString(" ") + TString(option) + TString(" ") + TString(lfn);
688 
689  TGridResult* gridResult = Command(cmdline, kFALSE);
690 
691  if (verbose) {
692  Stdout();
693  Stderr();
694  }
695 
696  if (!gridResult) {
697  Error("Type", "Did not receive TGridResult from query %s", cmdline.Data());
698  return kFailed;
699  }
700 
701  const char* typeStr = gridResult->GetKey(0, "type");
702  if (!typeStr || !typeStr[0]) {
703  Error("Type", "Could not get type of %s", lfn);
704  delete gridResult;
705  return kFailed;
706  }
707 
708  TAlien::CatalogType type = kFailed;
709 
710  if (strcmp(typeStr, "file") == 0) {
711  type = kFile;
712  } else if (strcmp(typeStr, "directory") == 0) {
713  type = kDirectory;
714  } else if (strcmp(typeStr, "collection") == 0) {
715  type = kCollection;
716  } else
717  Error("Type", "Unknown type %s", typeStr);
718 
719  delete gridResult;
720 
721  return type;
722 }
723 
724 ////////////////////////////////////////////////////////////////////////////////
725 ///
726 
728 {
729  TString cmdline = TString("listFilesFromCollection -z -v") + TString(" ") + TString(option) + TString(" ") + TString(lfn);
730 
731  TGridResult* gridResult = Command(cmdline, kFALSE);
732 
733  if (verbose) {
734  Stdout();
735  Stderr();
736  }
737 
738  return gridResult;
739 }
740 
741 ////////////////////////////////////////////////////////////////////////////////
742 /// List packages in the specified directory.
743 
744 TGridResult* TAlien::ListPackages(const char* alienpackagedir)
745 {
746  if (!alienpackagedir) {
747  alienpackagedir = "/alice/packages";
748  }
749 
751 
752  TGridResult* result = Ls(alienpackagedir);
753  if (result) {
754  Int_t i=0;
755  while ( result->GetFileName(i)) {
756  TString pname=result->GetFileName(i);
757  TGridResult* version = Ls(Form("%s/%s",alienpackagedir,pname.Data()));
758  if (version) {
759  Int_t j=0;
760  while (version->GetFileName(j)) {
761  TString pversion=version->GetFileName(j);
762  if ((pversion.Contains("post_"))) {
763  } else {
764  TGridResult* platform = Ls(Form("%s/%s/%s",alienpackagedir,pname.Data(),pversion.Data()));
765  if (platform) {
766  Int_t k=0;
767  TString allplatform="";
768  while (platform->GetFileName(k)) {
769  TString pplatform=platform->GetFileName(k);
770  allplatform+=pplatform;
771  allplatform+=" ";
772  TMap* grmap = new TMap();
773  grmap->Add((TObject*) new TObjString("name"),
774  (TObject*) new TObjString(pplatform.Data()));
775  grmap->Add((TObject*) new TObjString("path"),
776  new TObjString( Form ( "%s/%s/%s/%s" , alienpackagedir,pname.Data(),pversion.Data(),pplatform.Data())));
777  gr->Add(grmap);
778  k++;
779  }
780  Info("ListPackages","Package: %-16s Version: %-20s Platform: [ %s ]",pname.Data(),pversion.Data(),allplatform.Data());
781  delete platform;
782  }
783  }
784  j++;
785  }
786  delete version;
787  }
788  i++;
789  }
790  delete result;
791  }
792  return gr;
793 }
TAlienJDL
Definition: TAlienJDL.h:26
TAlien::GetStreamFieldValue
const char * GetStreamFieldValue(UInt_t stream, UInt_t column, UInt_t row)
Definition: TAlien.cxx:428
TAlien::GetCollection
virtual TGridResult * GetCollection(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:727
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:100
TAlien::Stdout
void Stdout()
Definition: TAlien.cxx:381
TAlien.h
TAlien::Command
TGridResult * Command(const char *command, bool interactive=kFALSE, UInt_t stream=kOUTPUT)
Execute AliEn command. Returns 0 in case or error.
Definition: TAlien.cxx:345
TAlien::Escape
TString Escape(const char *input)
Escape " by \".
Definition: TAlien.cxx:216
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGridCollection
Definition: TGridCollection.h:34
TAlienCollection::OpenQuery
static TGridCollection * OpenQuery(TGridResult *queryresult, Bool_t nogrouping=kFALSE)
Static method used to create an Alien event collection, by creating collection from a TGridResult Que...
Definition: TAlienCollection.cxx:195
TString::Data
const char * Data() const
Definition: TString.h:369
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TObjString.h
TAlien::GetColumn
TMap * GetColumn(UInt_t stream=0, UInt_t column=0)
Definition: TAlien.cxx:416
TString::kIgnoreCase
@ kIgnoreCase
Definition: TString.h:268
output
static void output(int code)
Definition: gifencode.c:226
TAlien::Rmdir
virtual Bool_t Rmdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:552
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
TAlienResult.h
TUrl::GetPort
Int_t GetPort() const
Definition: TUrl.h:78
TMap::GetValue
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition: TMap.cxx:236
TGridResult::GetKey
virtual const char * GetKey(UInt_t, const char *) const
Definition: TGridResult.h:45
TObjString::GetString
const TString & GetString() const
Definition: TObjString.h:46
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
TAlien::CatalogType
CatalogType
Definition: TAlien.h:38
TAlien
Definition: TAlien.h:34
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
passwd
Definition: TWinNTSystem.h:47
TMap::Add
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
Definition: TMap.cxx:54
TString
Basic string class.
Definition: TString.h:136
TGridJobStatus
Definition: TGridJobStatus.h:26
TString.h
TObjString::GetName
const char * GetName() const
Returns name of object.
Definition: TObjString.h:38
bool
TIterator
Iterator abstract base class.
Definition: TIterator.h:30
object
TAlien::~TAlien
virtual ~TAlien()
do we need to delete fGc ? (rdm)
Definition: TAlien.cxx:199
TAlien::Type
virtual CatalogType Type(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
returns the type of the given lfn
Definition: TAlien.cxx:685
TGridJob
Definition: TGridJob.h:31
TObjString
Collectable string class.
Definition: TObjString.h:28
TList::MakeIterator
virtual TIterator * MakeIterator(Bool_t dir=kIterForward) const
Return a list iterator.
Definition: TList.cxx:722
TList::At
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
Definition: TList.cxx:357
TAlien::GetStreamFieldKey
const char * GetStreamFieldKey(UInt_t stream, UInt_t column, UInt_t row)
Definition: TAlien.cxx:435
TSystem.h
TAlien::OpenCollection
virtual TGridCollection * OpenCollection(const char *collectionfile, UInt_t maxentries=kTRUE)
Factory function for a TAlienCollection based on an XML file.
Definition: TAlien.cxx:645
TAlien::OpenDataset
virtual TGridResult * OpenDataset(const char *lfn, const char *options="")
Definition: TAlien.cxx:408
TGridResult
Definition: TGridResult.h:31
TAlienMasterJobStatus.h
size
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
gr
TGraphErrors * gr
Definition: legend1.C:25
gGrid
R__EXTERN TGrid * gGrid
Definition: TGrid.h:128
TAlien::Ps
virtual TGridJobStatusList * Ps(const char *options, Bool_t verbose=kTRUE)
Get job status list.
Definition: TAlien.cxx:289
TAlien::Pwd
virtual const char * Pwd(Bool_t verbose=kFALSE)
Definition: TAlien.cxx:487
TAlien::LocateSites
virtual TGridResult * LocateSites()
Definition: TAlien.cxx:374
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:101
TGridJobStatusList
Definition: TGridJobStatusList.h:30
Long_t
long Long_t
Definition: RtypesCore.h:54
TAlien::Shell
void Shell()
Start an interactive AliEn shell.
Definition: TAlien.cxx:208
gDebug
Int_t gDebug
Definition: TROOT.cxx:590
TString::BeginsWith
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:615
TAlien::Query
virtual TGridResult * Query(const char *path, const char *pattern, const char *conditions="", const char *options="")
Definition: TAlien.cxx:399
TAlienJDL.h
TAlien::OpenCollectionQuery
virtual TGridCollection * OpenCollectionQuery(TGridResult *queryresult, Bool_t nogrouping=kFALSE)
Factory function fo a TAlienCollection based on a gGrid Query.
Definition: TAlien.cxx:676
TAlienJobStatusList
Definition: TAlienJobStatusList.h:27
TUrl
This class represents a WWW compatible URL.
Definition: TUrl.h:33
TIterator::Next
virtual TObject * Next()=0
unsigned int
TAlien::ListPackages
virtual TGridResult * ListPackages(const char *alienpackagedir="/alice/packages")
List packages in the specified directory.
Definition: TAlien.cxx:744
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TGridResult::GetFileName
virtual const char * GetFileName(UInt_t) const
Definition: TGridResult.h:37
TSystem::Getenv
virtual const char * Getenv(const char *env)
Get environment variable.
Definition: TSystem.cxx:1662
TGrid::GetUser
const char * GetUser() const
Definition: TGrid.h:62
TAlien::GetJDLGenerator
virtual TGridJDL * GetJDLGenerator()
Create a Alien JDL.
Definition: TAlien.cxx:281
TSystem::Unsetenv
virtual void Unsetenv(const char *name)
Unset environment variable.
Definition: TSystem.cxx:1654
Info
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Definition: TError.cxx:220
TAlienCollection::OpenAlienCollection
static TAlienCollection * OpenAlienCollection(TGridResult *queryresult, Option_t *option="")
Static method used to create an Alien event collection, by creating collection from a TGridResult Get...
Definition: TAlienCollection.cxx:158
TAlienResult::DumpResult
virtual void DumpResult()
Dump result set.
Definition: TAlienResult.cxx:50
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TUrl::GetHost
const char * GetHost() const
Definition: TUrl.h:67
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TAlienCollection.h
TMap.h
TAlien::Submit
virtual TGridJob * Submit(const char *jdl)
Submit a command to AliEn. Returns 0 in case of error.
Definition: TAlien.cxx:230
TAlienJob.h
TAlien::Cd
virtual Bool_t Cd(const char *ldn="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:460
TAlienJobStatusList.h
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
TGridJDL
Definition: TGridJDL.h:32
TAlien::Rm
virtual Bool_t Rm(const char *lfn, Option_t *option="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:618
TAlienJob
Definition: TAlienJob.h:28
TAlien::KillById
virtual Bool_t KillById(TString jobid)
Kill a specific job.
Definition: TAlien.cxx:323
TAlien::ResubmitById
virtual Bool_t ResubmitById(TString jobid)
Resubmit a specific job.
Definition: TAlien.cxx:334
type
int type
Definition: TGX11.cxx:121
TAlien::Ls
virtual TGridResult * Ls(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:451
TAlienCollection::Open
static TGridCollection * Open(const char *collectionurl, UInt_t maxentries=1000000)
Static method used to create an Alien event collection, by reading an XML collection from the specifi...
Definition: TAlienCollection.cxx:112
Riostream.h
TAlien::GetNColumns
UInt_t GetNColumns(UInt_t stream)
Definition: TAlien.cxx:442
TAlien::TAlien
TAlien(const char *gridurl, const char *uid=0, const char *passwd=0, const char *options=0)
Definition: TAlien.cxx:89
TAlien::Register
virtual Bool_t Register(const char *lfn, const char *turl, Long_t size=-1, const char *se=0, const char *guid=0, Bool_t verbose=kFALSE)
Definition: TAlien.cxx:583
TAlienResult
Definition: TAlienResult.h:29
kCollection
@ kCollection
Definition: TStructNode.h:21
TAlien::Mkdir
virtual Int_t Mkdir(const char *ldn="", Option_t *options="", Bool_t verbose=kFALSE)
Definition: TAlien.cxx:520
TUrl.h
TAlien::Stderr
void Stderr()
Definition: TAlien.cxx:390
TList
A doubly linked list.
Definition: TList.h:44
TAlienJobStatus.h
ROOT::TMetaUtils::propNames::pattern
static const std::string pattern("pattern")
int
TAlienJobStatus
Definition: TAlienJobStatus.h:30
Error
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition: TError.cxx:187
TMap
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:40