# RDataFrame.Range() does not work with multi-thread

**URL:** <https://root-forum.cern.ch/t/rdataframe-range-does-not-work-with-multi-thread/40466>\
**Category:** ROOT\
**Tags:** rdataframe\
**Created:** [July 16, 2020, 11:05am UTC](https://root-forum.cern.ch/t/rdataframe-range-does-not-work-with-multi-thread/40466 "2020-07-16T11:05:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryliu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jerryliu/32/16786_2.png) [@jerryliu](https://root-forum.cern.ch/u/jerryliu)\
**Post date:** [July 16, 2020, 11:05am UTC](https://root-forum.cern.ch/t/rdataframe-range-does-not-work-with-multi-thread/40466/1 "2020-07-16T11:05:15Z")

</div>

Hi All,  
I try to run the code with multi-thread and limited range.  
but it fails and gives me error.  
Here I provide a simple code which can reproduce the error for me.

```auto
// Run on lxplus7
// ensure EnableImplicitMT() works
source /cvmfs/sft.cern.ch/lcg/app/releases/ROOT/6.20.04/x86_64-centos7-gcc48-opt/bin/thisroot.sh
root -l
> ROOT::EnableImplicitMT();
> using namespace ROOT;
> RDataFrame d(0);
> d.Range(0); // error
......: Range was called with ImplicitMT enabled, but multi-thread is not supported.

```

by the way, if I use the default ROOT version on lxplus, EnableImplicitMT() does not work  
and say I have to build it with some options.  
after I run the thisroot.sh, it works for most of cases.  
what’s the difference them? even if I use the same version, I still need to run the source command.

Best Regards,  
Shu-Xiao Liu

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 16, 2020, 11:37am UTC](https://root-forum.cern.ch/t/rdataframe-range-does-not-work-with-multi-thread/40466/2 "2020-07-16T11:37:51Z")

</div>

Hi @jerryliu,  
as the error message says, `Range` is not available when running on multiple threads. Also see [the docs](https://root.cern.ch/doc/master/classROOT_1_1RDF_1_1RInterface.html#a0bdb904ad92dc91edd64b225b4e8a5a5).

The default ROOT version available on lxplus has not been built with imt=ON, so multi-threading is not available. On lxplus, I would suggest to use one of the ROOT versions available with LCG views, e.g.

```auto
source /cvmfs/sft.cern.ch/lcg/views/LCG_97/x86_64-centos7-gcc8-opt/setup.sh

```

Cheers,  
Enrico

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 16, 2020, 12:34pm UTC](https://root-forum.cern.ch/t/rdataframe-range-does-not-work-with-multi-thread/40466/3 "2020-07-16T12:34:59Z")

</div>

(btw thanks for the report, I updated [https://root.cern/install/#run-on-cern-lxplus](https://root.cern/install/#run-on-cern-lxplus) )

---

<div class="post-metadata">

**Author:** ![jerryliu](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/jerryliu/32/16786_2.png) [@jerryliu](https://root-forum.cern.ch/u/jerryliu)\
**Post date:** [July 17, 2020, 3:57am UTC](https://root-forum.cern.ch/t/rdataframe-range-does-not-work-with-multi-thread/40466/4 "2020-07-17T03:57:59Z")

</div>

can you update the lcg link?

> To check what ROOT version is contained in an LCG release, check [lcginfo.cern.ch](https://lcginfo.cern.ch/).

change [https://lcginfo.cern.ch/](https://lcginfo.cern.ch/) to [http://lcginfo.cern.ch/](http://lcginfo.cern.ch/)  
https one doesn’t work for me.

---

<div class="post-metadata">

**Author:** ![eguiraud](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/eguiraud/32/32217_2.png) [@eguiraud](https://root-forum.cern.ch/u/eguiraud)\
**Post date:** [July 17, 2020, 7:08am UTC](https://root-forum.cern.ch/t/rdataframe-range-does-not-work-with-multi-thread/40466/5 "2020-07-17T07:08:46Z")

</div>

Ah thank you, [missed that one](https://github.com/root-project/web/pull/330)! It’s now [https://github.com/root-project/web/pull/333](https://github.com/root-project/web/pull/333) , will be merged soon.

EDIT: should be ok now

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [July 31, 2020, 7:08am UTC](https://root-forum.cern.ch/t/rdataframe-range-does-not-work-with-multi-thread/40466/6 "2020-07-31T07:08:48Z")

</div>

Closed on July 31, 2020, 7:08am UTC

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