Skip to content
Snippets Groups Projects
Commit 6e4eb098 authored by Antoine Cyril David Hoffmann's avatar Antoine Cyril David Hoffmann :seedling:
Browse files

update auto installer for spcpc

parent 2eff17c6
No related branches found
No related tags found
No related merge requests found
#! /bin/bash #! /bin/bash
# This tutorial helps you install Gyacomo on an SPC medusa PC, based on OpenSUSE and intel compiler. You will be guided from the cloning of the repository to the first run. # This tutorial helps you install Gyacomo on an SPC medusa PC, based on OpenSUSE and intel compiler. You will be guided from the cloning of the repository to the first run.
# Record the start time
start=$(date +%s)
# Display title
echo '==============================================' echo '=============================================='
echo ' ______ ' echo ' ______ '
echo ' / ____/_ ______ __________ ____ ___ ____ ' echo ' / ____/_ ______ __________ ____ ___ ____ '
...@@ -13,12 +17,12 @@ echo '==============================================' ...@@ -13,12 +17,12 @@ echo '=============================================='
# 1. Prelude # 1. Prelude
# 1.1 - First, we clone the repository. # 1.1 - First, we clone the repository.
echo -- 1. Clone the directory echo "1. Clone the directory "
git clone https://gitlab.epfl.ch/ahoffman/gyacomo.git > gyacomo_clone.out git clone https://gitlab.epfl.ch/ahoffman/gyacomo.git &> gyacomo_clone.out
cd gyacomo cd gyacomo
# 1.2 - Then we purge and load the following modules (the default one may be of older intel compiler version, which will not work with FFTW3). # 1.2 - Then we purge and load the following modules (the default one may be of older intel compiler version, which will not work with FFTW3).
echo -- Purge and load the modules echo " Purge and load the modules"
module purge module purge
module load intel_comp/19.1 impi/5.0.3 mumps/4.10.0 hdf5/1.8.9 module load intel_comp/19.1 impi/5.0.3 mumps/4.10.0 hdf5/1.8.9
...@@ -26,7 +30,7 @@ module load intel_comp/19.1 impi/5.0.3 mumps/4.10.0 hdf5/1.8.9 ...@@ -26,7 +30,7 @@ module load intel_comp/19.1 impi/5.0.3 mumps/4.10.0 hdf5/1.8.9
# cd gyacomo # cd gyacomo
# 1.4 - Finally, we make a `lib` directory (here we make it in `/gyacomo` but it can be anywhere as long as the path to it is set correctly in `gyacomo/local/dirs.inc`). # 1.4 - Finally, we make a `lib` directory (here we make it in `/gyacomo` but it can be anywhere as long as the path to it is set correctly in `gyacomo/local/dirs.inc`).
echo -- make lib directory echo " make lib directory"
mkdir lib mkdir lib
# **Important:** Verify that the `gyacomo/local/dirs.inc` file points to your `gyacomo` folder in the `PREFIX` variable and to your `lib` folder in the `LIBDIR` variable. # **Important:** Verify that the `gyacomo/local/dirs.inc` file points to your `gyacomo` folder in the `PREFIX` variable and to your `lib` folder in the `LIBDIR` variable.
...@@ -39,11 +43,16 @@ mkdir lib ...@@ -39,11 +43,16 @@ mkdir lib
# - FFTW3, the Fastest Fourier Transform in the West version 3, which enables us to compute the nonlinear term using a pseudo-spectral approach (see [fourier module](Sources/fourier)). # - FFTW3, the Fastest Fourier Transform in the West version 3, which enables us to compute the nonlinear term using a pseudo-spectral approach (see [fourier module](Sources/fourier)).
# Each of these libraries must be installed in the `/lib` folder (here `/gyacomo/lib`). # Each of these libraries must be installed in the `/lib` folder (here `/gyacomo/lib`).
echo " repository cloned"
echo ______________________________________________
#############################################
### 2. Futils installation ### 2. Futils installation
# 2.1 - We navigate to our `lib` folder and clone first the `futils` library. # 2.1 - We navigate to our `lib` folder and clone first the `futils` library.
echo -- 2. Installing Futils echo "2. Installing Futils"
cd lib cd lib
git clone https://c4science.ch/diffusion/FUTILS/futils.git > futils_clone.out echo " clone repository"
git clone https://c4science.ch/diffusion/FUTILS/futils.git &> futils_clone.out
# **Note:** if you do not have the access, contact me and I will provide a .zip file. # **Note:** if you do not have the access, contact me and I will provide a .zip file.
# 2.2 - Then, we navigate to the `src` directory. # 2.2 - Then, we navigate to the `src` directory.
...@@ -54,7 +63,8 @@ sed -i '37s/.*/OPT = -O3/' Makefile ...@@ -54,7 +63,8 @@ sed -i '37s/.*/OPT = -O3/' Makefile
# **Note:** the Makefile is also assuming that the Hdf5 library path is stored in a `$(HDF5)` variable and that the `mpif90` compiler is defined. If you are on Marconi HPCC, you may have to change line 34 to `F90 = mpiifort` and line 35 to `HDF5 = $(HDF5_HOME)` (having prealably loaded the Hdf5 module) # **Note:** the Makefile is also assuming that the Hdf5 library path is stored in a `$(HDF5)` variable and that the `mpif90` compiler is defined. If you are on Marconi HPCC, you may have to change line 34 to `F90 = mpiifort` and line 35 to `HDF5 = $(HDF5_HOME)` (having prealably loaded the Hdf5 module)
# 2.4 - We can now compile the library. # 2.4 - We can now compile the library.
make lib echo " make library.."
make lib &> futils_make_lib.out
# 2.5 - We create necessary directories to store our library files. # 2.5 - We create necessary directories to store our library files.
mkdir -p include/O mkdir -p include/O
...@@ -63,57 +73,64 @@ mkdir -p lib/O ...@@ -63,57 +73,64 @@ mkdir -p lib/O
mkdir -p lib/g mkdir -p lib/g
# 2.6 - Time now to install the library (this will put the library files in the previously made directories). # 2.6 - Time now to install the library (this will put the library files in the previously made directories).
echo -- compiling... echo " compiling.."
make install > futils_make_install.out make install &> futils_make_install.out
# 2.7 - We can test now the installation and linkage of futils by typing `make` in `/gyacomo`. The compilation should pass the previously observed error and halt now with an error at the call of `fftw` routines in `src.fourier_mod.F90`. # 2.7 - We can test now the installation and linkage of futils by typing `make` in `/gyacomo`. The compilation should pass the previously observed error and halt now with an error at the call of `fftw` routines in `src.fourier_mod.F90`.
echo -- ----Futils installed----
cd ../../ cd ../../
echo " Futils installed"
echo ______________________________________________
#############################################
### 3. FFTW3 installation ### 3. FFTW3 installation
echo -- 3. Installing FFTW3 echo "3. Installing FFTW3"
echo " download source"
# 3.1 - We download the `fftw` zip directory, unzip it, and navigate to the directory. # 3.1 - We download the `fftw` zip directory, unzip it, and navigate to the directory.
wget http://www.fftw.org/fftw-3.3.10.tar.gz > wget_fftw3.out wget http://www.fftw.org/fftw-3.3.10.tar.gz &> wget_fftw3.out
tar -xvf fftw-3.3.10.tar.gz > tar_fftw3.out tar -xvf fftw-3.3.10.tar.gz &> tar_fftw3.out
cd fftw-3.3.10 cd fftw-3.3.10
# 3.2 - We configure the installation and make the double-precision version. # 3.2 - We configure the installation and make the double-precision version.
echo -- configure double precision mpi... echo " configure double precision mpi.."
./configure --enable-mpi --prefix=$PWD > configure_mpi.out ./configure --enable-mpi --prefix=$PWD &> configure_mpi.out
echo -- compile double precision mpi... echo " compile double precision mpi.."
make > make.out make &> make.out
# 3.3 - We can now install it. # 3.3 - We can now install it.
echo -- installing... echo " installing.."
make install > make_install.out make install &> make_install.out
# 3.4 - For single-precision runs, we also configure and install the single-precision version. # 3.4 - For single-precision runs, we also configure and install the single-precision version.
echo -- configure single precision mpi... echo " configure single precision mpi.."
./configure --enable-float --enable-mpi --prefix=$PWD > configure_float.out ./configure --enable-float --enable-mpi --prefix=$PWD &> configure_float.out
echo -- compile single precision mpi... echo " compile single precision mpi.."
make > make_float.out make &> make_float.out
echo -- installing... echo " installing.."
make install > make_install_float.out make install &> make_install_float.out
# 3.5 - We gather the library files in a new `lib` subdirectory. # 3.5 - We gather the library files in a new `lib` subdirectory.
mkdir lib mkdir lib
cp lib64/* lib/. cp -r lib64/* lib/.
cp *.la lib/. cp -r *.la lib/.
# 3.7 - We go back to `/gyacomo` and verify that `FFTW3DIR = $(LIBDIR)/fftw-3.3.10` in `/gyacomo/local/dirs.inc` when `ENVTYPE = Linux`. # 3.7 - We go back to `/gyacomo` and verify that `FFTW3DIR = $(LIBDIR)/fftw-3.3.10` in `/gyacomo/local/dirs.inc` when `ENVTYPE = Linux`.
cd ../ cd ../
# 3.8 - We test the installation and linkage by typing `make` in `/gyacomo`. The compilation should halt with an error at the call of `FM` routines in the `src/coeff_mod.F90` file. # 3.8 - We test the installation and linkage by typing `make` in `/gyacomo`. The compilation should halt with an error at the call of `FM` routines in the `src/coeff_mod.F90` file.
echo -- ----FFTW3 installed---- echo " FFTW3 installed"
echo ______________________________________________
#############################################
## 4. FM installation ## 4. FM installation
echo -- ----Installing FM---- echo "4. Installing FM"
# 4.1 - Navigate back to the main `lib` directory (e.g., `/gyacomo/lib/`) and download the zipped folder. # 4.1 - Navigate back to the main `lib` directory (e.g., `/gyacomo/lib/`) and download the zipped folder.
wget https://dmsmith.lmu.build/FM1.4/FM_files.zip > wget_FM.out echo " download source"
wget https://dmsmith.lmu.build/FM1.4/FM_files.zip &> wget_FM.out
# 4.2 - Unzip and enter the folder. # 4.2 - Unzip and enter the folder.
unzip FM_files.zip > unzip_FM.out unzip FM_files.zip &> unzip_FM.out
mv FM_files FM mv FM_files FM
cd FM cd FM
...@@ -121,18 +138,24 @@ cd FM ...@@ -121,18 +138,24 @@ cd FM
for file in *.f95 ; do cp "$file" "${file%.*}.F90" ; done for file in *.f95 ; do cp "$file" "${file%.*}.F90" ; done
# 4.4 - We compile manually (some compilation may take ~5min). # 4.4 - We compile manually (some compilation may take ~5min).
echo '-- compiling... (give it 5min)' echo " compiling.. (~5min)"
echo " fmsave.."
ifort fmsave.F90 -c -O3 ifort fmsave.F90 -c -O3
echo " fm.."
ifort fm.F90 -c -O3 ifort fm.F90 -c -O3
echo " fmzm.."
ifort fmzm90.F90 -c -O3 ifort fmzm90.F90 -c -O3
ifort TestFM.F90 -c -O3 # echo " TestFM.."
ifort SampleFM.F90 -c -O3 # ifort TestFM.F90 -c -O3
ifort fmsave.o fm.o fmzm90.o TestFM.o -o TestFM # echo " SampleFM.."
ifort fmsave.o fm.o fmzm90.o SampleFM.o -o SampleFM # ifort SampleFM.F90 -c -O3
echo -- done # echo " building all.."
# ifort fmsave.o fm.o fmzm90.o TestFM.o -o TestFM
# ifort fmsave.o fm.o fmzm90.o SampleFM.o -o SampleFM
echo " ..done"
# 4.5 We can test the installation. # 4.5 We can test the installation.
./TestFM # ./TestFM &> TestFM.out
./SampleFM # ./SampleFM &> SampleFM.out
# 4.6 The library file is put together and moved to a local `lib` directory. # 4.6 The library file is put together and moved to a local `lib` directory.
mkdir lib mkdir lib
...@@ -144,13 +167,40 @@ mkdir mod ...@@ -144,13 +167,40 @@ mkdir mod
mv *.mod mod mv *.mod mod
cd ../ cd ../
echo " FM installed"
echo ______________________________________________
#############################################
# 5 compilation of GYACOMO # 5 compilation of GYACOMO
cd ../ cd ../
echo -- we now compile the code... echo "5. Compilation of GYACOMO"
make make 2>&1 | tee make.out
echo -- done echo ______________________________________________
#############################################
# 6. setup of a testcase
echo "6. Test case setup"
make new_prob make new_prob
echo -- ------ echo "-- GYACOMO is ready --"
echo -- GYACOMO is ready, you can test running it in simulations/problem_01 echo "you can test running it using:"
echo -- ------ echo "cd gyacomo/simulations/problem_01"
\ No newline at end of file echo "mpirun -np 4 ./gyacomo.exe 1 4 1"
echo ______________________________________________
#############################################
# 7. Epilogue
echo "End of the script"
# Record end time
end=$(date +%s)
# Calculate execution time
execution_time=$((end - start))
# Check if execution time is more than a minute
if [ $execution_time -gt 60 ]; then
execution_time_minutes=$((execution_time / 60))
execution_time_seconds=$((execution_time % 60))
echo "Script executed in $execution_time_minutes minute(s) and $execution_time_seconds second(s)."
else
echo "Script executed in $execution_time second(s)."
fi
echo '=============================================='
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment