MPI_Finalize fails when wifi is off

I noticed this yesterday when there was a wifi outage. It’s peculiar but conistent. If the wifi is off, MPI_Finalize() fails with the message:

Abort(868846735): Fatal error in internal_Finalize: Other MPI error, error stack:
internal_Finalize(50)............: MPI_Finalize failed
MPII_Finalize(441)...............: 
MPID_Finalize(804)...............: 
MPIDI_OFI_mpi_finalize_hook(1075): 
flush_send_queue(1034)...........: 
MPIDI_OFI_handle_cq_error(788)...: OFI poll failed (default nic=utun7: Input/output error)

Here is a simple progam:

import dolfinx

print("Hello, world!")

Using mpirun, it works with the wifi on, but fails with the wifi off. For a real problem, the problem actually completes, so it’s just annoying.

I am wondering if there is a configuration problem or something. I am running on my mac laptop Apple M3 Max, macOS 15.7.3 (24G419).

It does not happen on my linux laptop.

Could you try with a pure mpi4py import or a petsc4py import, ie.

from mpi4py import MPI
from petsc4py import PETSc

to see if we can pinpoint if it is DOLFINx or a dependency?

I tried that, and it still happens with either one individually.

So then it doesn’t seem like a DOLFINx issue per say, more of an MPI/mpi4py installation issue.
How did you install DOLFINx/MPI/PETSc on your

which is confirmed by a google search of your error message which Mac, which points me to: 4.2.0rc1 with (default) ch4 on macOS hangs during MPI_Finalize() · Issue #6856 · pmodels/mpich · GitHub
which suggests changing the environment variable FI_PROVIDER=tcp (similar suggestion at: PETSc runs hang on macOS · Issue #1123 · usnistgov/fipy · GitHub)
Further relevant posts:
MPI / Pylith does not work on Macs without internet connection - #4 by baagaard - PyLith - Computational Infrastructure for Geodynamics
Strange gfortran / MPI problem on MacBook - Help - Fortran Discourse

Yes, thanks. Using the environment variable FI_PROVIDER=tcp worked. Also, it works fine with openmpi instead of mpich.

1 Like