Commit 2982078d authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot

Merge topic 'mpi4py-not-avail' into paraview/release

fdd23770 numpy_interface: handle mpi4py not being available
Acked-by: Kitware Robot's avatarKitware Robot <>
Acked-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <>
Merge-request: !4723
parents 6470474d fdd23770
......@@ -192,8 +192,11 @@ def _global_func(impl, array, axis, controller):
if axis is None or axis == 0:
if controller is None and vtkMultiProcessController is not None:
controller = vtkMultiProcessController.GetGlobalController()
if controller and controller.IsA("vtkMPIController"):
from mpi4py import MPI
if controller and controller.IsA("vtkMPIController") and controller.GetNumberOfProcesses() > 1:
from mpi4py import MPI
except ImportError:
raise RuntimeError('MPI4Py is required to perform multi-rank operations')
comm = vtkMPI4PyCommunicator.ConvertToPython(controller.GetCommunicator())
max_dims, size = _reduce_dims(res, comm)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment