# MPI / Pylith does not work on Macs without internet connection

**URL:** <https://community.geodynamics.org/t/mpi-pylith-does-not-work-on-macs-without-internet-connection/3621>\
**Category:** PyLith\
**Created:** [August 29, 2024, 8:46pm UTC](https://community.geodynamics.org/t/mpi-pylith-does-not-work-on-macs-without-internet-connection/3621 "2024-08-29T20:46:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericlindsey](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@ericlindsey](https://community.geodynamics.org/u/ericlindsey)\
**Post date:** [August 29, 2024, 8:46pm UTC](https://community.geodynamics.org/t/mpi-pylith-does-not-work-on-macs-without-internet-connection/3621/1 "2024-08-29T20:46:13Z")

</div>

Hi all,

During a recent power outage here, we uncovered a surprising fact that Pylith can only run on a mac when connected to the internet. When reconnecting to the internet, it works fine!

Steps to reproduce:

(1) turn off wifi  
(2) try to run any pylith example, receive the following error:

```auto
box-2d % pylith step01_axialdisp.cfg 
Abort(941216911): Fatal error in internal_Init: Other MPI error, error stack:
internal_Init(66)........: MPI_Init(argc=0x30e02abe8, argv=0x30e02abe0) 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)
/Users/elindsey/pylith/pylith-4.1.1-macOS-10.15-x86_64/bin/nemesis: mpiexec: exit 143
/Users/elindsey/pylith/pylith-4.1.1-macOS-10.15-x86_64/bin/pylith: /Users/elindsey/pylith/pylith-4.1.1-macOS-10.15-x86_64/bin/nemesis: exit 1

```

(3) turn on wifi, run example again and it works fine!

We have reproduced this on two different M3 Pro macs, and I found a thread discussing the same error here but without resolution: [Strange gfortran / MPI problem on MacBook - Help - Fortran Discourse](https://fortran-lang.discourse.group/t/strange-gfortran-mpi-problem-on-macbook/6181)

Any ideas or suggestions?

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [August 29, 2024, 9:01pm UTC](https://community.geodynamics.org/t/mpi-pylith-does-not-work-on-macs-without-internet-connection/3621/2 "2024-08-29T21:01:00Z")

</div>

I believe a workaround is to manually set the hostname, which makes MPI happy.  
We use MPICH in the PyLith binary. There might be some options for the MPICH settings (devices) that will allow us to eliminate this issue. I will create a GitHub issue.

---

<div class="post-metadata">

**Author:** ![ericlindsey](https://avatars.discourse-cdn.com/v4/letter/e/3ec8ea/32.png) [@ericlindsey](https://community.geodynamics.org/u/ericlindsey)\
**Post date:** [August 29, 2024, 9:23pm UTC](https://community.geodynamics.org/t/mpi-pylith-does-not-work-on-macs-without-internet-connection/3621/3 "2024-08-29T21:23:18Z")

</div>

Thanks! To clarify, how did you set the hostname? I tried a few options but none seemed to affect this error.

It’s not a critical issue because normally internet is available, but one could imagine some edge cases (trying to run Pylith in the field?)

---

<div class="post-metadata">

**Author:** ![baagaard](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/baagaard/32/615_2.png) [@baagaard](https://community.geodynamics.org/u/baagaard)\
**Post date:** [November 14, 2024, 3:25pm UTC](https://community.geodynamics.org/t/mpi-pylith-does-not-work-on-macs-without-internet-connection/3621/4 "2024-11-14T15:25:18Z")

</div>

The workaround is to tell MPI to use sockets for all communication by setting the environment variable `IF_PROVIDER` to `sockets`. I will add this to the PyLith documentation. We will consider setting this in the `setup.sh` file.

```auto
export FI_PROVIDER=sockets

```
