AndreWeiner / ml-cfd-lecture

Lecture material for machine learning applied to computational fluid mechanics
GNU General Public License v3.0
330 stars 116 forks source link

OpenMPI version conflict with new container on Ubuntu 24.04 (WSL) #43

Closed JanisGeise closed 3 days ago

JanisGeise commented 1 week ago

Hi @AndreWeiner,

Issue

when executing OpenFoam inside the new Apptainer container of2406-py2.5.0-cpu.sif using WSL, an attempting parallel run leads to the error as already mentioned in #33 :

--> FOAM FATAL ERROR: (openfoam-2406)
attempt to run parallel on 1 processor

    From static bool Foam::UPstream::init(int&, char**&, bool)
    in file UPstream.C at line 286.

FOAM aborting

Versions

On the Linux native system everything works as expected without any issues, despite the different version of OpenMPI. On WSL, however, the mentioned error occurs. I assume that has something to do with the newer Ubuntu version on WSL.

Fix

This issue can be fixed by installing OpenMPI v4.1.6 by executing sudo apt install openmpi-bin, which (at the moment) installes the correct MPI version. Otherwise, the correct version can be installed following the instructions provided on the OpenMPI website.

After installation verify that the correct version is installed by executing mpirun --version, which should yield:

mpirun (Open MPI) 4.1.6

Report bugs to http://www.open-mpi.org/community/help/

Just for the record, the Basilisk container basilisk.sif using OpenMPI v1.10.2 works without any issues on both systems. We will probably encounter this issue in exercise 9 as well since drlfoam still uses the old container and OpenMPI version. I will open another issue once I checked that.

Regards, Janis