Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort NEST if run using mpirun but compiled without support for MPI #2533

Merged
merged 4 commits into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions nestkernel/mpi_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

#include "mpi_manager.h"

// C++ includes:
#include <cstdlib>

// Includes from libnestutil:
#include "stopwatch.h"
Expand Down Expand Up @@ -180,6 +182,19 @@ nest::MPIManager::init_mpi( int* argc, char** argv[] )
void
nest::MPIManager::initialize()
{
#ifndef HAVE_MPI
char* pmix_rank_set = std::getenv( "PMIX_RANK" ); // set by OpenMPI's launcher
char* pmi_rank_set = std::getenv( "PMI_RANK" ); // set by MPICH's launcher
if ( pmix_rank_set or pmi_rank_set )
{
LOG( M_FATAL,
"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." );
std::exit( 127 );
}
#endif
}

void
Expand Down