TFileMerger and TProofOutputFile root 5.24

Hi
I have been using PROOF (PROOFLite) for some time now using root 5.22. After some teething issues, I’ve had PROOF running well. I’ve now been compelled to upgrade to root 5.24.

Now I’ve a problem. Out of the box, my code no longer works… specifically the merging of files and my TProofOutputFile.

In version 5.22 I did the following:

In INIT() :
//not in slavebegin() for various reasons… I make sure to call the code only once

fProofFile = new TProofOutputFile("selection.root");
fProofFile->SetOutputFileName("selection.root");

// Open the file                                                           
   TDirectory *savedir = gDirectory;
     if (!(fFile = fProofFile->OpenFile("RECREATE"))) {
       Warning("SlaveBegin", "problems opening file: %s/%s",
               fProofFile->GetDir(), fProofFile->GetFileName());
     }
     savedir->cd();

newtree = fChain->CloneTree(0);
// File resident                                                           
newtree->SetDirectory(fFile);
newtree->AutoSave();
newtree->SetMaxTreeSize(1000*Long64_t(2000000000));

and in SlaveTerminate():

if (fFile) {
    TDirectory *savedir = gDirectory;
    fFile->cd();
    newtree->Write();
    newtree->SetDirectory(0);
    gDirectory = savedir;
    fFile->Close();
}

================================================

In 5.24 this code no longer seems to work. Following what has been updated at root.cern.ch/drupal/content/hand … root-files

fProofFile = new TProofOutputFile("selection.root");

     TDirectory *savedir = gDirectory;
     if (!(fFile = fProofFile->OpenFile("RECREATE"))) {
       Warning("SlaveBegin", "problems opening file: %s/%s",
               fProofFile->GetDir(), fProofFile->GetFileName());
     }

     savedir->cd();
     cout <<"LEAVING INIT\n";

     newtree = fChain->CloneTree(0);

// File resident                                                           
     newtree->SetDirectory(fFile);
     newtree->AutoSave();
     newtree->SetMaxTreeSize(1000*Long64_t(2000000000));

and in SlaveTerminate():

if (fFile) { Bool_t cleanup = kFALSE; TDirectory *savedir = gDirectory; if (newtree->GetEntries() > 0) { fFile->cd(); newtree->Write(); fProofFile->Print(); fOutput->Add(fProofFile); } else { cleanup = kTRUE; } newtree->SetDirectory(0); gDirectory = savedir; fFile->Close(); // Cleanup, if needed if (cleanup) { TUrl uf(*(fFile->GetEndpointUrl())); SafeDelete(fFile); gSystem->Unlink(uf.GetFile()); SafeDelete(fProofFile); } }

=============================================

The second, with root 5.24 does not produced a output file (selection.root)… doing a little bit of testing I’ve determined that the code ‘gets stuck’ in TProofPlayerRemote::MergeOutputFiles() the line gSystem->Unlink(url->GetString());

(printing the url, it looks something like root://zcanada2.desy.de//canada/zcanada … 3beef.root)

Does anyone have any idea why the original code doesn’t work for 5.24? or why the new code does not work on 5.24?

Sorry for the long post.

Trevor

Hi,

The TProofOutputFile has undergone several adjustments before 5.26 to cope with some new use-cases.
In doing this we tried to keep the existing functionality stable, but we are aware of some issues with the definition of paths, affecting in particular PROOF-Lite.
There was a bunch of fixes introduced in 5.24/00a reflecting the trunk developments/fixes: I suggest, if possible, that you try with such patch version (or the latest tag on the 5.24 patch branch, 5.24/00b, which however is equivalent for PROOF) and then, if necessary, we debug that version.

Gerri Ganis