Int_t pid;
for (Int_t ijob=0; ijob<nentries; ijob++) {
status = (TGridJobStatus *)list->At(ijob);
- pid = gROOT->ProcessLine(Form("atoi(((TAlienJobStatus*)0x%lx)->GetKey(\"queueId\"));", (ULong_t)status));
+ pid = gROOT->ProcessLine(Form("atoi(((TAlienJobStatus*)%p)->GetKey(\"queueId\"));", status));
if (pid<jobidstart) continue;
if (pid == lastid) {
- gROOT->ProcessLine(Form("sprintf((char*)0x%lx,((TAlienJobStatus*)0x%lx)->GetKey(\"status\"));",(ULong_t)mstatus, (ULong_t)status));
+ gROOT->ProcessLine(Form("sprintf((char*)%p,((TAlienJobStatus*)%p)->GetKey(\"status\"));",mstatus, status));
}
switch (status->GetStatus()) {
case TGridJobStatus::kWAITING:
if (!fIncludePath.IsNull()) {
TString includePath = fIncludePath;
includePath.ReplaceAll(" ",":");
+ includePath.ReplaceAll("$ALICE_ROOT","");
+ includePath.ReplaceAll("${ALICE_ROOT}","");
+ includePath.ReplaceAll("-I","");
includePath.Strip(TString::kTrailing, ':');
Info("StartAnalysis", "Adding extra includes: %s",includePath.Data());
optionsList.Add(new TNamed("ALIROOT_EXTRA_INCLUDES",includePath.Data()));
printf("%s %s\n", obj->GetName(), obj->GetTitle());
}
if (!gROOT->ProcessLine(Form("gProof->UploadPackage(\"%s\");",alirootLite.Data()))
- && !gROOT->ProcessLine(Form("gProof->EnablePackage(\"%s\", (TList*)0x%lx);",alirootLite.Data(),(ULong_t)&optionsList))) {
+ && !gROOT->ProcessLine(Form("gProof->EnablePackage(\"%s\", (TList*)%p);",alirootLite.Data(),&optionsList))) {
Info("StartAnalysis", "AliRootProofLite enabled");
} else {
Error("StartAnalysis", "There was an error trying to enable package AliRootProofLite.par");
return kFALSE;
}
} else {
- if (gROOT->ProcessLine(Form("gProof->EnablePackage(\"VO_ALICE@AliRoot::%s\", (TList*)0x%lx);",
- fAliROOTVersion.Data(), (ULong_t)&optionsList))) {
+ if (gROOT->ProcessLine(Form("gProof->EnablePackage(\"VO_ALICE@AliRoot::%s\", (TList*)%p, kTRUE);",
+ fAliROOTVersion.Data(), &optionsList))) {
Error("StartAnalysis", "There was an error trying to enable package VO_ALICE@AliRoot::%s", fAliROOTVersion.Data());
return kFALSE;
}
}
TFileCollection *coll = new TFileCollection();
coll->AddFromFile(fFileForTestMode);
- gROOT->ProcessLine(Form("gProof->RegisterDataSet(\"test_collection\", (TFileCollection*)0x%lx, \"OV\");", (ULong_t)coll));
+ gROOT->ProcessLine(Form("gProof->RegisterDataSet(\"test_collection\", (TFileCollection*)%p, \"OV\");", coll));
gROOT->ProcessLine("gProof->ShowDataSets()");
}
return kTRUE;
#include "AliAnalysisManager.h"
+#include <cerrno>
#include <Riostream.h>
#include <TError.h>
#include <TClass.h>
cdir->cd();
}
+//______________________________________________________________________________
+Bool_t AliAnalysisManager::IsPipe(std::ostream &out)
+{
+// Check if the stdout is connected to a pipe (C.Holm)
+ Bool_t ispipe = kFALSE;
+ out.seekp(0, std::ios_base::cur);
+ if (out.fail()) {
+ out.clear();
+ if (errno == ESPIPE) ispipe = kTRUE;
+ }
+ return ispipe;
+}
+
//______________________________________________________________________________
void AliAnalysisManager::SetInputEventHandler(AliVEventHandler* const handler)
{
static Bool_t oneoftwo = kFALSE;
static Int_t nrefresh = 0;
static Int_t nchecks = 0;
+ static char lastChar = 0;
const char symbol[4] = {'-','\\','|','/'};
+ if (!lastChar) lastChar = (IsPipe(std::cerr))?'\r':'\n';
if (!refresh) {
nrefresh = 0;
if (!size) return;
Int_t rsec = remain % 60;
Int_t rmin = (remain / 60) % 60;
Int_t rhour = (remain / 60 / 60);
- fprintf(stderr, "[%6.2f %%] TIME %.2d:%.2d:%.2d ETA %.2d:%.2d:%.2d\r",
- percent, hours, minutes, seconds, rhour, rmin, rsec);
+ fprintf(stderr, "[%6.2f %%] TIME %.2d:%.2d:%.2d ETA %.2d:%.2d:%.2d%c",
+ percent, hours, minutes, seconds, rhour, rmin, rsec, lastChar);
}
- else fprintf(stderr, "[%6.2f %%]\r", percent);
+ else fprintf(stderr, "[%6.2f %%]%c", percent, lastChar);
if (refresh && oneoftwo) oname = nname;
if (owatch) owatch->Continue();
if (last) {