# Strange gfortran / MPI problem on MacBook

**URL:** <https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181>\
**Category:** Help\
**Created:** [July 19, 2023, 2:54pm UTC](https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181 "2023-07-19T14:54:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rdryne](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@rdryne](https://fortran-lang.discourse.group/u/rdryne)\
**Post date:** [July 19, 2023, 2:54pm UTC](https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181/1 "2023-07-19T14:54:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![everythingfunctional](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/everythingfunctional/32/176_2.png) [@everythingfunctional](https://fortran-lang.discourse.group/u/everythingfunctional)\
**Post date:** [July 19, 2023, 3:20pm UTC](https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181/2 "2023-07-19T15:20:46Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Walt](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/walt/32/2465_2.png) [@Walt](https://fortran-lang.discourse.group/u/Walt)\
**Post date:** [July 19, 2023, 3:33pm UTC](https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181/3 "2023-07-19T15:33:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rdryne](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@rdryne](https://fortran-lang.discourse.group/u/rdryne)\
**Post date:** [July 20, 2023, 4:02pm UTC](https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181/4 "2023-07-20T16:02:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![msz59](https://avatars.discourse-cdn.com/v4/letter/m/3d9bf3/32.png) [@msz59](https://fortran-lang.discourse.group/u/msz59)\
**Post date:** [July 24, 2023, 8:49pm UTC](https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181/5 "2023-07-24T20:49:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![certik](https://yyz2.discourse-cdn.com/free1/user_avatar/fortran-lang.discourse.group/certik/32/4_2.png) [@certik](https://fortran-lang.discourse.group/u/certik)\
**Post date:** [July 26, 2023, 4:36pm UTC](https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181/6 "2023-07-26T16:36:47Z")

</div>

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.
