Commit b619ff51 authored by Cedric Jourdain's avatar Cedric Jourdain 🐵
Browse files

Specfem: Reorder and clean compilation script

parent 23aba6f5
#!/bin/bash #!/bin/bash
echo "==> Choose supercomputer :" echo "==> Choose supercomputer :"
echo " - occigen" echo " - occigen"
echo " - marenostrum " echo " - marenostrum "
...@@ -22,26 +21,27 @@ Untar(){ ...@@ -22,26 +21,27 @@ Untar(){
echo "==> Untar " echo "==> Untar "
#Clone the repository #Clone the repository
cd $install_dir cd $install_dir
git -c http.sslVerify=false clone https://github.com/geodynamics/specfem3d_globe.git #git -c http.sslVerify=false clone https://github.com/geodynamics/specfem3d_globe.git
cd specfem3d_globe/ cd specfem3d_globe/
# Checkout of 31 ocotbre 2017 version # Checkout of 31 ocotbre 2017 version
git checkout b1d6ba966496f269611eff8c2cf1f22bcdac2bd9 #git checkout b1d6ba966496f269611eff8c2cf1f22bcdac2bd9
# Checkout v7.0.2, last version : unstable : tested on differents architectures and all simulations failed # Checkout v7.0.2, last version : unstable : tested on differents architectures and all simulations failed
#git checkout v7.0.2 #git checkout v7.0.2
#Copy sources #Copy sources
#source_dir=$HOME/git/specfem3d_globe source_dir=$HOME/git/specfem3d_globe
#echo "Copy source" echo "Copy source"
#cp -r $source_dir $install_dir cp -r $source_dir $install_dir
cd $ueabs_dir cd $ueabs_dir
} }
Install(){ Install(){
echo "===> Configure " echo "===> Configure "
answer=0 answer=0
echo "1. Test Case A is designed to run on Tier-1 sized systems (up to around 1,000 x86 cores, or equivalent)" echo "1. small_benchmark_run_to_test_more_complex_Earth : specfem3D_globe native benchmark to validate the behaviour of the code designed to run on 24 MPI process"
echo "2. Test Case B is designed to run on Tier-0 sized systems (up to around 10,000 x86 cores, or equivalent)" echo "2. Test Case A is designed to run on Tier-1 sized systems (up to around 1,000 x86 cores, or equivalent)"
echo "3. small_benchmark_run_to_test_more_complex_Earth : specfem3D_globe native benchmark to validate the behaviour of the code designed to run on 1 or 2 node(s)" echo "3. Test Case B is designed to run on Tier-0 sized systems (up to around 10,000 x86 cores, or equivalent)"
while true while true
do do
echo "===> Choose Test Case : (1, 2, or 3)" echo "===> Choose Test Case : (1, 2, or 3)"
...@@ -49,31 +49,31 @@ Install(){ ...@@ -49,31 +49,31 @@ Install(){
if [[ $answer -eq 1 || $answer -eq 2 || $answer -eq 3 ]]; then break;fi if [[ $answer -eq 1 || $answer -eq 2 || $answer -eq 3 ]]; then break;fi
done done
if [ $answer = "1" ]; then if [ $answer = "1" ]; then
echo "===> small_benchmark_run_to_test_more_complex_Earth"
cd $install_dir/specfem3d_globe/EXAMPLES/small_benchmark_run_to_test_more_complex_Earth
sed -i "38a ./configure --enable-openmp" run_this_example.sh
echo "compilation proccess will be done directly in the job"
exit
elif [ $answer = "2" ]; then
echo "===> Copy test case A" echo "===> Copy test case A"
export install_dir=$install_dir/TestCaseA export install_dir=$install_dir/TestCaseA
mkdir -p $install_dir mkdir -p $install_dir
mv $install_dir/../specfem3d_globe $install_dir/. mv $install_dir/../specfem3d_globe $install_dir/.
cp test_cases/SPECFEM3D_TestCaseA/* $install_dir/specfem3d_globe/DATA/. cp test_cases/SPECFEM3D_TestCaseA/* $install_dir/specfem3d_globe/DATA/.
elif [ $answer = "2" ]; then elif [ $answer = "3" ]; then
echo "===> Copy test case B" echo "===> Copy test case B"
export install_dir=$install_dir/TestCaseB export install_dir=$install_dir/TestCaseB
mkdir -p $install_dir mkdir -p $install_dir
mv $install_dir/../specfem3d_globe $install_dir/. mv $install_dir/../specfem3d_globe $install_dir/.
cp test_cases/SPECFEM3D_TestCaseB/* $install_dir/specfem3d_globe/DATA/. cp test_cases/SPECFEM3D_TestCaseB/* $install_dir/specfem3d_globe/DATA/.
elif [ $answer = "3" ]; then
echo "===> small_benchmark_run_to_test_more_complex_Earth"
cd $install_dir/specfem3d_globe/EXAMPLES/small_benchmark_run_to_test_more_complex_Earth
sed -i "38a ./configure --enable-openmp" run_this_example.sh
echo "compilation proccess will be done directly in the job"
exit
fi fi
cd $install_dir/specfem3d_globe cd $install_dir/specfem3d_globe
if [ $machine = "daint-gpu" ] || [ $machine = "davide" ]; then if [ $machine = "daint-gpu" ] || [ $machine = "davide" ]; then
echo "Configure for CPU+GPU system" echo "Configure for CPU+GPU system"
### replace `use mpi` if needed ### ### replace `use mpi` if needed ###
#cd utils #cd utils
#perl replace_use_mpi_with_include_mpif_dot_h.pl #perl replace_use_mpi_with_include_mpif_dot_h.pl
#cd .. #cd ..
sed -i s/"GPU_MODE = .false."/"GPU_MODE = .true."/g $install_dir/specfem3d_globe/DATA/Par_file sed -i s/"GPU_MODE = .false."/"GPU_MODE = .true."/g $install_dir/specfem3d_globe/DATA/Par_file
if [ $machine = "daint-gpu" ];then if [ $machine = "daint-gpu" ];then
export MPI_INC=$MPICH_DIR/include export MPI_INC=$MPICH_DIR/include
...@@ -96,29 +96,29 @@ Install(){ ...@@ -96,29 +96,29 @@ Install(){
} }
Clean(){ Clean(){
if [ ! -z "$install_dir" ] && [ -d $install_dir ];then if [ ! -z "$install_dir" ] && [ -d $install_dir ];then
echo "==> Clean installation directory" echo "==> Clean installation directory"
answer=0 answer=0
while true while true
do do
echo "===> Choose Test Case to delete : (1, 2, or 3)" echo "===> Choose Test Case to delete : (1, 2, or 3)"
echo "1 : $install_dir/TestCaseA" echo "1 : Not necessary to delete this folder"
echo "2 : $install_dir/TestCaseB" echo "2 : $install_dir/TestCaseA"
echo "3 : Not necessary to delete this folder" echo "3 : $install_dir/TestCaseB"
read answer read answer
if [[ $answer -eq 1 || $answer -eq 2 || $answer -eq 3 ]]; then break;fi if [[ $answer -eq 1 || $answer -eq 2 || $answer -eq 3 ]]; then break;fi
done done
if [ $answer = "1" ]; then if [ $answer = "2" ]; then
rm -rf $install_dir/TestCaseA rm -rf $install_dir/TestCaseA
elif [ $answer = "2" ]; then elif [ $answer = "3" ]; then
rm -rf $install_dir/TestCaseB rm -rf $install_dir/TestCaseB
else else
echo "Nothing has been deleted" echo "Nothing has been deleted"
fi fi
else else
echo "Error with install_dir variable" echo "Error with install_dir variable"
exit exit
fi fi
} }
Deploy(){ Deploy(){
......
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