diff --git a/jacobi/openmp/not_opt/script/run_pleiadi.sh b/jacobi/openmp/not_opt/script/run.sh similarity index 77% rename from jacobi/openmp/not_opt/script/run_pleiadi.sh rename to jacobi/openmp/not_opt/script/run.sh index 80e60487053ea391271beac2146edc394192eb3d..b0d90058f7a792f1d4a7a4cc30088a827833ccd2 100755 --- a/jacobi/openmp/not_opt/script/run_pleiadi.sh +++ b/jacobi/openmp/not_opt/script/run.sh @@ -1,16 +1,15 @@ #!/bin/bash ######################### RESOURSE ALLOCATION ##################################### -##SBATCH --account=???????? - -#SBATCH --partition=pleiadi +#SBATCH --account=hpc_school +#SBATCH --partition=hpc_school #SBATCH --job-name="Jacobi" #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=8 #SBATCH --output=Jacobi-omp-no-opt-%j.out #SBATCH --error=Jacobi-omp-no-opt.%j.err -#SBATCH --time=00:03:00 +#SBATCH --time=00:05:00 ################################################################################### ################################## MODULES ######################################## @@ -43,8 +42,19 @@ then exit 2 fi + +# OMP stuff +export OMP_DISPLAY_AFFINITY=1 +export OMP_WAIT_POLICY=ACTIVE +# export OMP_PLACES=( "cores", "threads" ) +# export BINDING=( "master" "close" "spread" ) + for OMP in ${OMP_THREADS[@]} do + # not necessary because the clause 'num_threads' + # is specified in the source code + # export OMP_NUM_THREADS=${OMP} + # run the application time ${EXEC} ${GRID_SIZE_X} ${GRID_SIZE_Y} ${OMP} |& tee ${EXEC}_OMP_${OMP}_output.txt done diff --git a/jacobi/serial/not_opt/script/run.sh b/jacobi/serial/not_opt/script/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..e5d5d6955bc6a4be036797a7406d61d258085535 --- /dev/null +++ b/jacobi/serial/not_opt/script/run.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +######################### RESOURSE ALLOCATION ##################################### +#SBATCH --account=hpc_school +#SBATCH --partition=hpc_school +#SBATCH --job-name="Jacobi" +#SBATCH --nodes=1 +#SBATCH --cpus-per-task=1 +#SBATCH --output=Jacobi-serial-no-opt-%j.out +#SBATCH --error=Jacobi-serial-no-opt.%j.err +#SBATCH --time=00:05:00 +################################################################################### + +################################## MODULES ######################################## +export MODULE_VERSION=5.0.1 +source /opt/cluster/spack/share/spack/setup-env.sh + +# module purge +module purge +# load GCC +module load default-gcc-11.2.0 +# load valgrind (optional) +module load valgrind-3.18.1-gcc-11.2.0-3hcfkwk +################################################################################### + +# input parameters +source input_parameters + +WORKDIR=${PWD} +# compile the application +cd .. && make clean && make serial +if [[ "$?" != "0" ]] +then + echo "Cannot compile the application ...aborting..." + exit 1 +fi + +# get the executable +EXEC=$(find $(realpath ./) -maxdepth 1 -executable -name "jacobi_*" -type f -print) +if [[ "$?" != "0" ]] +then + echo "Cannot find the executable ...aborting..." + exit 2 +fi + + +# run +time ${EXEC} ${GRID_SIZE_X} ${GRID_SIZE_Y} |& tee ${EXEC}_output.txt + +cd ${WORKDIR} + +exit 0 diff --git a/jacobi/serial/not_opt/script/run_pleiadi.sh b/jacobi/serial/not_opt/script/run_pleiadi.sh deleted file mode 100755 index bc2d48a13544cd52c435657c0cbe8239c3490887..0000000000000000000000000000000000000000 --- a/jacobi/serial/not_opt/script/run_pleiadi.sh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash - -######################### RESOURSE ALLOCATION ##################################### -##SBATCH --account=???????? - -#SBATCH --partition=pleiadi -#SBATCH --job-name="Jacobi" -#SBATCH --nodes=1 -#SBATCH --ntasks-per-node=1 -#SBATCH --cpus-per-task=1 -#SBATCH --output=Jacobi-serial-no-opt-%j.out -#SBATCH --error=Jacobi-serial-no-opt.%j.err -#SBATCH --time=00:03:00 -################################################################################### - -################################## MODULES ######################################## -export MODULE_VERSION=5.0.1 -source /opt/cluster/spack/share/spack/setup-env.sh - -# module purge -module purge -# load GCC -module load default-gcc-11.2.0 -################################################################################### - -# input parameters -source input_parameters - -WORKDIR=${PWD} -# compile the application -cd .. && make clean && make serial -if [[ "$?" != "0" ]] -then - echo "Cannot compile the application ...aborting..." - exit 1 -fi - -# get the executable -EXEC=$(find $(realpath ./) -maxdepth 1 -executable -name "jacobi_*" -type f -print) -if [[ "$?" != "0" ]] -then - echo "Cannot find the executable ...aborting..." - exit 2 -fi - - -# run -time ${EXEC} ${GRID_SIZE_X} ${GRID_SIZE_Y} |& tee ${EXEC}_output.txt - -cd ${WORKDIR} - -exit 0 - -# # return to ./script and source input parameters and function -# cd - && source input_parameters && source write_paramfile.sh - -# # loop over particles -# for PART in "${N[@]}" -# do -# # loop over MPI tasks -# for TASK in "${MPI[@]}" -# do -# # loop over OMP threads -# for THR in "${THREADS[@]}" -# do -# # write the paramfile -# write_paramfile ${TEMPLATE} ${PARAMFILE} \ -# ${DELETE_OUTPUT_FILES} ${OUTPUTDIR} \ -# ${THR} ${PART} - -# # check the status -# if [[ "$?" != "0" ]] -# then -# echo "Error while writing ${PARAMFILE} ...aborting..." -# exit 3 -# fi - -# # move the paramfile and move to the parent directory where the executable resides -# mv ${PARAMFILE} ../ && cd .. - -# # run the application -# srun --ntasks ${TASK} ${EXEC} ${PARAMFILE} >& $SLURM_JOB_ID.log - -# # check exit status -# if [[ "$?" != "0" ]] -# then -# echo "####################################################################" -# echo "ERROR while running the app using: ${TASK} MPI tasks and ${GPU} GPUs" -# echo "####################################################################" -# fi - -# # delete the paramfile and return to the previous directory -# rm -f ${PARAMFILE} && cd - -# done # loop over THR -# done # loop over TASKS -# done # looop over particles - -# # make clean -# cd .. && make clean - - - -# Everything is OK! -# exit 0