-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
SetClusterPrefetch(true) breaks BulkIO with more than one basket #8962
Comments
@ktf how critical is this for ALICE? |
With the current benchmarking we have, turning it off does not seem to alter performance much, so I would say it's not critical to have it fixed by "yesterday". However it would be nice if a fix could make the 6.24.08 timeline. That said I reserve the right to bump the priority if further benchmarks show that |
Out of curiosity, will this be fixed for 6.26? |
It did not make it. I'll try to give a try .... |
Of course I meant 6.28 |
Ah ;) so the likelihood increased exponentially :) |
Read my lips, no new taxes. ;-) |
This fixes root-project#8962 The code pattern is similar to 0987896 Add infrastructure for sharing memory in a TBuffer.
This is actually still buggy and we now have a use case where not having it brings down the storage of some site, due to the excessive number of IOPS per server (50 IOPS, 720 concurrent accesses to 3 storage servers for a total of 0.2PB of data being read). Enabling this would allow us to reduce the IOPS by a factor ~5. The actual error that we get by enabling it is:
I can provide some file which has the issue, if needed. This becomes rather urgent for us now. |
Yes, please point us to one of the file with the unexpected behavior. |
By mail. |
The testcase in the description is actually wrong, it only reads starting from the first entry. A corrected / expanded version is: #include <TBufferFile.h>
#include <TFile.h>
#include <TTree.h>
#include <iostream>
#include <TKey.h>
void test() {
auto f = TFile::Open("AO2D.root");
for (auto&& keyAsObj : *f->GetListOfKeys()){
auto key = (TKey*) keyAsObj;
std::cout << key->GetName() << " " << key->GetClassName() << std::endl;
auto d = (TDirectoryFile*)f->Get(key->GetName());
if (key->GetName() == std::string("metaData")) {
continue;
}
std::cout << "Reading DF " << key->GetName() << std::endl;
char const *treeNames[] = {
"O2trackextra_001",
//"O2ambiguousfwdtr",
//"O2ambiguousmfttr",
//"O2ambiguoustrack",
//"O2bc_001",
//"O2calo",
//"O2calotrigger",
//"O2cascade_001",
//"O2collision_001",
//"O2cpvcluster",
//"O2decay3body",
//"O2fdd_001",
//"O2ft0",
//"O2fv0a",
//"O2fwdtrack",
//"O2fwdtrackcov",
//"O2fwdtrkcl",
//"O2hmpid_001",
//"O2mccalolabel_001",
//"O2mccollision",
//"O2mccollisionlabel",
//"O2mcfwdtracklabel",
//"O2mcmfttracklabel",
//"O2mcparticle_001",
//"O2mctracklabel",
//"O2mfttrack_001",
//"O2origin",
//"O2track_iu",
//"O2trackcov_iu",
//"O2tracked3body",
//"O2trackedcascade",
//"O2trackedv0",
//"O2trackqa",
//"O2v0_002",
//"O2zdc_001",
};
for (auto ti = 0; ti < sizeof(treeNames)/sizeof(void*); ti++) {
std::cout << ti << std::endl;
std::cout << " " << treeNames[ti] << std::endl;
auto t = (TTree*)d->Get(treeNames[ti]);
std::cout << t << std::endl;
if (t == nullptr) {
std::cout << "Missing branch." << treeNames[ti] << std::endl;
}
t->SetCacheSize(25000000);
t->SetClusterPrefetch(true);
auto branchList = t->GetListOfBranches();
for (size_t bi = 0; bi < branchList->GetSize(); bi++) {
t->AddBranchToCache((TBranch*)branchList->At(bi));
}
t->StopCacheLearningPhase();
static TBufferFile buf(TBuffer::EMode::kWrite, 4*1024*1024);
for (auto bi = 0; bi < branchList->GetEntries(); ++bi) {
auto b = (TBranch*)branchList->At(bi);
auto e = t->GetEntries();
assert(b);
int pos = 0;
while (pos < e) {
//b->Print();
buf.Reset();
auto &r = b->GetBulkRead();
auto s = r.GetBulkEntries(pos, buf);
pos += s;
std::cout << " " << b->GetName() << ": " << s << " elements read." << std::endl;
if (s == -1) {
break;
}
}
std::cout << " " << b->GetName() << ": " << pos << " total." << std::endl;
b->SetStatus(false);
b->DropBaskets("all");
b->Reset();
b->GetTransientBuffer(0)->Expand(0);
}
}
break;
}
} |
Describe the bug
Doing:
crashes with:
if one of the branches has more than one basket. Removing
t->SetClusterPrefetch(true)
fixes the issue. Notice how it still works fine with branches which have only one basket. I can provide a file to reproduce if needed.Expected behavior
I would expect it to work.
Setup
Vanilla 6.24.02 on linux or macOS.
The text was updated successfully, but these errors were encountered: