FastJet: add optional patch to make random generator thread-local (#21395)

This commit is contained in:
iarspider 2021-02-01 20:18:04 +01:00 committed by GitHub
parent b597cbe1c0
commit eac95c866a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,22 @@
--- include/fastjet/GhostedAreaSpec.hh.orig 2020-06-03 13:15:12.952183980 +0200
+++ include/fastjet/GhostedAreaSpec.hh 2020-06-03 13:16:00.676275264 +0200
@@ -232,7 +232,7 @@
std::vector<int> _random_checkpoint;
- static BasicRandom<double> _random_generator;
+ thread_local static BasicRandom<double> _random_generator;
//mutable BasicRandom<double> _random_generator;
static LimitedWarning _warn_fj2_placement_deprecated;
--- src/GhostedAreaSpec.cc.orig 2020-06-04 11:37:41.196758510 +0200
+++ src/GhostedAreaSpec.cc 2020-06-04 11:38:07.499240761 +0200
@@ -37,7 +37,7 @@
FASTJET_BEGIN_NAMESPACE // defined in fastjet/internal/base.hh
-BasicRandom<double> GhostedAreaSpec::_random_generator;
+thread_local BasicRandom<double> GhostedAreaSpec::_random_generator;
LimitedWarning GhostedAreaSpec::_warn_fj2_placement_deprecated;
/// explicit constructor

View file

@ -52,6 +52,9 @@ class Fastjet(AutotoolsPackage):
variant('shared', default=True, description='Builds a shared version of the library') variant('shared', default=True, description='Builds a shared version of the library')
variant('auto-ptr', default=False, description='Use auto_ptr') variant('auto-ptr', default=False, description='Use auto_ptr')
variant('atlas', default=False, description='Patch to make random generator thread_local')
patch('atlas.patch', when='+atlas')
def configure_args(self): def configure_args(self):
extra_args = ["--enable-allplugins"] extra_args = ["--enable-allplugins"]