diff --git a/doc/user_guides/ensembles.rst b/doc/user_guides/ensembles.rst index 72917c51..ff364441 100644 --- a/doc/user_guides/ensembles.rst +++ b/doc/user_guides/ensembles.rst @@ -366,6 +366,28 @@ components within each running ensemble instance: (assuming one core per MPI process). For example, two concurrent four-process tasks need a budget of at least eight cores per instance. +.. note:: + + IPS tasks that call python scripts that use ``mpi4py`` must ensure that ``mpi4py`` package in your + environment is linked to OpenMPI, not MPICH or another MPI + implementation. An ``mpi4py`` package + linked to MPICH can cause every process launched by an IPS component to + report rank 0 in an ``MPI.COMM_WORLD`` of size 1 even though the user + requested multiple ranks. + + If you encounter this symptom, check the library loaded by the Python + environment used for the task: + + .. code-block:: bash + + python -c 'from mpi4py import MPI; print(MPI.Get_library_version())' + + In the affected environment, rebuilding and reinstalling ``mpi4py`` from + source after loading the ``openmpi`` module and setting + ``MPICC="$(which mpicc)"`` will resolve this issue. Verify that the rebuilt + package reports Open MPI, and rerun a multi-rank task to confirm that its + communicator has the requested size and distinct ranks. + Portal ------ diff --git a/ipsframework/task_manager.py b/ipsframework/task_manager.py index 697fbe34..ae0e9cd8 100644 --- a/ipsframework/task_manager.py +++ b/ipsframework/task_manager.py @@ -453,7 +453,7 @@ def build_launch_cmd( if not mpicmd: raise Exception('Missing %s command in $PATH' % (mpi_binary)) - nproc_flag = '-np' + nproc_flag = '-n' ppn_flag = '-npernode' host_select = '-H' if mpi_binary == 'prun': @@ -483,6 +483,7 @@ def build_launch_cmd( ) if cpp: cmd += f' --map-by slot:PE={cpp}' + cmd += ' --bind-to core' elif smp_node: cmd = ' '.join([mpicmd, nproc_flag, str(nproc)]) else: