<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBannersexyowo { all: revert !important; display: block !important; 
    visibility: visible !important; opacity: 1 !important; 
    background-color: #D0D8DC !important; 
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButtonsexyowo:hover, .pfptPrimaryButtonsexyowo:focus {
    background-color: #b4c1c7 !important; }
  .pfptPrimaryButtonsexyowo:active {
    background-color: #90a4ae !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
When trying to install MPICH from the apt repository on Ubuntu 24. 04 and then installing mpi4py with pip, I get a non-functional installation of mpi4py. It does not happen if I use openmpi, or downgrade to Ubuntu 22. 04. It has been tested with</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" ><tr><td>
    <table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
        <tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
          This Message Is From an External Sender
        </td></tr>
        <tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
          This message came from outside your organization.
        </td></tr>

      </table>

    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr"  id="pfptBannersexyowo" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D0D8DC !important; background-color: #D0D8DC; border-top: 4px solid #90a4ae !important; border-top: 4px solid #90a4ae;">
    <div id="pfptBannersexyowo" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
      <div id="pfptBannersexyowo" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
        This Message Is From an External Sender
      </div>
      <div id="pfptBannersexyowo" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
This message came from outside your organization.
      </div>

    </div>

    <div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
  </div>
<![endif]>

<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<div dir="ltr"><div>When trying to install MPICH from the apt repository on Ubuntu 24.04 and then installing mpi4py with pip, I get a non-functional installation of mpi4py. It does not happen if I use openmpi, or downgrade to Ubuntu 22.04.<br></div><div><br></div><div>It has been tested with the same MPICH on other systems (See: <a href="https://urldefense.us/v3/__https://github.com/mpi4py/mpi4py/issues/547__;!!G_uCfscf7eWS!cPoueuWR7fxw1e0Sea_FpPwE69LSB-4AL5z_w7BTkhgE477ScU4TJA4tOTBUI_OpT980NxbAga-iHw$">https://github.com/mpi4py/mpi4py/issues/547</a>) for where it has been tested, leading one to believe that something is wrong with the ubuntu build.<br><br></div><div>Minimal reproducible dockerfile:<br>```</div><div><pre lang="docker" class="gmail-notranslate"><code class="gmail-notranslate">FROM ubuntu:24.04

ARG MPI="mpich"
ENV OPENBLAS_NUM_THREADS=1 \
    OPENBLAS_VERBOSE=0
ENV DEB_PYTHON_INSTALL_LAYOUT=deb_system
ENV DEBIAN_FRONTEND=noninteractive


WORKDIR /tmp

RUN apt-get -qq update && \
    apt-get -yq  upgrade && \
    apt-get -y install \
    lib${MPI}-dev \
    python3-dev \
    python3-pip \
    python3-setuptools \
    python3-venv && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

ENV VIRTUAL_ENV=/test-env
ENV PATH=/${VIRTUAL_ENV}/bin:$PATH
RUN python3 -m venv ${VIRTUAL_ENV}

# Install Python packages (via pip)
RUN python3 -m pip install --no-cache-dir mpi4py -v

ENV OMPI_ALLOW_RUN_AS_ROOT=1 \
    OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

CMD ["mpiexec", "-v", "--np", "2", "python3", "-c", "from mpi4py import MPI; print(f'{MPI.COMM_WORLD.rank}/{MPI.COMM_WORLD.size}')"]</code></pre></div><div>```<br></div><div>with the output</div><div><br></div><div>```</div><div><pre class="gmail-notranslate">host: 6a2e05040a65
[mpiexec@6a2e05040a65] Timeout <span class="gmail-pl-c1">set</span> to -1 (-1 means infinite)

==================================================================================================
mpiexec options:
----------------
  Base path: /usr/bin/
  Launcher: (null)
  Debug level: 1
  Enable X: -1

  Global environment:
  -------------------
    PATH=//test-env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    HOSTNAME=6a2e05040a65
    TERM=xterm
    OPENBLAS_NUM_THREADS=1
    OPENBLAS_VERBOSE=0
    DEB_PYTHON_INSTALL_LAYOUT=deb_system
    DEBIAN_FRONTEND=noninteractive
    VIRTUAL_ENV=/test-env
    OMPI_ALLOW_RUN_AS_ROOT=1
    OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
    HOME=/root

  Hydra internal environment:
  ---------------------------
    GFORTRAN_UNBUFFERED_PRECONNECTED=y


    Proxy information:
    <span class="gmail-pl-k">*********************</span>
      [1] proxy: 6a2e05040a65 (1 cores)
      Exec list: python3 (2 processes)<span class="gmail-pl-k">;</span> 


==================================================================================================


Proxy launch args: /usr/bin/hydra_pmi_proxy --control-port 6a2e05040a65:36819 --debug --rmk user --launcher ssh --demux poll --pgid 0 --retries 10 --usize -2 --pmi-port 0 --gpus-per-proc -2 --gpu-subdevs-per-proc -2 --proxy-id 

Arguments being passed to proxy 0:
--version 4.2.0 --iface-ip-env-name MPIR_CVAR_CH3_INTERFACE_HOSTNAME --hostname 6a2e05040a65 --global-core-map 0,1,1 --pmi-id-map 0,0 --global-process-count 2 --auto-cleanup 1 --pmi-kvsname kvs_1_0_1589598326_6a2e05040a65 --pmi-process-mapping (vector,(0,1,2)) --global-inherited-env 11 <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>PATH=//test-env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>HOSTNAME=6a2e05040a65<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>TERM=xterm<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>OPENBLAS_NUM_THREADS=1<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>OPENBLAS_VERBOSE=0<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>DEB_PYTHON_INSTALL_LAYOUT=deb_system<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>DEBIAN_FRONTEND=noninteractive<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>VIRTUAL_ENV=/test-env<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>OMPI_ALLOW_RUN_AS_ROOT=1<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1<span class="gmail-pl-pds">'</span></span> <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>HOME=/root<span class="gmail-pl-pds">'</span></span> --global-user-env 0 --global-system-env 1 <span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>GFORTRAN_UNBUFFERED_PRECONNECTED=y<span class="gmail-pl-pds">'</span></span> --proxy-core-count 1 --exec --exec-appnum 0 --exec-proc-count 2 --exec-local-env 0 --exec-wdir /tmp --exec-args 3 python3 -c from mpi4py import MPI<span class="gmail-pl-k">;</span> print(f<span class="gmail-pl-s"><span class="gmail-pl-pds">'</span>{MPI.COMM_WORLD.rank}/{MPI.COMM_WORLD.size}<span class="gmail-pl-pds">'</span></span>)<span class="gmail-pl-k">;</span> 

[mpiexec@6a2e05040a65] Launch arguments: /usr/bin/hydra_pmi_proxy --control-port 6a2e05040a65:36819 --debug --rmk user --launcher ssh --demux poll --pgid 0 --retries 10 --usize -2 --pmi-port 0 --gpus-per-proc -2 --gpu-subdevs-per-proc -2 --proxy-id 0 
[proxy:0@6a2e05040a65] Sending upstream hdr.cmd = CMD_PID_LIST
[proxy:0@6a2e05040a65] Sending upstream hdr.cmd = CMD_STDOUT
[proxy:0@6a2e05040a65] Sending upstream hdr.cmd = CMD_STDOUT
0/1
0/1
[proxy:0@6a2e05040a65] Sending upstream hdr.cmd = CMD_EXIT_STATUS<br>```<br><br></pre><pre class="gmail-notranslate">Best,<br></pre><pre class="gmail-notranslate">Jørgen<br></pre></div><div><br></div><div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><b>Jørgen S. Dokken, </b>PhD<br></div><div><span>Senior</span> <span>Research</span> <span>Engineer</span></div><div>Simula <span>Research</span> Laboratory</div><div>+47 45286467</div></div></div></div></div></div>