27 # include "snprintf.h"
29 #include "RConfigure.h"
84 fReInvalid =
new TPMERegexp(
"[^A-Za-z0-9._-]");
105 fUrl.SetProtocol(
"proof");
106 fUrl.SetHost(
"__lite__");
110 if (strlen(fUrl.GetUser()) <= 0) {
114 fUrl.SetUser(pw->
fUser);
121 ParseConfigField(conffile);
126 if ((fNWorkers = GetNumberOfWorkers(url)) > 0) {
133 Printf(
" +++ Starting PROOF-Lite %swith %d workers +++", stup.
Data(), fNWorkers);
135 Init(url, conffile, confdir, loglevel, alias);
139 if (!
gROOT->GetListOfProofs()->FindObject(
this))
140 gROOT->GetListOfProofs()->Add(
this);
155 const char *confdir,
Int_t loglevel,
const char *)
166 if (!conffile || !conffile[0])
168 if (!confdir || !confdir[0])
177 Error(
"Init",
"could not create/assert sandbox for this session");
184 if (sockpathdir(sockpathdir.
Length()-1) ==
'/') sockpathdir.
Remove(sockpathdir.
Length()-1);
188 Error(
"Init",
"Unix socket path '%s' is too long (%d bytes):",
190 Error(
"Init",
"use 'ProofLite.SockPathDir' to create it under a directory different"
191 " from '%s'", sockpathdir.
Data());
222 if (dynconf.
Length() > 0) {
265 Warning(
"Init",
"problems applying fMaxQueries");
268 Warning(
"Init",
"problems initializing the dataset manager");
323 Warning(
"Init",
"fork-based workers startup is not available on Windows - ignoring");
335 if (globpack.
Length() > 0) {
339 while (globpack.
Tokenize(ldir, from,
":")) {
342 Warning(
"Init",
"directory for global packages %s does not"
343 " exist or is not readable", ldir.
Data());
362 fEnabledPackagesOnClient->SetOwner();
367 Error(
"Init",
"problems setting up workers");
393 gROOT->GetListOfSockets()->Add(
this);
436 if (fgWrksMax == -2) {
438 TString sysname =
"system.rootrc";
452 fgWrksMax = sysenv.
GetValue(
"ProofLite.MaxWorkers", -1);
457 if (fgWrksMax == 0) {
458 ::Error(
"TProofLite::GetNumberOfWorkers",
459 "PROOF-Lite disabled by the system administrator: sorry!");
466 if (url && strlen(url)) {
470 nw.
Remove(0, in + strlen(
"workers="));
474 if ((nWorkers = nw.
Atoi()) <= 0) {
475 ::Warning(
"TProofLite::GetNumberOfWorkers",
476 "number of workers specified by 'workers='"
477 " is non-positive: using default");
490 if ((nWorkers = nw.
Atoi()) == 0) {
491 ::Warning(
"TProofLite::GetNumberOfWorkers",
492 "number of workers specified by 'workers='"
493 " is non-positive: using default");
508 if (notify) notify =
kFALSE;
512 if (fgWrksMax > 0 && fgWrksMax < nWorkers) {
514 ::Warning(
"TProofLite::GetNumberOfWorkers",
"number of PROOF-Lite workers limited by"
515 " the system administrator to %d", fgWrksMax);
537 Error(
"SetupWorkers",
538 "unable to create server socket for internal communications");
549 Int_t nWrksDone = 0, nWrksTot = -1;
557 for (; ord < nWrksTot; ord++) {
561 fullord.
Form(
"%s.%d", o, ord);
571 NotifyStartUp(
"Opening connections to workers", ++nWrksDone, nWrksTot);
576 Warning(
"SetupWorkers",
"standard startup: workers already started");
584 for (; ord < nWrksTot; ord++) {
588 fullord.
Form(
"%s.%d", o, ord + 1);
589 if (!clones.
IsNull()) clones +=
" ";
597 NotifyStartUp(
"Opening connections to workers", ++nWrksDone, nWrksTot);
612 while (started.
GetSize() > 0 && nSelects < nWrksTot) {
619 if (xs == (
TSocket *) -1)
continue;
626 if (s->
Recv(msg) < 0) {
627 Warning(
"SetupWorkers",
"problems receiving message from accepted socket!");
644 gROOT->GetListOfSockets()->Remove(s);
662 if (startedWorkers) startedWorkers->
Add(wrk);
664 NotifyStartUp(
"Setting up worker servers", ++nWrksDone, nWrksTot);
671 Warning(
"SetupWorkers",
"received empty message from accepted socket!");
684 gROOT->GetPluginManager()->FindHandler(
"TProofProgressDialog")))
709 snprintf(msg, 512,
"%s: OK (%d workers) \n",
712 snprintf(msg, 512,
"%s: %d out of %d (%d %%)\r",
713 action, done, tot, frac);
715 fprintf(stderr,
"%s", msg);
724 if (!ord || strlen(ord) <= 0) {
725 Error(
"SetProofServEnv",
"ordinal string undefined");
731 FILE *frc = fopen(rcfile.
Data(),
"w");
733 Error(
"SetProofServEnv",
"cannot open rc file %s", rcfile.
Data());
738 fprintf(frc,
"# The session working dir\n");
739 fprintf(frc,
"ProofServ.SessionDir: %s/worker-%s\n",
fWorkDir.
Data(),
ord);
742 fprintf(frc,
"# Session tag\n");
743 fprintf(frc,
"ProofServ.SessionTag: %s\n",
GetName());
746 fprintf(frc,
"# Proof Log/Debug level\n");
747 fprintf(frc,
"Proof.DebugLevel: %d\n",
gDebug);
750 fprintf(frc,
"# Ordinal number\n");
751 fprintf(frc,
"ProofServ.Ordinal: %s\n", ord);
754 fprintf(frc,
"# ROOT Version tag\n");
755 fprintf(frc,
"ProofServ.RootVersionTag: %s\n",
gROOT->GetVersion());
760 Warning(
"SetProofServEnv",
"problems getting sandbox string for worker");
761 fprintf(frc,
"# Users sandbox\n");
762 fprintf(frc,
"ProofServ.Sandbox: %s\n", sandbox.Data());
765 fprintf(frc,
"# Users cache\n");
769 fprintf(frc,
"# Users packages\n");
773 fprintf(frc,
"# Server image\n");
774 fprintf(frc,
"ProofServ.Image: %s\n",
fImage.
Data());
777 fprintf(frc,
"# Open socket\n");
781 fprintf(frc,
"# Client Protocol\n");
789 FILE *fenv = fopen(envfile.
Data(),
"w");
791 Error(
"SetProofServEnv",
"cannot open env file %s", envfile.
Data());
795 #ifdef R__HAVE_CONFIG
796 fprintf(fenv,
"export ROOTSYS=%s\n", ROOTPREFIX);
798 fprintf(fenv,
"export ROOTSYS=%s\n",
gSystem->
Getenv(
"ROOTSYS"));
801 #ifdef R__HAVE_CONFIG
802 fprintf(fenv,
"export ROOTCONFDIR=%s\n", ROOTETCDIR);
804 fprintf(fenv,
"export ROOTCONFDIR=%s\n",
gSystem->
Getenv(
"ROOTSYS"));
810 fprintf(fenv,
"export ROOTPROOFLOGFILE=%s\n", logfile.Data());
812 fprintf(fenv,
"export ROOTRCFILE=%s\n", rcfile.
Data());
814 fprintf(fenv,
"export ROOTVERSIONTAG=%s\n",
gROOT->GetVersion());
816 fprintf(fenv,
"export ROOTPROOFLITE=%d\n",
fNWorkers);
818 fprintf(fenv,
"export LOCALDATASERVER=\"file://\"\n");
824 while ((env = (
TNamed *)nxenv())) {
827 fprintf(fenv,
"export %s=%s\n", env->
GetName(), senv.Data());
828 if (namelist.
Length() > 0)
832 fprintf(fenv,
"export PROOF_ALLVARS=%s\n", namelist.
Data());
849 if (!logfile)
return;
852 if (s.
Contains(
"<logfilewrk>") && logfile) {
882 var =
dynamic_cast<TNamed *
>(envVars->
FindObject(
"PROOF_SLAVE_CPUPIN_ORDER"));
883 if (var) cpuPinList = var->
GetTitle();
895 if (cpuPinList.
IsNull() || (cpuPinList ==
"*")) {
905 for (
Int_t i=0; cpuPinList.
Tokenize(tok, from,
"\\+"); i++) {
907 n = (tok.
Atoi() % nCpus);
973 lastsess.
Form(
"%s/last-lite-session", sessdir.
Data());
1000 Printf(
"*** PROOF-Lite cluster %s(sequential mode)", ord.
Data());
1007 Printf(
"URL: %s", url.Data());
1016 Printf(
"ROOT version|rev|tag: %s", ver.Data());
1032 Printf(
"List of workers:");
1034 while (
TSlave* sl = dynamic_cast<TSlave*>(nextslave())) {
1059 (dset ? dset->GetEntryList() : 0));
1077 Info(
"SetQueryRunning",
"starting query: %d", pq->
GetSeqNum());
1084 if (parlist.Length() <= 0)
1105 const char *selection,
Option_t *option,
1112 Info(
"DrawSelect",
"not idle, asynchronous Draw not supported");
1124 return Process(dset,
"draw:", opt, nentries, first);
1140 TString opt(option), optfb, outfile;
1142 if (opt.Contains(
"fb=") || opt.Contains(
"feedback="))
SetFeedback(opt, optfb, 0);
1149 Info(
"Process",
"asynchronous mode not yet supported in PROOF-Lite");
1155 Info(
"Process",
"not idle: cannot accept queries");
1166 Error(
"Process",
"invalid sesion or query-result manager undefined!");
1183 Error(
"Process",
"from AssertDataSet: %s", emsg.
Data());
1187 Error(
"Process",
"no files to process!");
1190 }
else if (hasNoData) {
1195 if (!dsn.Contains(
":") || dsn.BeginsWith(
"dataset:")) {
1199 emsg.
Form(
"dataset manager not initialized!");
1204 emsg.
Form(
"requested dataset '%s' does not exists", dsn.Data());
1211 fcmap->
SetName(
"PROOF_FilesToProcess");
1217 Error(
"HandleProcess",
"%s", emsg.
Data());
1224 TString selec(selector), varexp, selection, objname;
1226 if (selec.BeginsWith(
"draw:")) {
1231 Error(
"Process",
"draw query: error parsing arguments '%s', '%s', '%s'",
1232 varexp.
Data(), selection.
Data(), opt.Data());
1277 if (!
gROOT->IsBatch()) {
1326 TList *startedWorkers = 0;
1328 startedWorkers =
new TList;
1338 if (selector && strlen(selector)) {
1377 Emit(
"StopProcess(Bool_t)", abort);
1402 Warning(
"ProcessNext",
"problems registering produced datasets: %s", err.
Data());
1424 if (!(pq->
IsDraw()) && memqueries >= 0) {
1434 msg.
Form(
"Lite-0: all output objects have been merged ");
1435 fprintf(stderr,
"%s\n", msg.
Data());
1451 if (sst) rv = sst->
GetVal();
1477 while ((wrk = (
TSlave *) nxw())) {
1483 Warning(
"CreateSymLinks",
"problems creating sym link: %s", lnk.
Data());
1486 Info(
"CreateSymLinks",
"created sym link: %s", lnk.
Data());
1491 Warning(
"CreateSymLinks",
"files list is undefined");
1518 if (
gROOT->GetPluginManager()) {
1520 h =
gROOT->GetPluginManager()->FindHandler(
"TDataSetManager", dsm);
1525 user.Data(), dsm.
Data()));
1530 Warning(
"InitDataSetManager",
"dataset manager plug-in initialization failed");
1545 h =
gROOT->GetPluginManager()->FindHandler(
"TDataSetManager",
"file");
1551 group.
Data(), user.Data(),
1555 Warning(
"InitDataSetManager",
"default dataset manager plug-in initialization failed");
1561 Info(
"InitDataSetManager",
"datasetmgr Cq: %d, Ar: %d, Av: %d, Ti: %d, Sb: %d",
1571 if (!dsReqCfg.
IsNull()) {
1572 TPMERegexp reReqDir(
"(^| )(dir:)?([^ ]+)( |$)");
1574 if (reReqDir.
Match(dsReqCfg) == 5) {
1576 dsDirFmt.
Form(
"dir:%s perms:open", reReqDir[3].
Data());
1579 Warning(
"InitDataSetManager",
"failed init of dataset staging requests repository");
1583 Warning(
"InitDataSetManager",
"specify, with [dir:]<path>, a valid path for staging requests");
1586 Warning(
"InitDataSetManager",
"no repository for staging requests available");
1613 if (!file || strlen(file) <= 0) {
1633 if (!macro || !macro[0]) {
1634 Error(
"Load",
"need to specify a macro name");
1640 while (macs.Tokenize(mac, from,
",")) {
1655 if (!strncmp(e, macn.
Data(), macn.
Length())) {
1667 return TProof::Load(macro, notOnClient, uniqueOnly, wrks);
1698 Info(
"CopyMacroToCache",
"enter: names: %s, %s", macro, name.
Data());
1702 Error(
"CopyMacroToCache",
"file %s not found or not readable", name.
Data());
1722 const char *hext[] = {
".h",
".hh",
"" };
1725 while (strlen(hext[i]) > 0) {
1726 hname =
name(0, dot);
1730 if (!checkedext.
IsNull()) checkedext +=
",";
1731 checkedext += hext[i];
1735 if (hname.
IsNull() && headerRequired == 1) {
1736 Error(
"CopyMacroToCache",
"header file for %s not found or not readable "
1737 "(checked extensions: %s)", name.
Data(), checkedext.
Data());
1740 if (headerRequired < 0)
1754 if (md5 && md5cache && (*md5 == *md5cache))
1755 useCacheBinaries =
kTRUE;
1760 if (md5h && md5hcache && (*md5h != *md5hcache))
1761 useCacheBinaries =
kFALSE;
1772 dot = vername.
Last(
'.');
1775 vername +=
".binversion";
1779 if (useCacheBinaries) {
1781 FILE *
f = fopen(
Form(
"%s/%s", cacheDir.
Data(), vername.
Data()),
"r");
1787 if (!f || v !=
gROOT->GetVersion() || r !=
gROOT->GetGitCommit())
1788 useCacheBinaries =
kFALSE;
1793 dot = binname.
Last(
'.');
1800 if (useCacheBinaries) {
1807 if (!strncmp(e, binname.
Data(), binname.
Length())) {
1818 Info(
"CopyMacroToCache",
1819 "retrieving %s from cache", fncache.
Data());
1833 Error(
"CopyMacroToCache",
"could not create a selector from %s", macro);
1846 if (!strncmp(e, binname.
Data(), binname.
Length())) {
1857 Info(
"CopyMacroToCache",
"caching %s ...", e);
1871 FILE *
f = fopen(
Form(
"%s/%s", cacheDir.
Data(), vername.
Data()),
"w");
1873 fputs(
gROOT->GetVersion(),
f);
1874 fputs(
Form(
"\n%s",
gROOT->GetGitCommit()), f);
1880 if (!useCacheBinaries) {
1883 Info(
"CopyMacroToCache",
"caching %s ...", name.
Data());
1888 Info(
"CopyMacroToCache",
"caching %s ...", hname.
Data());
1901 if (opt & (kCp |
kCpBin))
1917 if (maxold < 0)
return 0;
1927 if (!strncmp(e,
"session-", 8) && !strstr(e,
GetName())) {
1942 while (olddirs->
GetSize() > maxold) {
1943 if (notify &&
gDebug > 0)
1944 Printf(
"Cleaning sandbox at: %s", sandbox.
Data());
1970 Int_t ntot = 0, npre = 0, ndraw= 0;
2003 Warning(
"GetListOfQueries",
"unable to clone TProofQueryResult '%s:%s'",
2004 pqr->GetName(), pqr->GetTitle());
2038 Info(
"RegisterDataSet",
"dataset manager not available");
2042 if (!uri || strlen(uri) <= 0) {
2043 Info(
"RegisterDataSet",
"specifying a dataset name is mandatory");
2051 parallelverify =
kTRUE;
2061 Error(
"RegisterDataSet",
"can not save an empty list.");
2068 Info(
"RegisterDataSet",
"dataset registration not allowed");
2073 Error(
"RegisterDataSet",
"dataset was not saved");
2076 if (!parallelverify)
return result;
2081 Error(
"RegisterDataSet",
"problems verifying dataset '%s'", uri);
2097 Info(
"ExistsDataSet",
"dataset manager not available");
2101 if (!dataset || strlen(dataset) <= 0) {
2102 Info(
"SetDataSetTreeName",
"specifying a dataset name is mandatory");
2106 if (!treename || strlen(treename) <= 0) {
2107 Info(
"SetDataSetTreeName",
"specifying a tree name is mandatory");
2126 Info(
"ExistsDataSet",
"dataset manager not available");
2130 if (!uri || strlen(uri) <= 0) {
2131 Error(
"ExistsDataSet",
"dataset name missing");
2145 Info(
"GetDataSets",
"dataset manager not available");
2150 if (srvex && strlen(srvex) > 0) {
2165 Info(
"GetDataSet",
"dataset manager not available");
2179 Info(
"GetDataSet",
"dataset manager not available");
2183 if (!uri || strlen(uri) <= 0) {
2184 Info(
"GetDataSet",
"specifying a dataset name is mandatory");
2199 Info(
"RemoveDataSet",
"dataset manager not available");
2209 Info(
"RemoveDataSet",
"dataset creation / removal not allowed");
2226 Error(
"RequestStagingDataSet",
"invalid dataset specified");
2231 Error(
"RequestStagingDataSet",
"no dataset staging request repository available");
2235 TString dsUser, dsGroup, dsName, dsTree;
2243 Warning(
"RequestStagingDataSet",
"staging of %s already requested", dataset);
2250 Error(
"RequestStagingDataSet",
"empty dataset or no dataset returned");
2258 while ((fi = dynamic_cast<TFileInfo *>(it.Next()))) {
2260 Int_t nToErase = fi->GetNUrls() - 1;
2261 for (
Int_t i=0; i<nToErase; i++)
2271 Error(
"RequestStagingDataSet",
"can't register staging request for %s", dataset);
2276 Info(
"RequestStagingDataSet",
"Staging request registered for %s", dataset);
2290 Error(
"CancelStagingDataSet",
"invalid dataset specified");
2295 Error(
"CancelStagingDataSet",
"no dataset staging request repository available");
2318 Error(
"GetStagingStatusDataSet",
"invalid dataset specified");
2323 Error(
"GetStagingStatusDataSet",
"no dataset staging request repository available");
2335 Info(
"GetStagingStatusDataSet",
"no pending staging request for %s", dataset);
2350 Info(
"VerifyDataSet",
"dataset manager not available");
2361 Info(
"VerifyDataSet",
"dataset verification not allowed");
2409 if (dataFile.
Length() > 0) {
2420 Warning(
"SendInputDataFile",
"problems copying '%s' to '%s'",
2435 Info(
"Remove",
"Enter: %s, %d", ref, all);
2445 if (queryref ==
"cleanupdir") {
2451 Info(
"Remove",
"%d directories removed", nd);
2474 Warning(
"Remove",
"query result manager undefined!");
2479 "query %s could not be removed (unable to lock session)", queryref.
Data());
2493 Error(
"GetTreeHeader",
"undefined TDSet");
2502 PDB(kGlobal, 1)
Info(
"GetTreeHeader",
"empty TDSet");
2509 t->SetMaxVirtualSize(0);
2511 entries = t->GetEntries();
2514 while ((e = dset->
Next()) != 0) {
2525 t->SetMaxEntryLoop(entries);
2554 Error(
"FindUniqueSlaves",
"first object in fActiveSlaves not a TSlave: embarrasing!");
2589 if (!dirname)
return;
2597 const char *ent = 0;
2599 fn.
Form(
"%s/%s", dirname, ent);
2633 Info(
"PollForNewWorkers",
"max reached: %d workers started",
fNWorkers);
2647 Int_t nWrksDone = 0, nWrksTot = -1;
2654 for (; ord < nWrksTot; ord++) {
2657 fullord =
Form(
"0.%d", ord);
2667 Info(
"PollForNewWorkers",
"additional worker '%s' started", fullord.
Data());
2670 NotifyStartUp(
"Opening connections to workers", ++nWrksDone, nWrksTot);
2684 while (started.
GetSize() > 0 && nSelects < nWrksTot) {
2691 if (xs == (
TSocket *) -1)
continue;
2698 if (s->
Recv(msg) < 0) {
2699 Warning(
"PollForNewWorkers",
"problems receiving message from accepted socket!");
2715 gROOT->GetListOfSockets()->Remove(s);
2733 if (addedWorkers) addedWorkers->
Add(wrk);
2735 NotifyStartUp(
"Setting up added worker servers", ++nWrksDone, nWrksTot);
2742 Warning(
"PollForNewWorkers",
"received empty message from accepted socket!");
2770 Info(
"PollForNewWorkers",
"Will send the PROCESS message to selected workers");
2778 TIter naw(addedWorkers);
2779 while ((wrk = (
TSlave *)naw())) {
2783 delete addedWorkers;
Int_t SetProofServEnv(const char *ord)
Create environment files for worker 'ord'.
const char * GetName() const
Returns name of object.
void SetQueryRunning(TProofQueryResult *pq)
Set query in running state.
Int_t GetNumberOfUniqueSlaves() const
Return number of unique slaves, i.e.
void IncrementDrawQueries()
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual Int_t GetDrawArgs(const char *var, const char *sel, Option_t *opt, TString &selector, TString &objname)=0
virtual const char * GetTitle() const
Returns title of object.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Int_t VerifyDataSet(const char *uri, const char *=0)
Verify if all files in the specified dataset are available.
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Bool_t RequestStagingDataSet(const char *dataset)
Allows users to request staging of a particular dataset.
Long64_t GetNFiles() const
virtual TList * GetInputList() const =0
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form: ~~~ {.cpp} [path/]macro.C[+|++[k|f|g|O|c|s|d|v|-]][(args)]...
TQueryResultManager * fQMgr
virtual int GetPid()
Get process id.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
void ActivateAsyncInput()
Activate the a-sync input handler.
void AskParallel()
Ask the for the number of parallel slaves.
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
void ShowDataSetCache(const char *dataset=0)
Display the content of the dataset cache, if any (matching 'dataset', if defined).
TMonitor * fAllUniqueMonitor
virtual Int_t ClearCache(const char *uri)
Clear cached information matching uri.
virtual void AddInput(TObject *inp)=0
TFileCollection * GetDataSet(const char *uri, const char *=0)
Get a list of TFileInfo objects describing the files of the specified dataset.
const char * GetDataDir() const
TSocket * GetSocket() const
virtual TDSetElement * Next(Long64_t totalEntries=-1)
Returns next TDSetElement.
void PrepareInputDataFile(TString &dataFile)
Prepare the file with the input data objects to be sent the master; the objects are taken from the de...
Int_t Load(const char *macro, Bool_t notOnClient=kFALSE, Bool_t uniqueOnly=kTRUE, TList *wrks=0)
Copy the specified macro in the cache directory.
void SetPerfTree(const char *pf="perftree.root", Bool_t withWrks=kFALSE)
Enable/Disable saving of the performance tree.
virtual const char * WorkingDirectory()
Return working directory.
static TMD5 * FileChecksum(const char *file)
Returns checksum of specified file.
Bool_t ExistsDataSet(const char *uri)
Returns kTRUE if 'dataset' described by 'uri' exists, kFALSE otherwise.
Collectable string class.
virtual TVirtualProofPlayer * MakePlayer(const char *player=0, TSocket *s=0)
Construct a TProofPlayer object.
virtual ~TProofLite()
Destructor.
virtual const char * GetBuildArch() const
Return the build architecture.
Bool_t RegisterDataSet(const char *dsName, TFileCollection *ds, const char *opt="")
Register the 'dataSet' on the cluster under the current user, group and the given 'dataSetName'...
virtual Bool_t IsValid() const
TFileCollection * GetStagingStatusDataSet(const char *dataset)
Obtains a TFileCollection showing the staging status of the specified dataset.
TString & ReplaceAll(const TString &s1, const TString &s2)
void SetupWorkersEnv(TList *wrks, Bool_t increasingpool=kFALSE)
Set up packages, loaded macros, include and lib paths ...
void SendInputDataFile()
Make sure that the input data objects are available to the workers in a dedicated file in the cache; ...
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 Long64_t DrawSelect(TDSet *set, const char *varexp, const char *selection, Option_t *option="", Long64_t nentries=-1, Long64_t firstentry=0)=0
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
virtual void SetName(const char *name)
Change (i.e.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
void SetParameter(const char *par, const char *value)
Set input list parameter.
virtual Bool_t RemoveDataSet(const char *uri)
Removes the indicated dataset.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
static const TList * GetEnvVars()
Get environemnt variables.
Int_t LockSession(const char *sessiontag, TProofLockPath **lck)
Try locking query area of session tagged sessiontag.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual EExitStatus GetExitStatus() const =0
virtual int MakeDirectory(const char *name)
Make a directory.
virtual void AddSignalHandler(TSignalHandler *sh)
Add a signal handler to list of system signal handlers.
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
virtual TFileCollection * GetDataSet(const char *uri, const char *server=0)
Utility function used in various methods for user dataset upload.
Int_t PollForNewWorkers()
Simulate dynamic addition, for test purposes.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
void SetSocket(TSocket *s)
TProofLockPath * fCacheLock
virtual void Add(TSocket *sock, Int_t interest=kRead)
Add socket to the monitor's active list.
Int_t LoadPlugin()
Load the plugin library for this handler.
virtual void SetCurrentQuery(TQueryResult *q)=0
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
The TEnv class reads config files, by default named .rootrc.
void ClearDataSetCache(const char *dataset=0)
Clear the content of the dataset cache, if any (matching 'dataset', if defined).
Int_t SetDataSetTreeName(const char *dataset, const char *treename)
Set/Change the name of the default tree.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
void NotifyStartUp(const char *action, Int_t done, Int_t tot)
Notify setting-up operation message.
TQueryResult * CloneInfo()
Return an instance of TQueryResult containing only the local info fields, i.e.
virtual Bool_t JoinProcess(TList *workers)=0
R__EXTERN TVirtualMutex * gROOTMutex
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Int_t Broadcast(const TMessage &mess, TList *slaves)
Broadcast a message to all slaves in the specified list.
Int_t GetNumberOfBadSlaves() const
Return number of bad slaves.
virtual void RemoveAll()
Remove all sockets from the monitor.
virtual void ShowDataSets(const char *uri="*", const char *opt="")
Prints formatted information about the dataset 'uri'.
const char *const kPROOF_PackageLockFile
This class represents a RFC 3986 compatible URI.
Int_t DrawQueries() const
void Print(Option_t *option="") const
Print status of PROOF-Lite cluster.
R__EXTERN TApplication * gApplication
virtual void DeActivateAll()
De-activate all activated sockets.
void ShowData()
List contents of the data directory in the sandbox.
void ShowDataDir(const char *dirname)
List contents of the data directory 'dirname'.
Long_t ExecPlugin(int nargs, const T &...params)
void ScanPreviousQueries(const char *dir)
Scan the queries directory for the results of previous queries.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static void ResolveKeywords(TString &fname, const char *path=0)
Replace , , , , , , , and placeholders in fname...
Long64_t GetBytesRead() const
TString & Insert(Ssiz_t pos, const char *s)
Int_t SendCurrentState(ESlaves list=kActive)
Transfer the current state of the master to the active slave servers.
TSignalHandler * GetSignalHandler() const
TVirtualProofPlayer * fPlayer
Bool_t R_ISREG(Int_t mode)
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
void ResolveKeywords(TString &s, const char *ord, const char *logfile)
Resolve some keywords in 's' , , ,
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
static const char * GetMacroPath()
Get macro search path. Static utility function.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
const char * GetObjName() const
virtual Long64_t Process(TDSet *set, const char *selector, Option_t *option="", Long64_t nentries=-1, Long64_t firstentry=0)=0
Int_t SavePerfTree(const char *pf=0, const char *qref=0)
Save performance information from TPerfStats to file 'pf'.
TDataSetManagerFile * fDataSetStgRepo
const char * Data() const
TSignalHandler * fIntHandler
static struct mg_connection * fc(struct mg_context *ctx)
Int_t Update(Long64_t avgsize=-1)
Update accumulated information about the elements of the collection (e.g.
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
TPluginHandler * fProgressDialog
virtual TList * GetOutputList() const =0
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Int_t CreateSymLinks(TList *files, TList *wrks=0)
Create in each worker sandbox symlinks to the files in the list Used to make the cache information av...
Double_t dot(const TVector2 &v1, const TVector2 &v2)
Bool_t fSendGroupView
list returned by kPROOF_GETSLAVEINFO
void Stop()
Stop the stopwatch.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
void UpdateDialog()
Final update of the progress dialog.
TList * fEnabledPackagesOnClient
THashList * fGlobalPackageDirList
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
TDataSetManager * fDataSetManager
TSlave * CreateSlave(const char *url, const char *ord, Int_t perf, const char *image, const char *workdir)
Create a new TSlave of type TSlave::kSlave.
This code implements the MD5 message-digest algorithm.
The TNamed class is the base class for all named ROOT classes.
Long64_t Process(TDSet *dset, const char *sel, Option_t *o="", Long64_t nent=-1, Long64_t fst=0)
Process a data set (TDSet) using the specified selector (.C) file.
EQueryMode GetQueryMode(Option_t *mode=0) const
Find out the query mode based on the current setting and 'mode'.
const char *const kPROOF_QueryDir
UChar_t mod R__LOCKGUARD2(gSrvAuthenticateMutex)
Int_t Init(const char *masterurl, const char *conffile, const char *confdir, Int_t loglevel, const char *alias=0)
Start the PROOF environment.
virtual Int_t RegisterDataSet(const char *uri, TFileCollection *dataSet, const char *opt)
Register a dataset, perfoming quota checkings, if needed.
void Init(TClassEdit::TInterpreterLookupHelper *helper)
Bool_t CancelStagingDataSet(const char *dataset)
Cancels a dataset staging request.
virtual const char * Getenv(const char *env)
Get environment variable.
TProofLockPath * fPackageLock
Int_t Collect(const TSlave *sl, Long_t timeout=-1, Int_t endtype=-1, Bool_t deactonfail=kFALSE)
Collect responses from slave sl.
TList * GetListOfElements() const
static Int_t RegisterDataSets(TList *in, TList *out, TDataSetManager *dsm, TString &e)
Register TFileCollections in 'out' as datasets according to the rules in 'in'.
Int_t ApplyMaxQueries(Int_t mxq)
Scan the queries directory and remove the oldest ones (and relative dirs, if empty) in such a way onl...
A sorted doubly linked list.
std::vector< std::vector< double > > Data
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
const char * GetUser() const
Int_t Atoi() const
Return integer value of string.
TQueryResult * GetQueryResult(const char *ref=0)
Return pointer to the full TQueryResult instance owned by the player and referenced by 'ref'...
Bool_t IsParallel() const
virtual void SetOutputList(TList *out, Bool_t adopt=kTRUE)
Set / change the output list.
virtual TSocket * Accept(UChar_t Opt=0)
Accept a connection on a server socket.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const char * GetWorkDir() const
const Bool_t kSortDescending
friend class TProofInputHandler
A container class for query results.
Long64_t GetEntries() const
TList * GetListOfSlaveInfos()
Returns list of TSlaveInfo's. In case of error return 0.
Int_t fDynamicStartupNMax
static TList * fgProofEnvList
TSocket * Select()
Return pointer to socket for which an event is waiting.
virtual void SetProcessInfo(Long64_t ent, Float_t cpu=0., Long64_t siz=-1, Float_t inittime=0., Float_t proctime=0.)
Set processing info.
void Emit(const char *signal)
Acitvate signal without args.
void SetTermTime(Float_t termtime)
TObject * GetEntryList() const
TMonitor * fUniqueMonitor
const char *const kPROOF_ConfFile
Bool_t RemoveDataSet(const char *group, const char *user, const char *dsName)
Removes the indicated dataset.
Int_t RemoveDataSet(const char *uri, const char *=0)
Remove the specified dataset from the PROOF cluster.
virtual Int_t ReadFile(const char *fname, EEnvLevel level)
Read and parse the resource file for a certain level.
const char *const kPROOF_QueryLockFile
Int_t GetNumberOfActiveSlaves() const
Return number of active slaves, i.e.
virtual void AddQueryResult(TQueryResult *q)=0
void ShowDataSets(const char *uri="", const char *=0)
Shows datasets in locations that match the uri By default shows the user's datasets and global ones...
virtual TMap * GetSubDataSets(const char *uri, const char *excludeservers)
Partition dataset 'ds' accordingly to the servers.
Long64_t DrawSelect(TDSet *dset, const char *varexp, const char *selection="", Option_t *option="", Long64_t nentries=-1, Long64_t firstentry=0)
Execute the specified drawing action on a data set (TDSet).
void QueryResultReady(const char *ref)
Notify availability of a query result.
const char * GetFileName() const
virtual void Setenv(const char *name, const char *value)
Set environment variable.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
R__EXTERN TSystem * gSystem
const TString GetUri() const
Returns the whole URI - an implementation of chapter 5.3 component recomposition. ...
const char *const kPROOF_DataSetDir
TMonitor * fCurrentMonitor
Int_t SetupWorkers(Int_t opt=0, TList *wrks=0)
Start up PROOF workers.
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Int_t GetLogLevel() const
virtual TObject * Remove(TObject *obj)
Remove object from the list.
const char *const kPROOF_ConfDir
Bool_t Gets(FILE *fp, Bool_t chop=kTRUE)
Read one line from the stream, including the , or until EOF.
virtual Bool_t ExistsDataSet(const char *uri)
Checks if the indicated dataset exits.
Bool_t ParseUri(const char *uri, TString *dsGroup=0, TString *dsUser=0, TString *dsName=0, TString *dsTree=0, Bool_t onlyCurrent=kFALSE, Bool_t wildcards=kFALSE)
Parses a (relative) URI that describes a DataSet on the cluster.
void ClearCache(const char *file=0)
Remove files from all file caches.
Int_t fDynamicStartupStep
virtual Int_t ShowCache(const char *uri)
Show cached information matching uri.
void SetActive(Bool_t=kTRUE)
Int_t WriteDataSet(const char *group, const char *user, const char *dsName, TFileCollection *dataset, UInt_t option=0, TMD5 *checksum=0)
Writes indicated dataset.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t TestBit(UInt_t f) const
const char *const kPROOF_CacheLockFile
Int_t ScanDataSet(const char *uri, const char *opt)
Scans the dataset indicated by 'uri' following the 'opts' directives.
char * Form(const char *fmt,...)
void SetRunning(Int_t startlog, const char *par, Int_t nwrks)
Call when running starts.
TServerSocket * fServSock
virtual const char * GetName() const
Returns name of object.
Bool_t SetFragment(const TString &fragment)
Set fragment component of URI: fragment = *( pchar / "/" / "?" ).
TList * GetListOfQueries(Option_t *opt="")
Get the list of queries.
Bool_t fProgressDialogStarted
virtual Int_t Exec(const char *shellcmd)
Execute a command.
const Int_t kPROOF_Protocol
Int_t SendGroupView()
Send to all active slaves servers the current slave group size and their unique id.
Bool_t FinalizeQuery(TProofQueryResult *pq, TProof *proof, TVirtualProofPlayer *player)
Final steps after Process() to complete the TQueryResult instance.
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
Int_t RemoveWorkers(TList *wrks)
Used for shuting down the workres after a query is finished.
virtual const char * GetBuildCompilerVersion() const
Return the build compiler version.
void SetName(const char *name)
static Int_t GetNumberOfWorkers(const char *url=0)
Static method to determine the number of workers giving priority to users request.
virtual void FreeDirectory(void *dirp)
Free a directory.
void AddInput(TObject *obj)
Add objects that might be needed during the processing of the selector (see Process()).
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
TMap * GetDataSets(const char *uri="", const char *=0)
lists all datasets that match given uri
Int_t VerifyDataSetParallel(const char *uri, const char *optStr)
Internal function for parallel dataset verification used TProof::VerifyDataSet and TProofLite::Verify...
virtual void RemoveQueryResult(const char *ref)=0
static TSelector * GetSelector(const char *filename)
The code in filename is loaded (interpreted or compiled, see below), filename must contain a valid cl...
Int_t AssertPath(const char *path, Bool_t writable)
Make sure that 'path' exists; if 'writable' is kTRUE, make also sure that the path is writable...
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
Int_t CreateSandbox()
Create the sandbox for this session.
TString & Remove(Ssiz_t pos)
Float_t GetRealTime() const
Int_t HandleOutputOptions(TString &opt, TString &target, Int_t action)
Extract from opt information about output handling settings.
R__EXTERN TProof * gProof
virtual TSignalHandler * RemoveSignalHandler(TSignalHandler *sh)
Remove a signal handler from list of signal handlers.
virtual Int_t GetSize() const
void SetFeedback(TString &opt, TString &optfb, Int_t action)
Extract from opt in optfb information about wanted feedback settings.
Int_t GoParallel(Int_t nodes, Bool_t accept=kFALSE, Bool_t random=kFALSE)
Go in parallel mode with at most "nodes" slaves.
virtual const char * HostName()
Return the system's host name.
virtual int Symlink(const char *from, const char *to)
Create a symbolic link from file1 to file2.
Int_t Lock()
Locks the directory.
TList * fNonUniqueMasters
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Int_t CleanupSandbox()
Remove old sessions dirs keep at most 'Proof.MaxOldSessions' (default 10)
const char * GetOrdinal() const
TList * fEnabledPackagesOnCluster
virtual void Reset()
Reset or initialize access to the elements.
void SetRunStatus(ERunStatus rst)
void RemoveQuery(TQueryResult *qr, Bool_t soft=kFALSE)
Remove everything about query qr.
Int_t Unlock()
Unlock the directory.
virtual void StopProcess(Bool_t abort, Int_t timeout=-1)=0
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Int_t GetSandbox(TString &sb, Bool_t assert=kFALSE, const char *rc=0)
Set the sandbox path from ' Proof.Sandbox' or the alternative var 'rc'.
static TMap * GetDataSetNodeMap(TFileCollection *fc, TString &emsg)
Get a map {server-name, list-of-files} for collection 'fc' to be used in TPacketizerFile.
void SaveQuery(TProofQueryResult *qr, const char *fout=0)
Save current status of query 'qr' to file name fout.
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
Mother of all ROOT objects.
Float_t GetCpuTime() const
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
Int_t GetNumberOfSlaves() const
Return number of slaves as described in the config file.
Bool_t ExistsDataSet(const char *group, const char *user, const char *dsName)
Checks if the indicated dataset exits.
Int_t InitDataSetManager()
Initialize the dataset manager from directives or from defaults Return 0 on success, -1 on failure.
Bool_t R_ISDIR(Int_t mode)
static void SetMacroPath(const char *newpath)
Set or extend the macro search path.
R__EXTERN TProofServ * gProofServ
virtual void Add(TObject *obj)
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
TProofOutputList fOutputList
R__EXTERN const char * gRootDir
TProofLockPath * fQueryLock
TFileCollection * GetDataSet(const char *uri, const char *srv=0)
Utility function used in various methods for user dataset upload.
Int_t CleanupQueriesDir()
Remove all queries results referring to previous sessions.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
void AskStatistics()
Ask the for the statistics of the slaves.
Int_t GetNumberOfInactiveSlaves() const
Return number of inactive slaves, i.e.
TTree * GetTreeHeader(TDSet *tdset)
Creates a tree header (a tree with nonexisting files) object for the DataSet.
Int_t SetParallel(Int_t nodes=-1, Bool_t random=kFALSE)
Tell PROOF how many slaves to use in parallel.
virtual int CopyFile(const char *from, const char *to, Bool_t overwrite=kFALSE)
Copy a file.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
ClassImp(TSlaveInfo) Int_t TSlaveInfo const TSlaveInfo * si
Used to sort slaveinfos by ordinal.
Int_t GetClientProtocol() const
virtual Long64_t GetEntries() const
TList * fAvailablePackages
A TTree object has a header with a name and a title.
Class describing a generic file including meta information.
Int_t SendInitialState()
Transfer the initial (i.e.
const AParamType & GetVal() const
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
TList * fTerminatedSlaveInfos
virtual Bool_t IsValid() const
TProofQueryResult * MakeQueryResult(Long64_t nent, const char *opt, Long64_t fst, TDSet *dset, const char *selec)
Create a TProofQueryResult instance for this query.
Int_t Remove(const char *ref, Bool_t all)
Handle remove request.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
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...
Int_t Substitute(TString &s, const TString &r, Bool_t doDollarSubst=kTRUE)
Substitute matching part of s with r, dollar back-ref substitution is performed if doDollarSubst is t...
void FindUniqueSlaves()
Add to the fUniqueSlave list the active slaves that have a unique (user) file system image...
A TSelector object is used by the TTree::Draw, TTree::Scan, TTree::Process to navigate in a TTree and...
void ResetProgressDialog(const char *sel, Int_t sz, Long64_t fst, Long64_t ent)
Reset progress dialog.
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
TList * PreviousQueries() const
virtual TMap * GetDataSets(const char *uri, UInt_t=TDataSetManager::kExport)
Returns all datasets for the and specified by .
void ShowCache(Bool_t all=kFALSE)
List contents of file cache.
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
Int_t GetParallel() const
Returns number of slaves active in parallel mode.
virtual Int_t SetupServ(Int_t stype, const char *conffile)
Init a PROOF slave object.
TMonitor * fActiveMonitor
virtual TList * GetListOfResults() const =0
virtual int GetSysInfo(SysInfo_t *info) const
Returns static system info, like OS type, CPU type, number of CPUs RAM size, etc into the SysInfo_t s...
Long64_t fLastPollWorkers_s
Int_t CopyMacroToCache(const char *macro, Int_t headerRequired=0, TSelector **selector=0, Int_t opt=0, TList *wrks=0)
Copy a macro, and its possible associated .h[h] file, to the cache directory, from where the workers ...
const char *const kPROOF_CacheDir
const char *const kPROOF_PackDir
void SetInputHandler(TFileHandler *ih)
Adopt and register input handler for this slave.
static Int_t AssertDataSet(TDSet *dset, TList *input, TDataSetManager *mgr, TString &emsg)
Make sure that dataset is in the form to be processed.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.