Macro to finalize queries run with the macro tutorials/runProof .
This macro uses an existing PROOF session or starts one at the indicated URL. In the case non existing PROOF session is found and no URL is given, the macro tries to start a local PROOF session.
The macro looks for the last completed queries for the chosen analysis and asks which one to finalize. If there is only available, it finalizes it without asking. All queries are considered for this, both those run synchronously and those run asynchronously, e.g. runProof("h1(asyn)").
#include "Getline.h"
void finalizeProof(
const char *
what =
"simple",
const char *url = "proof://localhost:11093",
{
Printf(
"runProof: creating the temporary directory"
" for the tutorial (%s) ... ", tutdir.
Data());
Printf(
"runProof: could not assert / create the temporary directory"
" for the tutorial (%s)", tutdir.
Data());
return;
}
}
TProof *proof = getProof(url, nwrks, tutdir.
Data(),
"");
if (!proof) {
Printf(
"runProof: could not start/attach a PROOF session");
return;
}
FILE *
fs = fopen(proofsessions.Data(),
"r");
Printf(
"runProof: could not create files for sessions tags");
} else {
if (strncmp(
line,
"session-",strlen(
"session-")))
continue;
}
}
Printf(
"runProof: no queries to be finalized");
return;
}
if (!rootbin) {
Printf(
"runProof: root.exe not found: please check the environment!");
return;
}
delete[] rootbin;
args.ReplaceAll("("," ");
args.ReplaceAll(")"," ");
args.ReplaceAll(","," ");
if (!args.Tokenize(act, from, " ")) {
Printf(
"runProof: action not found: check your arguments (%s)",
what);
return;
}
if (act == "simple") {
} else if (act == "h1") {
} else if (act == "pythia8") {
} else {
}
while (ref.
IsNull() && nt--) {
Printf(
"runProof: checking session: %s", lasttag.
Data());
}
}
Printf(
"finalizeProof: queries completed for analysis '%s'", act.
Data());
}
while (ask) {
char *answer = Getline("finalizeProof: enter the one you would like to finalize? [0] ");
if (answer) {
if (answer[0] == 'Q' || answer[0] == 'q') {
return;
}
sn.Remove(sn.Length()-1);
if (sn.IsDigit()) {
qn = sn.Atoi();
if (qn >= 0 && qn < qa->GetEntriesFast()) {
break;
} else {
Printf(
"finalizeProof: choice must be in [0,%d] ('Q' to quit)",
}
} else {
if (sn.IsNull()) {
qn = 0;
break;
} else {
Printf(
"finalizeProof: choice must be a number in [0,%d] ('Q' to quit) (%s)",
}
}
}
}
}
}
}
} else {
Printf(
"runProof: no queries to be finalized for analysis '%s'", act.
Data());
return;
}
}
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 void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
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.
R__EXTERN TSystem * gSystem
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.
Utility class to draw objects in the feedback list during queries.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
Collectable string class.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Int_t Retrieve(Int_t query, const char *path=0)
Send retrieve request for the qry-th query in fQueries.
Long64_t Finalize(Int_t query=-1, Bool_t force=kFALSE)
Finalize the qry-th query in fQueries.
virtual TList * GetListOfQueries(Option_t *opt="")
Ask the master for the list of queries.
A container class for query results.
TMacro * GetSelecImp() const
virtual Bool_t IsDone() const
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
const char * Data() const
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 Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
Attaches to a PROOF session, possibly at the indicated URL.