Skip to content
Snippets Groups Projects
Commit ca087384 authored by Felix Kleinert's avatar Felix Kleinert
Browse files

update run script generator and remve old runscript

parent f9ecc50c
Branches
Tags
3 merge requests!125Release v0.10.0,!124Update Master to new version v0.10.0,!97Felix issue106 hpc modules for juwels
Pipeline #34134 passed
...@@ -5,6 +5,7 @@ echo "# #" ...@@ -5,6 +5,7 @@ echo "# #"
echo "# user interaction required #" echo "# user interaction required #"
echo "# #" echo "# #"
echo "############################################################" echo "############################################################"
echo
echo "This script creates the HPC batch scripts to run mlt on compute nodes (gpus and develgpus)." echo "This script creates the HPC batch scripts to run mlt on compute nodes (gpus and develgpus)."
echo "You can modify the created run scripts afterwards if needed." echo "You can modify the created run scripts afterwards if needed."
...@@ -13,62 +14,58 @@ echo "You can modify the created run scripts afterwards if needed." ...@@ -13,62 +14,58 @@ echo "You can modify the created run scripts afterwards if needed."
budget='' budget=''
while [[ $budget == '' ]] while [[ $budget == '' ]]
do do
echo
read -p "Enter project budget for --account flag: " budget read -p "Enter project budget for --account flag: " budget
done done
email=`jutil user show -o json | grep email | cut -f2 -d':' | cut -f1 -d',' | cut -f2 -d'"'` email=`jutil user show -o json | grep email | cut -f2 -d':' | cut -f1 -d',' | cut -f2 -d'"'`
echo
read -p "Enter e-mail address for --mail-user (default: ${email}): " new_email read -p "Enter e-mail address for --mail-user (default: ${email}): " new_email
if [[ -z "$new_email" ]]; then if [[ -z "$new_email" ]]; then
new_email=$email new_email=$email
fi fi
cat <<EOT > run_develgpus.bash # create HPC_logging dir
#!/bin/bash -x hpclogging="HPC_logging/"
#SBATCH --account=${budget} mkdir -p $hpclogging
#SBATCH --nodes=1
#SBATCH --output=mlt-out.%j
#SBATCH --error=mlt-err.%j
#SBATCH --time=02:00:00
#SBATCH --partition=develgpus
#SBATCH --gres=gpu:2
#SBATCH --mail-type=ALL
#SBATCH --mail-user=${email}
source mlt_modules.sh
source venv/bin/activate
export PYTHONPATH=\${PWD}/venv/lib/python3.6/site-packages:\${PYTHONPATH}
srun python run.py # ordering for looping:
EOT # "partition nGPUs timing"
echo "Created runscript: run_develgpus.bash" for i in "develgpus 2 02:00:00" "gpus 4 08:00:00"; do
set -- $i
cat <<EOT > run_gpus.bash cat <<EOT > run_$1.bash
#!/bin/bash -x #!/bin/bash -x
#SBATCH --account=${budget} #SBATCH --account=${budget}
#SBATCH --nodes=1 #SBATCH --nodes=1
#SBATCH --output=mlt-out.%j #SBATCH --output=${hpclogging}mlt-out.%j
#SBATCH --error=mlt-err.%j #SBATCH --error=${hpclogging}/mlt-err.%j
#SBATCH --time=16:00:00 #SBATCH --time=$3
#SBATCH --partition=gpus #SBATCH --partition=$1
#SBATCH --gres=gpu:4 #SBATCH --gres=gpu:$2
#SBATCH --mail-type=ALL #SBATCH --mail-type=ALL
#SBATCH --mail-user=${email} #SBATCH --mail-user=${email}
source mlt_modules.sh source mlt_modules.sh
source venv/bin/activate source venv/bin/activate
timestamp=\`date +"%Y-%m-%d_%H%M-%S"\`
export PYTHONPATH=\${PWD}/venv/lib/python3.6/site-packages:\${PYTHONPATH} export PYTHONPATH=\${PWD}/venv/lib/python3.6/site-packages:\${PYTHONPATH}
srun python run.py srun python run.py --experiment_date=\$timestamp
EOT EOT
echo "Created runscript: run_gpus.bash" echo "Created runscript: run_$1.bash"
done
echo
echo "You have to run the the following command on a login node to download data:" echo "You have to run the the following command on a login node to download data:"
echo " \`python run.py'" echo " \`python run.py'"
echo
echo "Please execute the following command to check if the setup went well:" echo "Please execute the following command to check if the setup went well:"
echo " \`sbatch run_develgpus.bash'" echo " \`sbatch run_develgpus.bash'"
#!/bin/bash -x
#SBATCH --account=deepacf
#SBATCH --nodes=1
#SBATCH --output=mlt-out.%j
#SBATCH --error=mlt-err.%j
#SBATCH --time=02:00:00
#SBATCH --partition=develgpus
#SBATCH --gres=gpu:2
#SBATCH --mail-type=ALL
#SBATCH --mail-user=f.kleinert@fz-juelich.de
source mlt_modules.sh
source venv/bin/activate
export PYTHONPATH=${PWD}/venv/lib/python3.6/site-packages:${PYTHONPATH}
srun python run.py
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment