Commit 0083c9ef authored by Pietro Incardona's avatar Pietro Incardona

Fixing MPI detection

parent 22dba902
......@@ -5,8 +5,9 @@ All notable changes to this project will be documented in this file.
### Added
- Grid with periodic boundary conditions
- VTK Writer for distributed grid, now is the default writer
- VTK Writer for distributed vector, now is the default writer
- Installation of linear algebra packages
- More user friendly installation (No environment variables to add in your bashrc, installation report less verbose)
### Fixed
- GPU compilation
......
......@@ -184,7 +184,7 @@ fi
if [ x"$MPI_valid" == x"yes" ]; then
configure_options="$configure_options CXX=mpic++ "
else
./script/install_MPI.sh $i_dir
./script/install_MPI.sh $i_dir $ncore
fi
### MPI compilers must be in your PATH folder
......
......@@ -216,25 +216,69 @@ command -v mpirun >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "No MPI"
else
major=$(mpirun --version 2>&1 | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
middle=$(mpirun --version 2>&1 | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
minor=$(mpirun --version 2>&1 | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/g')
if [ $major -gt 1 ]; then
echo -e "mpirun $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
MPI_valid=yes
elif [ $major -lt 1 ]; then
echo -e "mpirun $major.$middle.$minor \033[33;5;1m WARNING \033[0m is too old, 1.8.1 at least required, (Automatic fix activated)"
elif [ $middle -gt 8 ]; then
echo -e "mpirun $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
MPI_valid=yes
elif [ $middle -lt 8 ]; then
echo -e "mpirun $major.$middle.$minor \033[33;5;1m WARNING \033[0m is too old, 1.8.1 at least required (Automatic fix activated)"
elif [ $minor -gt 0 ]; then
echo -e "mpirun $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
MPI_valid=yes
# Here we check if we are running openmpi mpich or unknown
version=$(mpirun --version 2>&1 | grep mpirun | sed 's/.*Open MPI.*/openmpi/g')
if [ x"$version" == x"" ]; then
version=$(mpirun --version 2>&1 | grep HYDRA | sed 's/HYDRA.*/mpich/g')
fi
if [ x"$version" == x"openmpi" ]; then
major=$(mpirun --version 2>&1 | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
middle=$(mpirun --version 2>&1 | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
minor=$(mpirun --version 2>&1 | grep mpirun | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\3/g')
if [ $major -gt 1 ]; then
echo -e "openmpi $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
MPI_valid=yes
elif [ $major -lt 1 ]; then
echo -e "openmpi $major.$middle.$minor \033[33;5;1m WARNING \033[0m is too old, 1.8.1 at least required, (Automatic fix activated)"
elif [ $middle -gt 8 ]; then
echo -e "openmpi $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
MPI_valid=yes
elif [ $middle -lt 8 ]; then
echo -e "opnmpi $major.$middle.$minor \033[33;5;1m WARNING \033[0m is too old, 1.8.1 at least required (Automatic fix activated)"
elif [ $minor -gt 0 ]; then
echo -e "openmpi $major.$middle.$minor \033[92;1m SUCCESS \033[0m"
MPI_valid=yes
else
echo -e "openmpi $major.$middle.$minor \033[33;5;1m WARNING \033[0m is too old, 1.8.1 at least required, (Automatic fix activated)"
fi
elif [ x"$version" == x"mpich" ]; then
major=$(mpirun --version 2>&1 | grep Version | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1/g')
middle=$(mpirun --version 2>&1 | grep Version | sed 's/.*\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\2/g')
if [ $major -gt 3 ]; then
echo -e "mpich $major.$middle \033[92;1m SUCCESS \033[0m"
MPI_valid=yes
elif [ $major -lt 3 ]; then
echo -e "mpich $major.$middle \033[33;5;1m WARNING \033[0m is too old, 3.2 at least required, (Automatic fix activated)"
elif [ $middle -gt 1 ]; then
echo -e "mpich $major.$middle \033[92;1m SUCCESS \033[0m"
MPI_valid=yes
elif [ $middle -lt 1 ]; then
echo -e "mpich $major.$middle \033[33;5;1m WARNING \033[0m is too old, 3.2 at least required (Automatic fix activated)"
else
echo -e "mpich $major.$middle \033[33;5;1m WARNING \033[0m is too old, 3.2 at least required, (Automatic fix activated)"
fi
else
echo -e "mpirun $major.$middle.$minor \033[33;5;1m WARNING \033[0m is too old, 1.8.1 at least required, (Automatic fix activated)"
fi
#### Unkown version of MPI print a warning
echo -e "\033[43;30;1;5mWARNING: \033[0m Found an unkown version of MPI, OpenFPM work with any MPI version that implement MPI-3.0 interface. If you know that the installed MPI implement the MPI-3.0 interface choose 1) continue. If you are not sure, or you do not even know what this message mean choose 2) install OpenMPI"
echo "1) Continue"
echo "2) Install OpenMPI"
choose=1
if [ $sq -eq 0 ]; then
read choose
fi
if [ $choose -eq 1 ]; then
MPI_valid=yes
fi
fi
fi
if [ x"$MPI_valid" == x"yes" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment