spack/var/spack/repos/builtin/packages/py-bluepyopt/pmi_rank.patch
Erik Heeren 7da4b3569f
py-bluepyemodel: opensourcing with dependencies (#40592)
* py-bluepyemodel: new package with dependencies

* py-morphio: add MPI as dependency to avoid failing builds

* Formatting

* py-bluepyefe: no need to set NEURON_INIT_MPI

* py-morphio: unifurcation branch is ancient history

* py-bluepyopt: only set NEURON_INIT_MPI with +neuron

* py-efel: get rid of old version

* py-morph{-tool,io}: rename develop to master to match branch

* py-bluepyefe: unset PMI_RANK is also neuron-related

* py-bluepyopt: PMI_RANK is also neuron-related

* Implement review remarks

* py-morph-tool, py-neurom: small fixes

* py-morphio: reword dependencies
2023-10-28 07:55:49 -05:00

18 lines
695 B
Diff

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