<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This is a known ubuntu package issue -<a href="https://urldefense.us/v3/__https://bugs.launchpad.net/ubuntu/*source/mpich/*bug/2072338__;Kys!!G_uCfscf7eWS!ZXbM8OZL3oAoMXNbRtfOkqUOlgk7AgJe6H7xvMCPY0O110T3hB1GspOKUNggP0dHHzL542tPtKrL$" id="LPlnk754194">https://bugs.launchpad.net/ubuntu/+source/mpich/+bug/2072338</a></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hui</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Jørgen Dokken via discuss <discuss@mpich.org><br>
<b>Sent:</b> Monday, September 16, 2024 2:06 AM<br>
<b>To:</b> discuss@mpich.org <discuss@mpich.org><br>
<b>Cc:</b> Jørgen Dokken <dokken@simula.no><br>
<b>Subject:</b> [mpich-discuss] Issue with MPICH + mpi4py on Ubuntu 24.04</font>
<div> </div>
</div>
<style>
<!--
#x_pfptBannersexyowo
        {display:block!important;
        visibility:visible!important;
        opacity:1!important;
        background-color:#D0D8DC!important;
        max-width:none!important;
        max-height:none!important}
-->
</style>
<div>
<div style="display:none!important; display:none; visibility:hidden; 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>
<div style="display:none!important; display:none; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; height:0px; max-height:0px; opacity:0; overflow:hidden">
ZjQcmQRYFpfptBannerStart</div>
<div dir="ltr" id="x_pfptBannersexyowo" style="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="x_pfptBannersexyowo" style="float:left!important; display:block!important; margin:0px 0px 1px 0px!important; max-width:600px!important">
<div id="x_pfptBannersexyowo" style="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="x_pfptBannersexyowo" style="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>
<div style="display:none!important; display:none; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; height:0px; max-height:0px; opacity:0; overflow:hidden">
ZjQcmQRYFpfptBannerEnd</div>
<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="x_gmail-notranslate"><code class="x_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="x_gmail-notranslate">host: 6a2e05040a65
[mpiexec@6a2e05040a65] Timeout <span class="x_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="x_gmail-pl-k">*********************</span>
      [1] proxy: 6a2e05040a65 (1 cores)
      Exec list: python3 (2 processes)<span class="x_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="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>PATH=//test-env/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>HOSTNAME=6a2e05040a65<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>TERM=xterm<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>OPENBLAS_NUM_THREADS=1<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>OPENBLAS_VERBOSE=0<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>DEB_PYTHON_INSTALL_LAYOUT=deb_system<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>DEBIAN_FRONTEND=noninteractive<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>VIRTUAL_ENV=/test-env<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>OMPI_ALLOW_RUN_AS_ROOT=1<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1<span class="x_gmail-pl-pds">'</span></span> <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>HOME=/root<span class="x_gmail-pl-pds">'</span></span> --global-user-env 0 --global-system-env 1 <span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>GFORTRAN_UNBUFFERED_PRECONNECTED=y<span class="x_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="x_gmail-pl-k">;</span> print(f<span class="x_gmail-pl-s"><span class="x_gmail-pl-pds">'</span>{MPI.COMM_WORLD.rank}/{MPI.COMM_WORLD.size}<span class="x_gmail-pl-pds">'</span></span>)<span class="x_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="x_gmail-notranslate">Best,<br></pre>
<pre class="x_gmail-notranslate">Jørgen<br></pre>
</div>
<div><br>
</div>
<div><span class="x_gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="x_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>
</div>
</body>
</html>