Commit f29c1546 authored by incardon's avatar incardon
Browse files

Fixing MPI installation

parent 772908fe
#!/bin/bash
# check if the directory $1/MPI exist
if [ -d "$1/MPI" ]; then
echo "MPI already installed"
exit 0
fi
rm -rf openmpi-3.1.3
rm openmpi-3.1.3.tar.gz
wget http://ppmcore.mpi-cbg.de/upload/openmpi-3.1.3.tar.gz
tar -xvf openmpi-3.1.3.tar.gz
......@@ -2,15 +2,7 @@
# check if the directory $1/MPI exist
if [ -d "$1/MPI" ]; then
echo "MPI already installed"
exit 0
fi
rm -rf openmpi-3.1.3
rm openmpi-3.1.3.tar.gz
wget http://ppmcore.mpi-cbg.de/upload/openmpi-3.1.3.tar.gz
tar -xvf openmpi-3.1.3.tar.gz
cd openmpi-3.1.3
./script/download_MPI.sh
#
# --disable-mca-dso \
......
......@@ -258,6 +258,32 @@ if haveProg mpirun; then
if [ x"$version" == x"openmpi" ]; then
# Check if we are compiling with GPU support
if [ x"$gpu_support" == x"1" ]; then
is_openmpi_cuda_aware
if [ x"$cuda_mpi_support" == x"false" ]; then
echo -e " \033[91;5;1m OpenMPI has been compiled without GPU support \033[0m"
echo -e "\033[1m OpenFPM use GPUDirect RDMA to move data from one GPU to another GPU (intranode and extranode) without moving the data on host. This feature requires that OpenMPI is compiled with CUDA support. OpenFPM can works also without this feature using GPUDirect old version (1.0). In practice it requires that MPI work with host pinned memory allocated with CUDA. This feature has been introduced with CUDA 5.0 in 2010. At best of our knowledge this feature should work without special compilation options for OpenMPI. On the other end we found several problems with GPUDirect v1.0 and Infiniband cards, when OpenMPI is not compiled with CUDA support. If you are on a super-computer or a machine you did not set-up, we suggest to re-install OpenMPI with CUDA support using the same options used to compile the one detected (option 1). Alternatively you can reinstall OpenMPI using the default options (option 2), or use the OpenMPI detected (option 3) \033[0m"
unset commands
commands[0]="Reinstall MPI and mirror the one detected"
commands[1]="Reinstall MPI, use the default arguments"
commands[2]="Continue with the detected one"
possible_solutions_no_execute "${commands[@]}"
if [ x"$possible_solutions_ret" == x"0" ]; then
get_openmpi_compilation_options
test_working_mpi_options
./script/install_MPI.sh $i_dir $ncore $gpu_support $CC $CXX $F77 $FC '"$openmpi_working_options"'
elif [ x"$possible_solutions_ret" == x"1" ]; then
./script/install_MPI.sh $i_dir $ncore $gpu_support $CC $CXX $F77 $FC
fi
fi
fi
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')
......
......@@ -13,3 +13,27 @@ function set_mpi()
}
function is_openmpi_cuda_aware()
{
output=$(ompi_info --parsable --all | grep mpi_built_with_cuda_support:value)
cuda_mpi_support=$(echo $output | sed 's/mca:mpi:base:param:mpi_built_with_cuda_support:value:\(.*\)/\1/g')
}
function get_openmpi_compilation_options()
{
output=$(ompi_info --config | grep "Configure command line:")
list=$(echo $output | sed 's/Configure command line:\(.*\)/\1/g')
arr=($list)
openmpi_compilation_options=()
for opt in ${arr[@]}; do
opt_filter=$(echo $opt | sed "s/'\(.*\)'/\1/g" )
openmpi_compilation_options+=("$opt_filter")
done
}
function test_working_mpi_options()
{
}
......@@ -66,3 +66,28 @@ function possible_solutions_no_continue {
possible_solutions_command=${commands[$possible_solutions_ret]}
}
function possible_solutions_no_execute {
if [ $sq -eq 1 ]; then
return
fi
sol=1
echo "Possible solutions:"
for com in "$@"
do
echo "$sol $com"
sol=`expr $sol + 1`
done
echo "$sol exit the script"
echo -e "\033[1;34;5mChoose the solution:\033[0m"
read choose
if [ x"$choose" = x"$sol" ]; then
exit 1
fi
possible_solutions_ret=`expr $choose - 1`
possible_solutions_command=${commands[$possible_solutions_ret]}
}
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