RDataFrame::Display and EnableImplicitMT

Dear ROOT team,

Just a small thing I stumbled upon with RDataFrame::Display
in Python, consider:

import ROOT
ROOT.EnableImplicitMT()
df = ROOT.RDataFrame(100)
df = df.Define("x", "gRandom->Rndm()")
df.Display(["x"]).Print()

Which gives the error

TypeError: Template method resolution failed:
  none of the 3 overloaded methods succeeded. Full details:
  ROOT::RDF::RResultPtr<ROOT::RDF::RDisplay> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Display(initializer_list<string> columnList, int nRows = 5, unsigned long nMaxCollectionElements = 10) =>
    TypeError: could not convert argument 1
  ROOT::RDF::RResultPtr<ROOT::RDF::RDisplay> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Display(const vector<string>& columnList, int nRows = 5, unsigned long nMaxCollectionElements = 10) =>
    runtime_error: Display was called with ImplicitMT enabled, but multi-thread is not supported.
  ROOT::RDF::RResultPtr<ROOT::RDF::RDisplay> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Display(basic_string_view<char,char_traits<char> > columnNameRegexp = "", int nRows = 5, unsigned long nMaxCollectionElements = 10) =>
    TypeError: could not convert argument 1
  ROOT::RDF::RResultPtr<ROOT::RDF::RDisplay> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Display(initializer_list<string> columnList, int nRows = 5, unsigned long nMaxCollectionElements = 10) =>
    TypeError: could not convert argument 1

whereas in c++ using

void reproduce(){
    ROOT::EnableImplicitMT();
    ROOT::RDataFrame df(100);
    auto df_x = df.Define("x", [](){ return gRandom->Rndm(); });
    df_x.Display({"x"})->Print();
}

gives the error:

what():  Display was called with ImplicitMT enabled, but multi-thread is not supported.

It seems that Display is not supported in EnableImplicitMT however the error message in python or the docs don’t really tell us about it. Maybe you could mention that.

Thanks in advance!

Cheers,
Konrad

ROOT 6.26/04

Hi @helms ,

welcome to the ROOT forum and thank you very much for the feedback. Unfortunately that’s a current limitation in the error reporting of PyROOT. I agree it should report the underlying reason why it couldn’t call Display, which C++ provides as an exception message.

@etejedor FYI.

Cheers,
Enrico

To be completely fair, PyROOT does tell about the error:

 ROOT::RDF::RResultPtr<ROOT::RDF::RDisplay> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Display(const vector<string>& columnList, int nRows = 5, unsigned long nMaxCollectionElements = 10) =>
    runtime_error: Display was called with ImplicitMT enabled, but multi-thread is not supported.

but, admittedly, it is a bit hidden because PyROOT reports about all the overloads it tries.

1 Like

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