Coder Social home page Coder Social logo

Comments (3)

pcanal avatar pcanal commented on May 22, 2024

This is a reproducer:

#include "TTree.h"
#include "TBufferFile.h"

void bulkmem() {
   TTree t("t","t");
   int i = 3;
   t.Branch("fAlpha",&i);
   for(i = 0; i < 100000; ++i)
      t.Fill();

   t.Print("");

   TBufferFile buf(TBuffer::EMode::kWrite, 32*1024);
   auto &r = t.GetBranch("fAlpha")->GetBulkRead();

   int iteration = 0;
   Long64_t events = t.GetEntries();
   while (events) {
      auto s = r.GetBulkEntries(0, buf);
      events -= s;
      fprintf(stderr, "#%d %lld events left %d\n", iteration, events, (int)s);
      ++iteration;
      if (iteration > 2)
         break;
   }
}

where the 2nd iteration (and subsequent) have GetBulkEntries returning 0;

Inadvertently this shows that the TBasket are being dropped (and hence data is lost since it is not backed by a file) after the first use (i.e. the loop is not advancing). This is a fatal problem but might not have been the original problem.

from root.

pcanal avatar pcanal commented on May 22, 2024

With

#include "TTree.h"
#include "TBufferFile.h"

void bulkmem() {
   TTree t("t","t");
   int i = 3;
   t.Branch("fAlpha",&i);
   for(i = 0; i < 100000; ++i)
      t.Fill();

   t.Print("");

   TBufferFile buf(TBuffer::EMode::kWrite, 32*1024);
   auto &r = t.GetBranch("fAlpha")->GetBulkRead();

   int iteration = 0;
   Long64_t nentries = t.GetEntries();
   Long64_t event_idx = 0;
   while (nentries) {
      auto s = r.GetBulkEntries(event_idx, buf);
      nentries -= s;
      event_idx += s;
      fprintf(stderr, "#%d %lld events left %d\n", iteration, nentries, (int)s);
      ++iteration;
      if (iteration > 2)
         break;
   }
}

I get

Fatal: fExtraBasket == nullptr && "fExtraBasket should have been set to nullptr by GetFreshBasket" violated at line 1475 of `/Users/pcanal/root_working/code/rootcling/tree/tree/src/TBranch.cxx'

from root.

pcanal avatar pcanal commented on May 22, 2024

It turns out that #6416 and this issue have the same original cause (not being able to handle basket that are not stored (on their own) in the file).

from root.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.