From 8cffd7a514b9403c64066eda159e11a9c73f5a1c Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Thu, 18 Jul 2024 13:25:26 -0400 Subject: [PATCH 1/3] Allow dynamic loading of slurm_conf on Anvil. --- hoomd/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hoomd/__init__.py b/hoomd/__init__.py index 614533c9f6..345701beaf 100644 --- a/hoomd/__init__.py +++ b/hoomd/__init__.py @@ -42,6 +42,10 @@ import os import signal +# Work around /usr/lib64/slurm/auth_munge.so: undefined symbol: slurm_conf error on +# Purdue Anvil. +sys.setdlopenflags(os.RTLD_NOW | os.RTLD_GLOBAL) + if ((pathlib.Path(__file__).parent / 'CMakeLists.txt').exists() and 'SPHINX' not in os.environ): print("It appears that hoomd is being imported from the source directory:") From 66560d7a7ac89b0e4e78dd12aa8e8a85dda8d2be Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Fri, 19 Jul 2024 14:24:06 -0400 Subject: [PATCH 2/3] Apply workaround only on anvil. --- hoomd/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hoomd/__init__.py b/hoomd/__init__.py index 345701beaf..f1e29a9d07 100644 --- a/hoomd/__init__.py +++ b/hoomd/__init__.py @@ -44,7 +44,8 @@ # Work around /usr/lib64/slurm/auth_munge.so: undefined symbol: slurm_conf error on # Purdue Anvil. -sys.setdlopenflags(os.RTLD_NOW | os.RTLD_GLOBAL) +if os.environ.get('RCAC_CLUSTER') == 'anvil': + sys.setdlopenflags(os.RTLD_NOW | os.RTLD_GLOBAL) if ((pathlib.Path(__file__).parent / 'CMakeLists.txt').exists() and 'SPHINX' not in os.environ): From f09eab745a5c29dff7e2569c55241e5c5185a010 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Fri, 19 Jul 2024 14:31:29 -0400 Subject: [PATCH 3/3] Fix flake8 error. --- hoomd/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hoomd/__init__.py b/hoomd/__init__.py index f1e29a9d07..4957c6a62f 100644 --- a/hoomd/__init__.py +++ b/hoomd/__init__.py @@ -42,8 +42,8 @@ import os import signal -# Work around /usr/lib64/slurm/auth_munge.so: undefined symbol: slurm_conf error on -# Purdue Anvil. +# Work around /usr/lib64/slurm/auth_munge.so: undefined symbol: slurm_conf +# error on Purdue Anvil. if os.environ.get('RCAC_CLUSTER') == 'anvil': sys.setdlopenflags(os.RTLD_NOW | os.RTLD_GLOBAL)