From 3cc0c50fc14e5c455f931eb64cb9885148604597 Mon Sep 17 00:00:00 2001 From: Stefan Richter Date: Fri, 19 Jul 2019 14:27:30 +0200 Subject: [PATCH] [BUGFIX] Do not manually set new OpenLoops and loader paths for all Powheg processes, only ttbb --- .../python/processes/powheg/ttbb.py | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/Generators/PowhegControl/python/processes/powheg/ttbb.py b/Generators/PowhegControl/python/processes/powheg/ttbb.py index 747bab3b46b..1f1f83b7657 100644 --- a/Generators/PowhegControl/python/processes/powheg/ttbb.py +++ b/Generators/PowhegControl/python/processes/powheg/ttbb.py @@ -7,20 +7,26 @@ from ..external import ExternalMadSpin ## Get handle to Athena logging logger = Logging.logging.getLogger("PowhegControl") -#----------------------------------------------------------------------------------- -# Manual fix for openloops libraries path, avoiding issues when /afs not available -#----------------------------------------------------------------------------------- -import os -logger.info("Manual fixes for OpenLoops libraries paths") -logger.info("OpenLoopsPath (before) = {0}".format(os.getenv('OpenLoopsPath'))) -logger.info("LD_LIBRARY_PATH (before) = {0}".format(os.getenv('LD_LIBRARY_PATH'))) -OLPath = "/cvmfs/atlas.cern.ch/repo/sw/Generators/powheg/ATLASOTF-00-04-00/POWHEG-BOX-RES/ttbb/obj-gfortran" -os.environ['OpenLoopsPath'] = OLPath -ldpath = os.getenv('LD_LIBRARY_PATH') -ldpath_new = OLPath+ ":" + OLPath + "/proclib:" + ldpath -os.environ['LD_LIBRARY_PATH'] = ldpath_new -logger.info("OpenLoopsPath (after) = {0}".format(os.getenv('OpenLoopsPath'))) -logger.info("LD_LIBRARY_PATH (after) = {0}".format(os.getenv('LD_LIBRARY_PATH'))) + + +def _manually_set_openloops_paths(): + ''' + Manual fix for OpenLoops libraries path, avoiding issues when /afs not available + This is NOT a viable long-term solution and should be made obsolete after the migration + away from AFS is more advanced. + ''' + import os + logger.warning("Applying manual, hard-coded fixes for OpenLoops library paths") + logger.info("OpenLoopsPath (before) = {0}".format(os.getenv('OpenLoopsPath'))) + logger.info("LD_LIBRARY_PATH (before) = {0}".format(os.getenv('LD_LIBRARY_PATH'))) + OLPath = "/cvmfs/atlas.cern.ch/repo/sw/Generators/powheg/ATLASOTF-00-04-00/POWHEG-BOX-RES/ttbb/obj-gfortran" + os.environ['OpenLoopsPath'] = OLPath + ldpath = os.getenv('LD_LIBRARY_PATH') + ldpath_new = OLPath+ ":" + OLPath + "/proclib:" + ldpath + os.environ['LD_LIBRARY_PATH'] = ldpath_new + logger.info("OpenLoopsPath (after) = {0}".format(os.getenv('OpenLoopsPath'))) + logger.info("LD_LIBRARY_PATH (after) = {0}".format(os.getenv('LD_LIBRARY_PATH'))) + # Dictionary to convert the PowhegControl decay mode names to the appropriate @@ -58,6 +64,9 @@ class ttbb(PowhegRES): """ super(ttbb, self).__init__(base_directory, "ttbb", **kwargs) + # This is a hacky fix that's needed at the moment... + _manually_set_openloops_paths() + # This process' integration needs Athena to be set to run at least two parallel processes # Advise the user about this here: if self.cores < 2: -- GitLab