Open
Description
Check duplicate issues.
- Checked for duplicates
Description
Creating snapshots of variable values clones all the relevant RooRealVar objects instead of simply storing values. This blows up the RooWorkspace size, reaching easily the 1GB buffer limit.
If the buffer limit can't be increased, we have to look at alternatives to store the information in the RooWorkspace with less redundancy.
Reproducer
std::size_t nVars = 1000000;
std::size_t nSnapshots = 3;
RooArgSet args;
for (std::size_t i = 0; i < nVars; ++i) {
std::string name = "var_" + std::to_string(i);
args.addOwned(std::make_unique<RooRealVar>(name.c_str(), name.c_str(), i));
}
RooWorkspace ws;
std::cout << "importing..." << std::endl;
ws.import(args, RooFit::Silence());
std::cout << "snapshotting..." << std::endl;
for (std::size_t i = 0; i < nSnapshots; ++i) {
ws.saveSnapshot("snapshot_" + std::to_string(i), ws.allVars(), true);
}
ws.writeToFile("repro_ws.root");
Output:
root [0]
Processing repro.C...
importing...
snapshotting...
Error in <TBufferFile::WriteByteCount>: bytecount too large (more than 1073741822)
root [1]
ROOT version
any
Installation method
any
Operating system
any
Additional context
This is a problem for current ATLAS Higgs combinations.