Mix Enable/Disable ImplicitMT

ROOT Version: 6.24.06
Platform: wsl1, ubuntu20.04
Compiler: gcc9.4.0

Dear rooters,

I have a problem with mixing Multi/Single thread processing of rdataframe.

The thing is that my events are not entirely independent; I am running MC collisions simulation that considers a single collision event as a few (30 in my case) events-at-given-time, so it stacks them one-by-one into tree. It would be ok if I had a separate “timecount” column for them, but it turns out this simulation framework does not save such column.

In single thread, this is not a big deal since I can run

df = df.Define("tcount", "rdfentry_%30")

However, all other calculations except for this definition could use multithreading!

Therefore, the question arises, if it is possible to calculate that specific column in single-threat fashion. I tried a few possibilities, like

rdf = ROOT.RDataFrame(tr)

rdf = rdf.Define("tcounter", "rdfentry_%{}".format(final_time))


, but apparently this definition is being calculated at multi-threading mode anyway.

Is there any way to bypass this, without using intermediate Snapshot / Cache (I am a bit concerned regarding the full size of event TChain)?

I think @eguiraud can help you.

Hi @Silence2107 ,

single-thread/multi-thread is set at the level for the RDataFrame computation graph. Indeed the workaround I would suggest is to do a first single-thread pass that creates the tcount column and snapshots it to a new tree and then add that tree as a friend of the original one for further multi-thread processing.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.