From bce79688099c628c2fa7f2c2b5706d4de39ea5ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Fri, 17 Oct 2025 20:29:12 +0200 Subject: [PATCH] Use ESPResSo 5.0-dev with all bugfixes --- .github/workflows/samples.yml | 6 ++- .github/workflows/testsuite.yml | 6 ++- maintainer/configure_venv.py | 65 --------------------------------- 3 files changed, 8 insertions(+), 69 deletions(-) diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index c1e4b05..cb5d6d9 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -21,7 +21,7 @@ jobs: - version: "4.2.2" eessi: ESPResSo/4.2.2-foss-2023a - version: "5.0-dev" - eessi: ESPResSo/8aa60cecd56cdd10ab62042c567552f347374f36-foss-2023b + eessi: ESPResSo/dc87ede3f6c218bb71624460752bc8c26a271c33-foss-2023b name: ubuntu - ESPResSo ${{ matrix.espresso.version }} steps: - name: Setup EESSI @@ -37,7 +37,9 @@ jobs: ${{ matrix.espresso.eessi }} - name: Run testsuite run: | + export NUM_PROC=$(nproc) + export OMP_PROC_BIND=false OMP_NUM_THREADS=1 module restore pymbe source venv/bin/activate - make functional_tests -j4 + make functional_tests -j${NUM_PROC} shell: bash diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index 6651471..563af5c 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -21,7 +21,7 @@ jobs: eessi: ESPResSo/4.2.2-foss-2023a upload_artifact: true - version: "5.0-dev" - eessi: ESPResSo/8aa60cecd56cdd10ab62042c567552f347374f36-foss-2023b + eessi: ESPResSo/dc87ede3f6c218bb71624460752bc8c26a271c33-foss-2023b upload_artifact: false name: ubuntu - ESPResSo ${{ matrix.espresso.version }} steps: @@ -46,10 +46,12 @@ jobs: coverage==7.4.4 - name: Run testsuite run: | + export NUM_PROC=$(nproc) + export OMP_PROC_BIND=false OMP_NUM_THREADS=1 module restore pymbe source venv/bin/activate make pylint - make unit_tests -j4 COVERAGE=1 + make unit_tests -j${NUM_PROC} COVERAGE=1 make docs make coverage_xml shell: bash diff --git a/maintainer/configure_venv.py b/maintainer/configure_venv.py index d5a238f..78641cf 100644 --- a/maintainer/configure_venv.py +++ b/maintainer/configure_venv.py @@ -19,7 +19,6 @@ import os import sys -import stat import enum import argparse import sysconfig @@ -84,67 +83,3 @@ def detect_py_virtual_environment(): if not espressomd_found: make_pth("espresso", os.path.join(args.espresso_path, "src", "python")) make_pth("pymbe", os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) - - -def make_venv_set_omp(name, value): - return f""" -_OLD_VIRTUAL_{name}="${name}" -if test -z "${name}"; then - export {name}={value} -fi""" - - -def make_venv_unset_env(name): - return f""" if [ -n "${{_OLD_VIRTUAL_{name}:-}}" ] ; then - {name}="${{_OLD_VIRTUAL_{name}:-}}" - export {name} - unset _OLD_VIRTUAL_{name} - fi""" - - -if virtual_env_family == PyVirtualEnv.venv: - venv_activate = os.path.join(os.environ.get("VIRTUAL_ENV"), "bin", "activate") - if os.path.isfile(venv_activate): - original_access_mode = os.stat(venv_activate).st_mode - os.chmod(venv_activate, original_access_mode | stat.S_IWUSR) - try: - with open(venv_activate, "r+") as f: - content = f.read() - token = "\nexport PATH" - assert token in content - content = content.replace(token, f"{token}\n{make_venv_set_omp('OMP_PROC_BIND', 'false')}\n{make_venv_set_omp('OMP_NUM_THREADS', '1')}") - token = "unset _OLD_VIRTUAL_PATH\n fi" - assert token in content - content = content.replace(token, f"{token}\n{make_venv_unset_env('OMP_PROC_BIND')}\n{make_venv_unset_env('OMP_NUM_THREADS')}""") - f.seek(0) - f.truncate() - f.write(content) - except: - raise - finally: - os.chmod(venv_activate, original_access_mode) - -elif virtual_env_family == PyVirtualEnv.conda: - try: - import conda.cli.main_env_vars - except ImportError as err: - raise RuntimeError('Cannot set up environment variables in this conda environment; consider executing `conda install conda`') from err - import contextlib - import argparse - import io - parser = argparse.ArgumentParser() - args = argparse.Namespace(json=False) - buf = io.StringIO() - with contextlib.redirect_stdout(buf): - conda.cli.main_env_vars.execute_list(args, parser) - env = {} - for line in buf.getvalue().split("\n"): - if line.strip() not in ["0", ""]: - key, value = line.split("=", 1) - env[key.strip()] = value.strip() - args.vars = [] - if "OMP_PROC_BIND" not in env: - args.vars.append("OMP_PROC_BIND = false") - if "OMP_NUM_THREADS" not in env: - args.vars.append("OMP_NUM_THREADS = 1") - conda.cli.main_env_vars.execute_set(args, parser)