From a8d082597eb1ea641743272a65983f0999ee538b Mon Sep 17 00:00:00 2001 From: Johannes Hjorth <hjorth@kth.se> Date: Tue, 18 Mar 2025 11:22:53 +0100 Subject: [PATCH 1/3] feat(py-snudda): update dependency on BluePyOpt 1.14.18 --- packages/py-snudda/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/py-snudda/package.py b/packages/py-snudda/package.py index 97b72292..8d0ca3d8 100644 --- a/packages/py-snudda/package.py +++ b/packages/py-snudda/package.py @@ -24,7 +24,7 @@ class PySnudda(PythonPackage): depends_on("unzip", type=("build")) depends_on("py-setuptools", type=("build")) depends_on("py-importlib-metadata", type=("build","run")) - depends_on("py-bluepyopt@1.14.11:", type=("build","run")) + depends_on("py-bluepyopt@1.14.18:", type=("build","run")) depends_on("py-h5py@3.12.1:", type=("build","run")) depends_on("py-ipyparallel@8.4.1:", type=("build","run")) depends_on("py-matplotlib@3.8:", type=("build","run")) -- GitLab From b3e0efa7efee5e273047bf5a7016abad2a314a1f Mon Sep 17 00:00:00 2001 From: Eleni Mathioulaki <emathioulaki@athenarc.gr> Date: Tue, 18 Mar 2025 11:41:29 +0000 Subject: [PATCH 2/3] feat(py-bluepyopt): copy package from upstream --- packages/py-bluepyopt/package.py | 41 ++++++++++++++++++++++++++++ packages/py-bluepyopt/pmi_rank.patch | 17 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 packages/py-bluepyopt/package.py create mode 100644 packages/py-bluepyopt/pmi_rank.patch diff --git a/packages/py-bluepyopt/package.py b/packages/py-bluepyopt/package.py new file mode 100644 index 00000000..67cfa6b6 --- /dev/null +++ b/packages/py-bluepyopt/package.py @@ -0,0 +1,41 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.package import * + + +class PyBluepyopt(PythonPackage): + """Bluebrain Python Optimisation Library""" + + homepage = "https://github.com/BlueBrain/BluePyOpt" + pypi = "bluepyopt/bluepyopt-1.9.27.tar.gz" + + license("LGPL-3.0-only") + + # NOTE : while adding new release check pmi_rank.patch compatibility + version("1.14.11", sha256="fe2830c36699a93d2ef9ddef316da42f9c57ca6654c92356eab973ee2298ebf7") + version("1.14.4", sha256="7567fd736053250ca06030f67ad93c607b100c2b98df8dc588c26b64cb3e171c") + + # patch required to avoid hpe-mpi linked mechanism library + patch("pmi_rank.patch") + + variant("scoop", default=False, description="Use BluePyOpt together with py-scoop") + + depends_on("py-setuptools", type="build") + depends_on("py-numpy@1.6:", type=("build", "run")) + depends_on("py-pandas@0.18:", type=("build", "run")) + depends_on("py-deap@1.3.3:", type=("build", "run")) + depends_on("py-efel@2.13:", type=("build", "run")) + depends_on("py-ipyparallel", type=("build", "run")) + depends_on("py-pickleshare@0.7.3:", type=("build", "run")) + depends_on("py-jinja2@2.8:", type=("build", "run")) + depends_on("py-future", type=("build", "run")) + depends_on("py-pebble@4.6:", type=("build", "run")) + depends_on("py-scoop@0.7:", type=("build", "run"), when="+scoop") + depends_on("neuron@7.4:", type=("build", "run"), when="@:1.14.4") + depends_on("neuron@7.8:", type=("build", "run"), when="@1.14.11:") + + def setup_run_environment(self, env): + env.unset("PMI_RANK") + env.set("NEURON_INIT_MPI", "0") diff --git a/packages/py-bluepyopt/pmi_rank.patch b/packages/py-bluepyopt/pmi_rank.patch new file mode 100644 index 00000000..21a73849 --- /dev/null +++ b/packages/py-bluepyopt/pmi_rank.patch @@ -0,0 +1,17 @@ +diff --git a/bluepyopt/ephys/simulators.py b/bluepyopt/ephys/simulators.py +index e71ad8b..3c93237 100644 +--- a/bluepyopt/ephys/simulators.py ++++ b/bluepyopt/ephys/simulators.py +@@ -89,6 +89,12 @@ class NrnSimulator(object): + NrnSimulator._nrn_disable_banner() + self.banner_disabled = True + ++ # certain mpi libraries (hpe-mpt) use PMI_RANK env variable to initialize ++ # MPI before calling MPI_Init (which is undesirable). Unset this variable ++ # if exist to avoid issue with loading neuron and mechanism library. ++ if 'PMI_RANK' in os.environ: ++ os.environ.pop("PMI_RANK") ++ + import neuron # NOQA + + return neuron -- GitLab From 3a218965d70438e710232b3bf25f8c737fbc3ea0 Mon Sep 17 00:00:00 2001 From: Eleni Mathioulaki <emathioulaki@athenarc.gr> Date: Tue, 18 Mar 2025 11:42:42 +0000 Subject: [PATCH 3/3] feat(py-bluepyopt): add version 1.14.18 --- packages/py-bluepyopt/package.py | 1 + spack.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/py-bluepyopt/package.py b/packages/py-bluepyopt/package.py index 67cfa6b6..aa4e5254 100644 --- a/packages/py-bluepyopt/package.py +++ b/packages/py-bluepyopt/package.py @@ -14,6 +14,7 @@ class PyBluepyopt(PythonPackage): license("LGPL-3.0-only") # NOTE : while adding new release check pmi_rank.patch compatibility + version("1.14.18", sha256="23d6239294d944c8f9d4ea298091bcf243d236735844e1bcba60535a0f520ca8") version("1.14.11", sha256="fe2830c36699a93d2ef9ddef316da42f9c57ca6654c92356eab973ee2298ebf7") version("1.14.4", sha256="7567fd736053250ca06030f67ad93c607b100c2b98df8dc588c26b64cb3e171c") diff --git a/spack.yaml b/spack.yaml index b99a8270..809334f9 100644 --- a/spack.yaml +++ b/spack.yaml @@ -18,7 +18,7 @@ spack: - jaxsnn@10.0-a1 - py-bluepyefe@2.3.6 - py-bluepymm@0.8.7 - - py-bluepyopt@1.14.11 + - py-bluepyopt@1.14.18 - py-bsb-core@5.0.2 - py-bsb-hdf5@5.0.2 - py-bsb-yaml@4.2.2 -- GitLab