MPI executable dies with error: "hfi_userinit: mmap of status page ..."

Problem

An MPI executable dies with these error messages

hfi_userinit: mmap of status page (dabbad0008050000) failed: Operation not permitted
hfp_gen1_context_open: hfi_userinit: failed, trying again (1/3)
[...]

Solution

According to https://github.com/intel/opa-psm2/issues/29 a work around is to add -Wl,-z,noexecstack during the link step.

Alternatively, one can force this execute bit off in an existing executable with execstack:

execstack -c a.out