76const char *
refloc =
"proof://localhost:40000";
91 while (s.Tokenize(t,
from ,
" ")) {
97 if (
vopts.IsNull())
vopts =
"valgrind_opts:--leak-check=full --track-origins=yes";
99 Printf(
"getProof: valgrind run: '%s' (opts: '%s')",
vopt.Data(),
vopts.Data());
110 if (!
url[0])
uu.SetUrl(
"lite://");
119 Printf(
"getProof: trying to open a PROOF-Lite session with %s",
swrk.Data());
121 Printf(
"getProof: trying to open a session on the external cluster at '%s'",
url);
124 if (
p &&
p->IsValid()) {
127 Printf(
"getProof: WARNING: started/attached a session on external cluster (%s):"
131 Printf(
"getProof: WARNING: started/attached a session on external cluster (%s):"
132 " 'dir=\"%s\"' ignored",
url,
dir);
135 Printf(
"getProof: WARNING: started/attached a session on external cluster (%s):"
136 " 'opt=\"force\"' ignored",
url);
139 Printf(
"getProof: WARNING: started/attached a session on external cluster (%s):"
140 " 'dyn=kTRUE' ignored",
url);
143 Printf(
"getProof: could not get/start a valid session at %s",
url);
153 Printf(
"getProof: local PROOF not yet supported on Windows, sorry!");
165 Printf(
"getProof: unable to create the working area at the requested path: '%s'"
166 " - cannot continue",
tutdir.Data());
168 Printf(
"getProof: working area at the requested path '%s'"
169 " created but it is not writable - cannot continue",
tutdir.Data());
177 Printf(
"getProof: working area at the requested path '%s'"
178 " exists but is not writable - cannot continue",
tutdir.Data());
184 Printf(
"getProof: working area not specified temp ");
191 Printf(
"getProof: could not get user info");
194 us.
Form(
"/%s",
ug->fUser.Data());
201 Printf(
"getProof: unable to get a writable working area (tried: %s)"
202 " - cannot continue",
tutdir.Data());
207 Printf(
"getProof: working area (tutorial dir): %s",
tutdir.Data());
216 Printf(
"getProof: unable to get a writable dataset directory (tried: %s)"
226 u.SetProtocol(
"proof");
228 u.SetPort(
uu.GetPort());
247 Printf(
"getProof: something else the a XProofd service is running on"
248 " port %d - cannot continue",
lportp);
251 }
else if (
rc == 0) {
256 Printf(
"getProof: daemon found listening on dedicated ports {%d,%d} (pid: %d)",
263 char *
answer = (
char *)
Getline(
"getProof: would you like to restart it (N,Y)? [N] ");
274 Printf(
"getProof: cleaning existing instance ...");
276 cmd =
Form(
"kill -9 %d", pid);
278 Printf(
"getProof: problems stopping xrootd process %d (%d)", pid,
rc);
280 Printf(
"getProof: wait 5 secs so that previous connections are cleaned ...");
290 Printf(
"getProof: xproofd not found: please check the environment!");
302 Printf(
"getProof: could not create config file for XPD (%s)",
xpdcf.Data());
305 fprintf(
fcf,
"### Use admin path at %s/admin to avoid interferences with other users\n",
tutdir.Data());
307#if defined(R__MACOSX)
308 fprintf(
fcf,
"### Use dedicated socket path under /tmp to avoid length problems\n");
309 fprintf(
fcf,
"xpd.sockpathdir /tmp/xpd-sock\n");
312 fprintf(
fcf,
"xrd.protocol xproofd libXrdProofd.so\n");
315 fprintf(
fcf,
"### Force number of local workers\n");
318 fprintf(
fcf,
"### Root path for working dir\n");
320 fprintf(
fcf,
"### Allow different users to connect\n");
322 fprintf(
fcf,
"### Limit the number of query results kept in the master sandbox\n");
323 fprintf(
fcf,
"xpd.putrc ProofServ.UserQuotas: maxquerykept=2\n");
324 fprintf(
fcf,
"### Limit the number of sessions kept in the sandbox\n");
325 fprintf(
fcf,
"xpd.putrc Proof.MaxOldSessions: 1\n");
327 fprintf(
fcf,
"### Use dataset directory under the tutorial dir\n");
331 fprintf(
fcf,
"### Use dynamic, per-job scheduling\n");
332 fprintf(
fcf,
"xpd.putrc Proof.DynamicStartup 1\n");
334 fprintf(
fcf,
"### For internal file serving use the xrootd protocol on the same port\n");
335 fprintf(
fcf,
"xpd.xrootd libXrdXrootd-4.so\n");
336 fprintf(
fcf,
"### Set the local data server for the temporary output files accordingly\n");
339 Printf(
"getProof: xproofd config file at %s",
xpdcf.Data());
343 cmd =
Form(
"%s -c %s -b -l %s -n xpdtut -p %d",
345 Printf(
"(NB: any error line from XrdClientSock::RecvRaw and XrdClientMessage::ReadRaw should be ignored)");
347 Printf(
"getProof: problems starting xproofd (%d)",
rc);
353 Printf(
"getProof: waiting for xproofd to start ...");
357 Printf(
"getProof: xproofd pid: %d", pid);
362 Printf(
"getProof: could not create pid file for XPD");
368 Printf(
"getProof: start / attach the PROOF session ...");
372 if (!
p || !(
p->IsValid())) {
373 Printf(
"getProof: starting local session failed");
388 Printf(
"getXrootdPid: Xrootd/Proof not supported on Windows, sorry!");
394 const char *
com =
"-eo pid,comm";
395#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
396 const char *
com =
"ax -w -w";
398 const char *
com =
"-w -w -eo pid,command";
402 cmd.
Form(
"ps %s | grep xrootd | grep \"\-p %d\" | grep %s",
com, port,
subdir);
404 cmd.Form(
"ps %s | grep xrootd | grep \"\-p %d\"",
com, port);
408 char line[2048], rest[2048];
430 if (!(s.IsValid())) {
432 Printf(
"checkXrootdAt: could not open connection to %s:%d", host, port);
448 Printf(
"checkXrootdAt: 1st: wrong number of bytes read: %d (expected: %d)",
461 Printf(
"checkXrootdAt: 2nd: wrong number of bytes read: %d (expected: %d)",
466 }
else if (
type == 8) {
469 Printf(
"checkXrootdAt: server is ROOTD");
474 Printf(
"checkXrootdAt: unknown server type: %d",
type);
491 if (!(s.IsValid())) {
493 Printf(
"checkXproofdAt: could not open connection to %s:%d", host, port);
506 s.SendRaw(&dum[0],
sizeof(dum));
513 Printf(
"checkXproofdAt: 1st: wrong number of bytes read: %d (expected: %d)",
526 Printf(
"checkXproofdAt: 2nd: wrong number of bytes read: %d (expected: %d)",
534 }
else if (
type == 8) {
537 Printf(
"checkXproofdAt: server is PROOFD");
542 Printf(
"checkXproofdAt: unknown server type: %d",
type);
556 Printf(
"startXrootdAt: Xrootd not supported on Windows, sorry!");
565 Printf(
"startXrootdAt: some other service running on port %d - cannot proceed ", port);
568 }
else if (
rc == 0) {
576 Printf(
"startXrootdAt: xrootd service already available on port %d: ", port);
577 char *
answer = (
char *)
Getline(
"startXrootdAt: would you like to restart it (N,Y)? [N] ");
585 Printf(
"startXrootdAt: cleaning existing instance ...");
593 Printf(
"startXrootdAt: problems stopping xrootd process %d (%d)", pid,
rc);
601 Printf(
"startXrootdAt: could not assert dir for log file");
606 cmd.
Form(
"xrootd -d -p %d -b -l /tmp/xrd-basic/xrootd.log", port);
617 Printf(
"cmd: %s", cmd.Data());
619 Printf(
"startXrootdAt: problems executing starting command (%d)",
rc);
623 Printf(
"startXrootdAt: waiting for xrootd to start ...");
627 Printf(
"startXrootdAt: xrootd service not available at %d (rc = %d) - startup failed",
631 Printf(
"startXrootdAt: basic xrootd started!");
645 Printf(
"killXrootdAt: Xrootd not supported on Windows, sorry!");
655 Printf(
"killXrootdAt: problems stopping xrootd process %d (%d)", pid,
rc);
672 if (
sw.BeginsWith(
"k"))
sw.Remove(0,1);
676 }
else if (
sw ==
"Packetizer") {
678 }
else if (
sw ==
"Loop") {
680 }
else if (
sw ==
"Selector") {
682 }
else if (
sw ==
"Output") {
684 }
else if (
sw ==
"Input") {
686 }
else if (
sw ==
"Global") {
688 }
else if (
sw ==
"Package") {
690 }
else if (
sw ==
"Feedback") {
692 }
else if (
sw ==
"Condor") {
694 }
else if (
sw ==
"Draw") {
696 }
else if (
sw ==
"Asyn") {
698 }
else if (
sw ==
"Cache") {
700 }
else if (
sw ==
"Collect") {
702 }
else if (
sw ==
"Dataset") {
704 }
else if (
sw ==
"Submerger") {
706 }
else if (
sw ==
"Monitoring") {
708 }
else if (
sw ==
"All") {
710 }
else if (!
sw.IsNull()) {
711 Printf(
"WARNING: requested debug enum name '%s' does not exist: assuming 'All'",
sw.Data());
UShort_t host2net(UShort_t x)
UShort_t net2host(UShort_t x)
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 Atom_t Atom_t Time_t UChar_t len
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 Atom_t Atom_t Time_t type
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
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.
This class controls a Parallel ROOT Facility, PROOF, cluster.
static TProof * Open(const char *url=0, const char *conffile=0, const char *confdir=0, Int_t loglevel=0)
Start a PROOF session on a specific cluster.
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.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
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_t Exec(const char *shellcmd)
Execute a command.
virtual FILE * OpenPipe(const char *command, const char *mode)
Open a pipe.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual int ClosePipe(FILE *pipe)
Close the pipe.
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 void Sleep(UInt_t milliSec)
Sleep milliSec milli seconds.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
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.