Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hadd writes files with unspecified compression algorithm #6616

Closed
eguiraud opened this issue Oct 12, 2020 · 1 comment · Fixed by #14873
Closed

hadd writes files with unspecified compression algorithm #6616

eguiraud opened this issue Oct 12, 2020 · 1 comment · Fixed by #14873
Assignees

Comments

@eguiraud
Copy link
Member

Describe the bug

The following sequence of commands shows how an output file f2.root produced via hadd has compression settings equal to 1, i.e. compression level is 1 but the compressoin algorithm is 0, which corresponds to RCompressionSetting::EAlgorithm::kUseGlobal. Unfortunately kUseGlobal does not correspond to a specific compression algorithm but it refers to the "compression setting for this process; may be affected by rootrc". In other words, a user that receives a file with compression algorithm 0 has no way to figure out what the compression algorithm actually is.

~ hadd f2.root f.root
hadd Target file: f2.root
hadd compression setting for all output: 1
hadd Source file 1: f.root
hadd Target path: f2.root:/
~ file f2.root
f2.root: ROOT file Version 62301 (Compression: 1)
~ root -l -b -q f2.root -e '_file0->GetCompressionSettings()'

Attaching file f2.root as _file0...
(TFile *) 0x55a618b47f40
(int) 1

Expected behavior

The last command above should print full compression settings with non-zero compression algorithm, e.g. 101.

To Reproduce

I think any input file can be used to reproduce the problem, but e.g. this snippet produces a file "f.root" that can be used for the reproducer above:

#include <TFile.h>
#include <TTree.h>
int main() {
   TFile f("f.root", "recreate");
   TTree t("t", "t");
   int x = 42;
   t.Branch("x", &x);
   t.Fill();
   t.Write();
   f.Close();
   return 0;
}

hadd f2.root f.root then produces a file f2.root with unspecified compression algorithm.

@eguiraud
Copy link
Member Author

Still present in current master.

@vepadulano vepadulano assigned vepadulano and unassigned pcanal and oshadura Mar 2, 2024
vepadulano added a commit that referenced this issue Mar 3, 2024
kristupaspranc pushed a commit to kristupaspranc/root that referenced this issue Apr 10, 2024
lobis pushed a commit to lobis/root that referenced this issue Apr 10, 2024
kristupaspranc pushed a commit to kristupaspranc/root that referenced this issue May 21, 2024
silverweed pushed a commit to silverweed/root that referenced this issue Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants