I am trying to merge several (~4000) root files together, for which I do:
hadd -kk -f MERGED.root Bd2kstee-2017-MagUp_335.root Bd2kstee-2017-MagUp_336.root …
I checked that the root files were OK, and they seem to be. At first, the merging works fine. However, after a while I start getting a bunch of errors like this one:
SysError in TFile::ReadBuffer: error reading from file Bd2kstee-2017-MagUp_335.root (Input/output error)
Error in TKey::ReadFile: Failed to read data.
And ended up with the merged root file not being produced. Do you know what could be causing this?
Can you try with the option “-n 50”, this will reduce the number of files opened at once?
If that does not solve the problem, can you try to merge the files in smaller batch to discover if the problem is related to specific files (i.e. being corrupted) or with hadd opening some set of files.
(i.e. one possibility to track this down is to remove files from the command line until it works again and then try with just the failing files).
For reference, I just merged 4000 arbitrary files without any problems. So either we fixed in the problem in the master or the problem is related to the files you are using.