diff --git a/rustcoalescence/src/cli/simulate/parse/partitioning.rs b/rustcoalescence/src/cli/simulate/parse/partitioning.rs index 28387f622..c89a1b43f 100644 --- a/rustcoalescence/src/cli/simulate/parse/partitioning.rs +++ b/rustcoalescence/src/cli/simulate/parse/partitioning.rs @@ -12,6 +12,16 @@ pub(in super::super) fn parse_and_normalise( normalised_args.partitioning(&partitioning); + #[cfg(feature = "mpi-partitioning")] + if !matches!(&partitioning, Partitioning::Mpi(_)) { + match necsim_partitioning_mpi::MpiPartitioning::initialise() { + Ok(_) | Err(necsim_partitioning_mpi::MpiPartitioningError::AlreadyInitialised) => { + anyhow::bail!("MPI should not be used together with a non-MPI partitioning") + }, + Err(necsim_partitioning_mpi::MpiPartitioningError::NoParallelism) => (), + } + } + Ok(partitioning) }