diff --git a/new_prob.sh b/new_prob.sh index 937534554b853d6cbeeea0f10b0c62fe31718ada..7c94609c65537fedf083c133ae601512657c85a8 100644 --- a/new_prob.sh +++ b/new_prob.sh @@ -1,31 +1,26 @@ #!/bin/bash gyacomo_dir=$(pwd) +echo "Setup of a new problem in /simulations" # Check if an argument is provided if [ $# -ne 1 ]; then - echo "- using 2D Z-pinch parameter" - echo " (you can ask for a cyclone base case by adding "CBC" after the call of the script)" +echo "- 2D Z-pinch parameter" +echo " (add "CBC" for a cyclone base case)" inputfile=$gyacomo_dir/scripts/parameter_files/parameters_Zpinch.in else # Check the value of the argument - if [ "$1" = "help" ]; then - echo "This script setup a new simulation directory in /simulation" - echo "The basic setup is a small 2D z-pinch simulation." - echo "You can ask a cyclone base case (more expensive) by typing sh new_prob.sh CBC" - exit 1 - elif [ "$1" = "CBC" ]; then - echo "- using CBC parameter" +if [ "$1" = "CBC" ]; then + echo "- CBC parameter" inputfile=$gyacomo_dir/scripts/parameter_files/parameters_CBC.in elif [ "$1" = "ZBC" ]; then - echo "- using Zpinch parameter" + echo "- 2D Z-pinch parameter" inputfile=$gyacomo_dir/scripts/parameter_files/parameters_Zpinch.in else - echo "ERROR STOP unknown entry" - echo "(usage: sh new_prob.sh [CBC or ZBC (opt)])" + echo "- ERROR STOP unknown entry" + echo " (usage: sh new_prob.sh [CBC or ZBC (opt)] [folder_name (opt)])" exit 1 fi fi -echo "Setup of a new problem in the simulations directory..." mkdir -p $gyacomo_dir/simulations cd $gyacomo_dir/simulations @@ -45,7 +40,7 @@ get_next_problem_folder() { # Function to display usage information usage() { echo "- usage: $0 [base_case_type] [folder_name]" - echo "If folder_name is not provided, default is the next available 'problem_xx'" + echo " If folder_name is not provided, default is the next available 'problem_xx'" exit 1 } @@ -59,7 +54,7 @@ folder_name="${2:-$(get_next_problem_folder)}" # Check if the executable exists if [ ! -x $gyacomo_dir/bin/gyacomo23_dp ]; then - echo "Error: Executable 'bin/gyacomo23_dp' not found or not executable. Please compile the code first." + echo "- Error: Executable 'bin/gyacomo23_dp' not found or not executable. Please compile the code first." exit 1 fi @@ -70,7 +65,7 @@ mkdir -p "$folder_name" cp $inputfile "$folder_name/params.in" # Copy the marconi job submission example -cp $gyacomo_dir/scripts/parameter_files/submit_marconi_example.cmd "$folder_name/submit_marconi.cmd" +cp $gyacomo_dir/scripts/shell_scripts/submit_marconi_example.cmd "$folder_name/submit_marconi.cmd" # Copy tutorial file cp $gyacomo_dir/scripts/tutorials/tutorial.md "$folder_name/." @@ -82,6 +77,11 @@ ln -s $gyacomo_dir/bin/gyacomo23_dp "$folder_name/gyacomo.exe" ln -s $gyacomo_dir/scripts/python_utilities/minimal_analysis.py "$folder_name/." ln -s $gyacomo_dir/scripts/python_utilities/movie.py "$folder_name/." -echo "- folder 'simulations/$folder_name' created with symbolic link to the executable." -echo "- check the tutorial file in there!" -echo "...done" \ No newline at end of file +echo "- simulations/$folder_name created" +echo " (check the tutorial file in there)" + +echo "You can now run Gyacomo with" +echo " cd simulations/$folder_name" +echo " mpirun -np 4 ./gyacomo.exe 1 4 1" +echo "Then use the example analysis script" +echo " python3 minimal_analysis.py" \ No newline at end of file diff --git a/scripts/tutorials/spcpc_installation_auto.sh b/scripts/tutorials/spcpc_installation_auto.sh index 8798b9a3459b4e60cdbaf5bbcae9dc64da5c016c..cf059c58e22d16628523248039bb2047055d8e1e 100644 --- a/scripts/tutorials/spcpc_installation_auto.sh +++ b/scripts/tutorials/spcpc_installation_auto.sh @@ -17,7 +17,7 @@ echo '==============================================' # 1. Prelude # 1.1 - First, we clone the repository. -echo "1. Clone the directory " +echo "1/6 Clone the directory " git clone https://gitlab.epfl.ch/ahoffman/gyacomo.git &> gyacomo_clone.out cd gyacomo @@ -44,12 +44,12 @@ mkdir lib # Each of these libraries must be installed in the `/lib` folder (here `/gyacomo/lib`). echo " repository cloned" -echo ______________________________________________ +echo "______________________________________________" ############################################# ### 2. Futils installation # 2.1 - We navigate to our `lib` folder and clone first the `futils` library. -echo "2. Installing Futils" +echo "2/6 Installing Futils" cd lib echo " clone repository" git clone https://c4science.ch/diffusion/FUTILS/futils.git &> futils_clone.out @@ -79,11 +79,11 @@ 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`. cd ../../ echo " Futils installed" -echo ______________________________________________ +echo "______________________________________________" ############################################# ### 3. FFTW3 installation -echo "3. Installing FFTW3" +echo "3/6 Installing FFTW3" echo " download source" # 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 @@ -118,12 +118,12 @@ 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. echo " FFTW3 installed" -echo ______________________________________________ +echo "______________________________________________" ############################################# ## 4. FM installation -echo "4. Installing FM" +echo "4/6 Installing FM" # 4.1 - Navigate back to the main `lib` directory (e.g., `/gyacomo/lib/`) and download the zipped folder. echo " download source" @@ -168,24 +168,24 @@ mv *.mod mod cd ../ echo " FM installed" -echo ______________________________________________ +echo "______________________________________________" ############################################# # 5 compilation of GYACOMO cd ../ -echo "5. Compilation of GYACOMO" +echo "5/6 Compilation of GYACOMO" make 2>&1 | tee make.out -echo ______________________________________________ +echo "______________________________________________" ############################################# # 6. setup of a testcase -echo "6. Test case setup" +echo "6/6 Test case setup" make new_prob echo "-- GYACOMO is ready --" echo "you can test running it using:" echo "cd gyacomo/simulations/problem_01" echo "mpirun -np 4 ./gyacomo.exe 1 4 1" -echo ______________________________________________ +echo "______________________________________________" ############################################# # 7. Epilogue