aragilar / pytest-mpi

Pytest plugin for working with MPI
https://pytest-mpi.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
19 stars 7 forks source link

Pytest hangs at a barrier if one rank hits an exception #49

Open jwallwork23 opened 3 months ago

jwallwork23 commented 3 months ago

Hi, thanks very much for your work on pytest-mpi - we've found it really useful!

I think we might have come across a bug where Pytest hangs upon reaching an MPI barrier if one of the MPI ranks hits an exception - see code snippet below. Is this a known issue? cc @stephankramer @ddundo

Minimal failing example:

from mpi4py import MPI 
import pytest

@pytest.mark.parallel(nprocs=2)
def test_mine():

    if MPI.COMM_WORLD.rank == 0:
        raise ValueError("Test")
    MPI.COMM_WORLD.barrier()  # it hangs here if there is a barrier