UCL / STIR-GATE-Connection

Example files on how to run STIR on GATE data
16 stars 11 forks source link

Combining many ROOT files using `hadd` can exeed the (default) 100GB limit #82

Closed robbietuk closed 3 years ago

robbietuk commented 3 years ago

I was using the following command to combine the root files output by many parallel GATE simulations

hadd SingleSource10MCombine.Coincidences.root SingleSource10MSim_{1..100}.Coincidences.root

This errored with:

Fatal in <TFileMerger::RecursiveRemove>: Output file of the TFile Merger (targeting SingleSource10MCombine.Coincidences.root) has been deleted (likely due to a TTree larger than 100Gb)

Solution ==== There is a known solution for this issue, see: https://root-forum.cern.ch/t/root-6-04-14-hadd-100gb-and-rootlogon/24581. I have detailed here:

Create a script:

// Script name `startup.C`

#include "TTree.h"

int startup() {
  TTree::SetMaxTreeSize( 1000000000000LL ); // 1 TB
  return 0;
}

namespace {
  static int i = startup();
}

Compile this using the commands

root.exe -b -l -q startup.C

and run hadd on macOS with

DYLD_INSERT_LIBRARIES=startup_C.so hadd SingleSource10MCombine.Coincidences.root SingleSource10MSim_{1..100}.Coincidences.root

and run hadd on linux with

LD_PRELOAD=startup_C.so hadd SingleSource10MCombine.Coincidences.root SingleSource10MSim_{1..100}.Coincidences.root

Question ==== Should we include the solution script in SGC and how should we document this methodology?

KrisThielemans commented 3 years ago

Ugly..

I'd just put it in the README. It seems a step too far for the SGC to work around ROOT problems.