diff --git a/Generators/PowhegControl/python/processes/powheg/ttbb.py b/Generators/PowhegControl/python/processes/powheg/ttbb.py index 747bab3b46b904641b6060789d04d9af3b36bde9..1f1f83b76578f368f3ca1bf6c0bd4f85a5a761d7 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: