350void SavePerfTree(
TProof *proof,
const char *
fn);
357 const char *
masterurl =
"proof://localhost:40000",
366 if (!
u.IsNull() &&
u !=
"lite://") {
369 if ((!
strcmp(
uu.GetHost(),
"localhost") && !
uopts.Contains(
"external")) ||
374 if (!
u.BeginsWith(
uu.GetProtocol()))
uu.SetProtocol(
"proof");
375 uopts.ReplaceAll(
"external",
"");
379 const char *
url =
u.Data();
388 Printf(
"runProof: could not get user info");
391 us.
Form(
"/%s",
ug->fUser.Data());
395 Printf(
"runProof: unable to get a writable tutorial directory (tried: %s)"
396 " - cannot continue",
tmpdir.Data());
401 Printf(
"runProof: creating the temporary directory"
402 " for the tutorial (%s) ... ",
tutdir.Data());
404 Printf(
"runProof: could not assert / create the temporary directory"
405 " for the tutorial (%s)",
tutdir.Data());
416 Printf(
"runProof: pythia8: environment variable PYTHIA8 undefined:"
417 " it must contain the path to pythia81xx root directory (local and remote) !");
425 Printf(
"runProof: pythia8: environment variable PYTHIA8DATA undefined:"
426 " it one must contain the path to pythia81xx/xmldoc"
427 " subdirectory (local and remote) !");
431 TString env =
Form(
"echo export PYTHIA8=%s; export PYTHIA8DATA=%s",
441 Printf(
"runProof: could not start/attach a PROOF session");
451 Printf(
"runProof: the 'ntuple' example needs to run xrootd to receive the output file, \n"
452 " but xrootd is not supported on Windows - cannot continue");
461 Printf(
"runProof: could not create files for sessions tags");
467 Printf(
"runProof: could not start/attach a PROOF session");
479 Printf(
"runProof: root.exe not found: please check the environment!");
489 args.ReplaceAll(
"(",
" ");
490 args.ReplaceAll(
")",
" ");
491 args.ReplaceAll(
",",
" ");
494 if (!args.Tokenize(
act, from,
" ")) {
496 Printf(
"runProof: action not found: check your arguments (%s)",
what);
501 if (
act.EndsWith(
"+")) {
505 Printf(
"runProof: %s: ACLiC mode: '%s'",
act.Data(),
aMode.Data());
509 aH1Src(
"http://root.cern/files/h1"),
515 while (args.Tokenize(
tok, from,
" ")) {
517 if (
tok.BeginsWith(
"debug=")) {
519 aDebug.ReplaceAll(
"debug=",
"");
526 Printf(
"runProof: %s: error parsing the 'debug=' option (%s) - ignoring",
act.Data(),
tok.Data());
532 if (
tok.BeginsWith(
"nevt=")) {
534 aNevt.ReplaceAll(
"nevt=",
"");
535 if (!
aNevt.IsDigit()) {
536 Printf(
"runProof: %s: error parsing the 'nevt=' option (%s) - ignoring",
act.Data(),
tok.Data());
541 if (
tok.BeginsWith(
"first=")) {
543 aFirst.ReplaceAll(
"first=",
"");
545 Printf(
"runProof: %s: error parsing the 'first=' option (%s) - ignoring",
act.Data(),
tok.Data());
550 if (
tok.BeginsWith(
"asyn"))
553 if (
tok.BeginsWith(
"nwrk=")) {
555 aNwrk.ReplaceAll(
"nwrk=",
"");
556 if (!
aNwrk.IsDigit()) {
557 Printf(
"runProof: %s: error parsing the 'nwrk=' option (%s) - ignoring",
act.Data(),
tok.Data());
562 if (
tok.BeginsWith(
"punzip"))
565 if (
tok.BeginsWith(
"cache=")) {
567 aCache.ReplaceAll(
"cache=",
"");
572 Printf(
"runProof: %s: error parsing the 'cache=' option (%s) - ignoring",
act.Data(),
tok.Data());
577 if (
tok.BeginsWith(
"submergers")) {
578 tok.ReplaceAll(
"submergers",
"");
580 if (
tok.BeginsWith(
"=")) {
581 tok.ReplaceAll(
"=",
"");
586 if (
tok.BeginsWith(
"useList")) {
589 if (
tok.BeginsWith(
"fillList")) {
593 if (
tok.BeginsWith(
"h1src=")) {
594 tok.ReplaceAll(
"h1src=",
"");
596 Printf(
"runProof: %s: reading data files from '%s'",
act.Data(),
aH1Src.Data());
599 if (
tok.BeginsWith(
"rateest=")) {
600 tok.ReplaceAll(
"rateest=",
"");
602 Printf(
"runProof: %s: progress-bar rate estimation option: '%s'",
act.Data(),
aRateEst.Data());
605 if (
tok.BeginsWith(
"perftree")) {
607 if (
tok.BeginsWith(
"perftree=")) {
608 tok.ReplaceAll(
"perftree=",
"");
611 Printf(
"runProof: %s: saving performance tree to '%s'",
act.Data(),
aPerfTree.Data());
614 if (
tok.BeginsWith(
"outfile")) {
615 if (
tok.BeginsWith(
"outfile=")) {
616 tok.ReplaceAll(
"outfile=",
"");
622 if (
tok.BeginsWith(
"feedback=")) {
623 tok.ReplaceAll(
"feedback=",
"");
624 if (
tok ==
"off" ||
tok ==
"OFF" ||
tok ==
"0") {
626 }
else if (!(
tok.IsNull())) {
627 if (
tok.BeginsWith(
"+")) {
645 Printf(
"runProof: %s: request for a number of workers larger then available - ignored",
act.Data());
668 Printf(
"runProof: %s: parallel unzip enabled",
act.Data());
678 Printf(
"runProof: %s: disabling tree cache",
act.Data());
694 Printf(
"runProof: %s: enabling merging via %d sub-mergers",
act.Data(),
aSubMg);
696 Printf(
"runProof: %s: enabling merging via sub-mergers (optimal number)",
act.Data());
710 if (
ins &&
ins->GetSize() > 0) {
720 if (
act ==
"simple") {
726 Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial"
727 " - ignored",
act.Data());
730 nevt = (nevt < 0) ? 100000 : nevt;
733 while (args.Tokenize(
tok, from,
" ")) {
735 if (
tok.BeginsWith(
"nhist=")) {
737 aNhist.ReplaceAll(
"nhist=",
"");
739 Printf(
"runProof: error parsing the 'nhist=' option (%s) - ignoring",
tok.Data());
742 }
else if (
tok.BeginsWith(
"nhist3=")) {
744 aNhist3.ReplaceAll(
"nhist3=",
"");
746 Printf(
"runProof: error parsing the 'nhist3=' option (%s) - ignoring",
tok.Data());
753 Printf(
"\nrunProof: running \"simple\" with nhist= %d, nhist3=%d and nevt= %lld\n",
nhist,
nhist3, nevt);
766 }
else if (
act ==
"h1") {
783 Printf(
"\nrunProof: asked to use an entry list but '%s' not found or not readable",
elfn.Data());
784 Printf(
"\nrunProof: did you forget to run with 'fillList=%s'?\n",
elfn.Data());
787 if (!(
f.IsZombie())) {
791 chain->SetEntryList(elist);
793 Printf(
"\nrunProof: could not find entry-list '%s' in file '%s': ignoring",
797 Printf(
"\nrunProof: requested entry-list file '%s' not existing (or not readable):"
798 " ignoring",
elfn.Data());
805 Printf(
"\nrunProof: running \"h1\"\n");
813 while ((o =
nxi())) {
820 }
else if (
act ==
"pythia8") {
823 Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial"
824 " - ignored",
act.Data());
829 Printf(
"runProof: pythia8: PYTHIA8DATA directory (%s) must"
835 Printf(
"runProof: pythia8: par file not found (tried %s)",
pythia8par.Data());
842 Printf(
"runProof: pythia8: check settings:");
843 proof->
Exec(
".!echo hostname = `hostname`; echo \"ls pythia8:\"; ls pythia8");
846 Printf(
"runProof: pythia8: libEG not found \n");
850 Printf(
"runProof: pythia8: libEGPythia8 not found \n");
854 nevt = (nevt < 0) ? 100 : nevt;
855 Printf(
"\nrunProof: running \"Pythia01\" nevt= %lld\n", nevt);
862 }
else if (
act ==
"event") {
866 Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial"
867 " - ignored",
act.Data());
871 Printf(
"runProof: event: par file not found (tried %s)",
eventpar.Data());
877 Printf(
"Enabled packages...\n");
881 nevt = (nevt < 0) ? 100 : nevt;
882 Printf(
"\nrunProof: running \"event\" nevt= %lld\n", nevt);
889 }
else if (
act ==
"eventproc") {
894 Printf(
"runProof: eventproc: par file not found (tried %s)",
eventpar.Data());
900 Printf(
"Enabled packages...\n");
907 Printf(
"runProof: eventproc: ProcFileElements.C not found (tried %s)",
pfelem.Data());
919 proof->
SetParameter(
"ProofEventProc_Read",
"optimized");
920 while (args.Tokenize(
tok, from,
" ")) {
922 if (
tok.BeginsWith(
"files=")) {
924 aFiles.ReplaceAll(
"files=",
"");
926 Printf(
"runProof: error parsing the 'files=' option (%s) - ignoring",
tok.Data());
929 }
else if (
tok.BeginsWith(
"datasrc=")) {
930 tok.ReplaceAll(
"datasrc=",
"");
932 Printf(
"runProof: error parsing the 'datasrc=' option (%s) - ignoring",
tok.Data());
937 }
else if (
tok ==
"readall") {
939 Printf(
"runProof: eventproc: reading the full event");
940 }
else if (
tok ==
"uneven") {
942 }
else if (
tok.BeginsWith(
"partitions=")) {
943 tok.ReplaceAll(
"partitions=",
"");
945 Printf(
"runProof: error parsing the 'partitions=' option (%s) - ignoring",
tok.Data());
948 Printf(
"runProof: partitions: %s included in packetizer operations",
aPartitions.Data());
955 Printf(
"runProof: max number of files is 50 - resizing request");
967 c->AddFileInfoList(
fc->GetList());
980 for (i = 1; i <=
nFiles; i++) {
984 fn.Form(
"%s/event_%d.root", os->GetName(), i);
987 c->AddFile(
fn.Data(), 50000);
989 c->AddFile(
fn.Data(), 5000);
991 c->AddFile(
fn.Data());
1014 Printf(
"\nrunProof: running \"eventproc\"\n");
1016 c->Process(
sel.Data(),
xopt, nevt, first);
1018 }
else if (
act ==
"ntuple") {
1025 Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial"
1026 " - ignored",
act.Data());
1029 nevt = (nevt < 0) ? 1000 : nevt;
1030 Printf(
"\nrunProof: running \"ntuple\" with nevt= %lld\n", nevt);
1034 while (args.Tokenize(
tok, from,
" ")) {
1035 if (
tok ==
"inputrndm") {
1044 if (
fout.IsNull()) {
1053 while (port < 9010) {
1063 Printf(
"runProof: could not start basic xrootd on ports 9000-9009 - cannot continue");
1068 proof->
AddInput(
new TNamed(
"PROOF_OUTPUTFILE_LOCATION",
"LOCAL"));
1082 Printf(
"runProof: taking randoms from '%s'",
fnr.Data());
1090 Printf(
"runProof: selector file '%s', options: '%s'",
sel.Data(),
xopt.Data());
1099 }
else if (
act ==
"dataset") {
1108 Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial"
1109 " - ignored",
act.Data());
1112 nevt = (nevt < 0) ? 1000000 : nevt;
1113 Printf(
"\nrunProof: running \"dataset\" with nevt= %lld\n", nevt);
1133 plotNtuple(proof,
"testNtuple",
"proof ntuple from dataset");
1136 Printf(
"runProof: dataset 'testNtuple' not found in the output list");
1142 }
else if (
act ==
"friends") {
1150 Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial"
1151 " - ignored",
act.Data());
1155 while (args.Tokenize(
tok, from,
" ")) {
1157 if (
tok ==
"samefile") {
1166 Printf(
"runProof: could not get the list of information about the workers");
1172 files->SetName(
"PROOF_FilesToProcess");
1176 fntree.Form(
"tree_%s.root",
wi->GetOrdinal());
1189 Printf(
"runProof: friend tree stored in the same file as the main tree");
1190 proof->
SetParameter(
"ProofAux_Action",
"GenerateTreesSameFile");
1192 proof->
SetParameter(
"ProofAux_Action",
"GenerateTrees");
1195 nevt = (nevt < 0) ? 10000 : nevt;
1198 proof->
SetParameter(
"PROOF_Packetizer",
"TPacketizerFile");
1212 while ((o =
nxo())) {
1217 dset->Add(os->GetName());
1221 while ((o =
nxo())) {
1226 dsetf->Add(os->GetName());
1238 }
else if (
act ==
"simplefile") {
1246 Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial"
1247 " - ignored",
act.Data());
1250 nevt = (nevt < 0) ? 1000000 : nevt;
1253 while (args.Tokenize(
tok, from,
" ")) {
1255 if (
tok.BeginsWith(
"nhist=")) {
1257 aNhist.ReplaceAll(
"nhist=",
"");
1259 Printf(
"runProof: error parsing the 'nhist=' option (%s) - ignoring",
tok.Data());
1265 Printf(
"\nrunProof: running \"simplefile\" with nhist= %d and nevt= %lld\n",
nhist, nevt);
1272 if (
fout.IsNull()) {
1281 while (port < 9010) {
1291 Printf(
"runProof: could not start basic xrootd on ports 9000-9009 - cannot continue");
1296 proof->
AddInput(
new TNamed(
"PROOF_OUTPUTFILE_LOCATION",
"LOCAL"));
1308 }
else if (
act ==
"stdvec") {
1315 Printf(
"runProof: %s: warning concept of 'first' meaningless for this tutorial"
1316 " - ignored",
act.Data());
1319 nevt = (nevt < 0) ? 50000 * proof->
GetParallel() : nevt;
1320 Printf(
"\nrunProof: running \"stdvec\" with nevt= %lld\n", nevt);
1338 Printf(
"runProof: dataset 'TestStdVect' not available!");
1343 Printf(
"runProof: unknown tutorial: %s",
what);
1374 pad1->GetFrame()->SetFillColor(15);
1376 p->SetParameter(
"PROOF_LineColor", (
Int_t)1);
1377 p->SetParameter(
"PROOF_FillStyle", (
Int_t)1001);
1378 p->SetParameter(
"PROOF_FillColor", (
Int_t)45);
1379 p->DrawSelect(
ds,
"3*px+2",
"px**2+py**2>1");
1380 p->SetParameter(
"PROOF_FillColor", (
Int_t)38);
1381 p->DrawSelect(
ds,
"2*px+2",
"pz>2",
"same");
1382 p->SetParameter(
"PROOF_FillColor", (
Int_t)5);
1383 p->DrawSelect(
ds,
"1.3*px+2",
"(px^2+py^2>4) && py>0",
"same");
1389 p->DrawSelect(
ds,
"pz:py:px",
"(pz<10 && pz>6)+(pz<4 && pz>3)");
1390 p->SetParameter(
"PROOF_MarkerColor", (
Int_t)4);
1391 p->DrawSelect(
ds,
"pz:py:px",
"pz<6 && pz>4",
"same");
1392 p->SetParameter(
"PROOF_MarkerColor", (
Int_t)5);
1393 p->DrawSelect(
ds,
"pz:py:px",
"pz<4 && pz>3",
"same");
1395 l2->SetFillColor(42);
1396 l2->SetTextAlign(12);
1397 l2->AddText(
"You can interactively rotate this view in 2 ways:");
1398 l2->AddText(
" - With the RotateCube in clicking in this pad");
1399 l2->AddText(
" - Selecting View with x3d in the View menu");
1407 p->DeleteParameters(
"PROOF_*Color");
1408 p->DeleteParameters(
"PROOF_*Style");
1412void SavePerfTree(
TProof *proof,
const char *
fn)
1417 Printf(
"PROOF must be run to save output performance information");;
1421 Printf(
"PROOF outputlist undefined or empty");;
1427 Printf(
"ERROR: could not open file '%s' for writing",
fn);;
1432 while ((obj =
nxo())) {
1434 if (
objname.BeginsWith(
"PROOF_")) {
1437 if (
objname ==
"PROOF_PerfStats" ||
1438 objname ==
"PROOF_PacketsHist" ||
1439 objname ==
"PROOF_EventsHist" ||
1440 objname ==
"PROOF_NodeHist" ||
1441 objname ==
"PROOF_LatencyHist" ||
1442 objname ==
"PROOF_ProcTimeHist" ||
1443 objname ==
"PROOF_CpuTimeHist")
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
R__EXTERN TProof * gProof
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
Bool_t R_ISREG(Int_t mode)
R__EXTERN TSystem * gSystem
A chain is a collection of files containing TTree objects.
void Print(Option_t *option="") const override
Default print for collections, calls Print(option, 1).
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
This class implements a data set to be used for PROOF processing.
A List of entry numbers in a TTree or TChain.
virtual void SetDirectory(TDirectory *dir)
Add reference to directory dir. dir can be 0.
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
Class that contains a list of TFileInfo's and accumulated meta data information about its entries.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
TObject * Remove(TObject *obj) override
Remove object from the list.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
The TNamed class is the base class for all named ROOT classes.
Collectable string class.
Mother of all ROOT objects.
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
The most important graphics class in the ROOT system.
A Pave (see TPave) with text, lines or/and boxes inside.
This class controls a Parallel ROOT Facility, PROOF, cluster.
const char * GetSessionTag() const
Int_t Exec(const char *cmd, ESlaves list, Bool_t plusMaster)
Send command to be executed on the PROOF master and/or slaves.
Int_t UploadPackage(const char *par, EUploadPackageOpt opt=kUntar, TList *workers=0)
Upload a PROOF archive (PAR file).
void ClearData(UInt_t what=kUnregistered, const char *dsname=0)
Remove files for the data directory.
Int_t SetParallel(Int_t nodes=-1, Bool_t random=kFALSE)
Tell PROOF how many slaves to use in parallel.
static void AddEnvVar(const char *name, const char *value)
Add an variable to the list of environment variables passed to proofserv on the master and slaves.
void DeleteParameters(const char *wildcard)
Delete the input list parameters specified by a wildcard (e.g.
void SetInputDataFile(const char *datafile)
Set the file to be used to optimally distribute the input data objects.
void SetParameter(const char *par, const char *value)
Set input list parameter.
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
virtual Int_t Load(const char *macro, Bool_t notOnClient=kFALSE, Bool_t uniqueOnly=kTRUE, TList *wrks=0)
Load the specified macro on master, workers and, if notOnClient is kFALSE, on the client.
TList * GetOutputList()
Get list with all object created during processing (see Process()).
void ClearInputData(TObject *obj=0)
Remove obj form the input data list; if obj is null (default), clear the input data info.
TList * GetListOfSlaveInfos()
Returns list of TSlaveInfo's. In case of error return 0.
void SetLogLevel(Int_t level, UInt_t mask=TProofDebug::kAll)
Set server logging level.
virtual Long64_t Process(TDSet *dset, const char *selector, Option_t *option="", Long64_t nentries=-1, Long64_t firstentry=0)
Process a data set (TDSet) using the specified selector (.C) file or Tselector object Entry- or event...
virtual Bool_t ExistsDataSet(const char *dataset)
Returns kTRUE if 'dataset' exists, kFALSE otherwise.
void AddInput(TObject *obj)
Add objects that might be needed during the processing of the selector (see Process()).
TList * GetInputList()
Get input list.
void ShowEnabledPackages(Bool_t all=kFALSE)
List which packages are enabled.
Int_t EnablePackage(const char *package, Bool_t notOnClient=kFALSE, TList *workers=0)
Enable specified package.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual const char * HostName()
Return the system's host name.
virtual Int_t GetUid(const char *user=nullptr)
Returns the user's id. If user = 0, returns current user's id.
virtual const char * WorkingDirectory()
Return working directory.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual void Setenv(const char *name, const char *value)
Set environment variable.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
This class represents a WWW compatible URL.
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
Attaches to a PROOF session, possibly at the indicated URL.