Skip to content

MPI initialization exits ungracefully #3123

Open
@Helveg

Description

@Helveg

Describe the bug
When you run mpirun python ... and import nest built without MPI support, the following message is displayed and the process exits abruptly:

[FATAL] [2024.3.1 12:15:12 /home/robin/git/nest-simulator/nestkernel/mpi_manager.cpp:203 @ MPIManager::initialize()] : You seem to be using NEST via an MPI launcher like mpirun, mpiexec or srun although NEST was not compiled with MPI support. Please see the NEST documentation about parallel and distributed computing. Exiting.

This causes many problems associated with abrupt exits (open file handles, killed threads, ...) and in my case led to a segmentation fault because of an open MPI.recv call on another thread, which obscured the original cause of the error.

Expected behavior
NEST should raise an exception instead, and this should be propagated to the Python layer, like other NEST exceptions.

Desktop/Environment (please complete the following information):

  • OS: [e.g. iOS, Ubuntu-18.04]: WSL2
  • Shell: bash
  • Python-Version: 3.11
  • NEST-Version: nest 3.6.0-post0.dev0
  • Installation: without MPI

(PS: A collaborator of mine had the same type of ungraceful exit when NEST is built with MUSIC support, but MPI has already been initialized by another software, such as mpi4py. Could anyone do a quick double check whether this could be solved the same way?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    I: No breaking changePreviously written code will work as before, no one should note anything changing (aside the fix)S: NormalHandle this with default priorityT: DiscussionStill searching for the right way to proceed / suggestions welcomestaleAutomatic marker for inactivity, please have another look here

    Type

    No type

    Projects

    Status

    To do (open issues)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions