48 TString condorHome =
gEnv->GetValue(
"Proof.CondorHome", (
char*)0);
49 if (condorHome !=
"") {
51 path = condorHome +
"/bin:" + path;
55 TString condorConf =
gEnv->GetValue(
"Proof.CondorConfig", (
char*)0);
56 if (condorConf !=
"") {
57 gSystem->Setenv(
"CONDOR_CONFIG",condorConf);
92 <<
"\tPool: \"" <<
fPool <<
"\""
93 <<
"\tState: " <<
fState << std::endl;
105 TString claimCmd =
Form(
"condor_cod request -name %s -timeout 10 2>>%s/condor.proof.%d",
108 PDB(kCondor,2)
Info(
"ClaimVM",
"command: %s", claimCmd.
Data());
109 FILE *pipe =
gSystem->OpenPipe(claimCmd,
"r");
112 SysError(
"ClaimVM",
"cannot run command: %s", claimCmd.
Data());
118 while (
line.Gets(pipe)) {
119 PDB(kCondor,3)
Info(
"ClaimVM",
"line = %s",
line.Data());
121 if (
line.BeginsWith(
"ClaimId = \"")) {
125 PDB(kCondor,1)
Info(
"ClaimVM",
"claim = '%s'", claimId.
Data());
128 port = 37000 + atoi(num.
Data());
129 PDB(kCondor,1)
Info(
"ClaimVM",
"port = %d", port);
135 Error(
"ClaimVM",
"command: %s returned %d", claimCmd.
Data(),
r);
138 PDB(kCondor,1)
Info(
"ClaimVM",
"command: %s returned %d", claimCmd.
Data(),
r);
142 FILE *jf =
gSystem->TempFileName(jobad);
144 if (jf == 0)
return 0;
147 str.ReplaceAll(
"$(Port)",
Form(
"%d", port));
152 TString activateCmd =
Form(
"condor_cod activate -id '%s' -jobad %s",
155 PDB(kCondor,2)
Info(
"ClaimVM",
"command: %s", activateCmd.
Data());
156 pipe =
gSystem->OpenPipe(activateCmd,
"r");
159 SysError(
"ClaimVM",
"cannot run command: %s", activateCmd.
Data());
163 while (
line.Gets(pipe)) {
164 PDB(kCondor,3)
Info(
"ClaimVM",
"Activate: line = %s",
line.Data());
169 Error(
"ClaimVM",
"command: %s returned %d", activateCmd.
Data(),
r);
171 PDB(kCondor,1)
Info(
"ClaimVM",
"command: %s returned %d", activateCmd.
Data(),
r);
197 TString cmd =
Form(
"condor_status %s -format \"%%s\\n\" Name", poolopt.
Data());
199 PDB(kCondor,2)
Info(
"GetVirtualMachines",
"command: %s", cmd.Data());
201 FILE *pipe =
gSystem->OpenPipe(cmd,
"r");
204 SysError(
"GetVirtualMachines",
"cannot run command: %s", cmd.Data());
210 while (
line.Gets(pipe)) {
211 PDB(kCondor,3)
Info(
"GetVirtualMachines",
"line = %s",
line.Data());
218 Error(
"GetVirtualMachines",
"command: %s returned %d", cmd.Data(),
r);
221 PDB(kCondor,1)
Info(
"GetVirtualMachines",
"command: %s returned %d", cmd.Data(),
r);
236 Error(
"Claim",
"not in state Free");
271 Error(
"Claim",
"not in state Free or Active");
290 PDB(kCondor,1)
Info(
"SetState",
"state: %s (%lld)",
299 PDB(kCondor,2)
Info(
"SetState",
"command: %s", cmd.Data());
300 FILE *pipe =
gSystem->OpenPipe(cmd,
"r");
303 SysError(
"SetState",
"cannot run command: %s", cmd.Data());
308 while (
line.Gets(pipe)) {
309 PDB(kCondor,3)
Info(
"SetState",
"line = %s",
line.Data());
314 Error(
"SetState",
"command: %s returned %d", cmd.Data(),
r);
317 PDB(kCondor,1)
Info(
"SetState",
"command: %s returned %d", cmd.Data(),
r);
332 Error(
"Suspend",
"not in state Active");
346 Error(
"Suspend",
"not in state Suspended");
360 Error(
"Suspend",
"not in state Active or Suspended");
368 PDB(kCondor,2)
Info(
"SetState",
"command: %s", cmd.Data());
369 FILE *pipe =
gSystem->OpenPipe(cmd,
"r");
372 SysError(
"Release",
"cannot run command: %s", cmd.Data());
377 while (
line.Gets(pipe)) {
378 PDB(kCondor,3)
Info(
"Release",
"line = %s",
line.Data());
383 Error(
"Release",
"command: %s returned %d", cmd.Data(),
r);
386 PDB(kCondor,1)
Info(
"Release",
"command: %s returned %d", cmd.Data(),
r);
403 TString cmd =
Form(
"condor_status -format \"%%d:\" Mips -format \"%%s\\n\" FileSystemDomain "
404 "-const 'Name==\"%s\"'", vm);
406 PDB(kCondor,2)
Info(
"GetVmInfo",
"command: %s", cmd.Data());
407 FILE *pipe =
gSystem->OpenPipe(cmd,
"r");
410 SysError(
"GetVmInfo",
"cannot run command: %s", cmd.Data());
415 while (
line.Gets(pipe)) {
416 PDB(kCondor,3)
Info(
"GetVmInfo",
"line = %s",
line.Data());
419 perfidx = atoi(amips);
427 Error(
"GetVmInfo",
"command: %s returned %d", cmd.Data(),
r);
430 PDB(kCondor,1)
Info(
"GetVmInfo",
"command: %s returned %d", cmd.Data(),
r);
442 TString cmd =
Form(
"condor_status -direct %s -format \"Image:%%s\\n\" "
443 "FileSystemDomain", host);
445 PDB(kCondor,2)
Info(
"GetImage",
"command: %s", cmd.Data());
447 FILE *pipe =
gSystem->OpenPipe(cmd,
"r");
450 SysError(
"GetImage",
"cannot run command: %s", cmd.Data());
456 while (
line.Gets(pipe)) {
457 PDB(kCondor,3)
Info(
"GetImage",
"line = %s",
line.Data());
466 Error(
"GetImage",
"command: %s returned %d", cmd.Data(),
r);
469 PDB(kCondor,1)
Info(
"GetImage",
"command: %s returned %d", cmd.Data(),
r);
484 <<
" Image: " <<
fImage << std::endl;
if(isa< VarDecl >(D)||isa< FieldDecl >(D)||isa< EnumConstantDecl >(D))
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
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
R__EXTERN TSystem * gSystem
void Print(Option_t *option="") const override
Print worker status.
TClass * IsA() const override
Bool_t Suspend()
Suspend worker.
Bool_t Release()
Release worker.
Bool_t Resume()
Resume worker.
~TCondor() override
Cleanup Condor interface.
TList * Claim(Int_t n, const char *cmd)
Claim n virtual machines This function figures out the image and performance index before returning t...
TCondor(const char *pool="")
Create Condor interface object.
TClass * IsA() const override
TCondorSlave * ClaimVM(const char *vm, const char *cmd)
Claim a VirtualMachine for PROOF usage.
TString GetImage(const char *host) const
Get image of the worker.
void Print(Option_t *option="") const override
Print master status.
Bool_t GetVmInfo(const char *vm, TString &image, Int_t &perfidx) const
Get info about worker status.
TList * GetVirtualMachines() const
Get the names of the virtual machines in the pool.
Bool_t SetState(EState state)
Set the state of workers.
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
const char * GetName() const override
Returns name of object.
Collectable string class.
const char * GetName() const override
Returns name of object.
virtual void SysError(const char *method, const char *msgfmt,...) const
Issue system error message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Regular expression class.
const char * Data() const
TString & Remove(Ssiz_t pos)
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const