Strange gfortran / MPI problem on MacBook

I have a MacBook Pro that I got last year. I installed gfortran and MPICH using brew install gfortran mpich , and I compile parallel codes using mpif90

Recently I noticed a strange problem. When my wifi is on (even if I’m not connected to a network) it works fine. But when wifi is turned off I cannot run a job. Instead I get the following error message:

mpirun -n 2 …/mli2023.x
Abort(135910799): Fatal error in internal_Init: Other MPI error, error stack:
internal_Init(66)…: MPI_Init(argc=0x0, argv=0x0) failed
MPII_Init_thread(234)…:
MPID_Init(513)…:
MPIDI_OFI_init_local(580): OFI fi_fabric failed (ofi_init.c:580:MPIDI_OFI_init_local:Invalid argument)
Abort(135910799): Fatal error in internal_Init: Other MPI error, error stack:
internal_Init(66)…: MPI_Init(argc=0x0, argv=0x0) failed
MPII_Init_thread(234)…:
MPID_Init(513)…:
MPIDI_OFI_init_local(580): OFI fi_fabric failed (ofi_init.c:580:MPIDI_OFI_init_local:Invalid argument)

To reiterate, the only thing I need to do is turn on wifi and it works fine.

Does anyone know what might be causing this bizarre problem?

I may be mistaken on this point, but I believe most MPI implementations make use of the networking layer for communication between processes, even if they aren’t actually running in distributed memory. This allows the library to be compiled once and work in both shared and distributed use cases. Perhaps turning off the WiFi is also stopping all of the networking software stack on your machine, meaning there is no networking layer for MPI to use, and thus it fails. Mostly just a hunch, but might be somewhere to start investigating.

It’s likely without a network device enabled MacOS X doesn’t load the networking stack. I worked on OS X for years and it’s likely the case.

Thank you for these replies. I appreciate understanding what’s going on. I’ll make sure my wifi is on whenever I run a job.

It seems sort of strange. Even with WiFi off, there is still lo0 interface working, set to 127.0.0.1/localhost. One can ping it etc. so apparently some network stack must be present.

macOS also sends hashes of your binaries to Apple to check, which makes it very slow to start the first time (and of course it has privacy issues). You have to turn it off for your terminal. It might be related.

1 Like