Automatic calculation of nodes based on processes

This commit is contained in:
Oskar Lappi
2020-06-10 16:51:35 +03:00
parent c7f23eb50c
commit 0030db01f3

View File

@@ -20,8 +20,6 @@ print_usage(){
echo "Options:" echo "Options:"
echo " -n <num_procs>" echo " -n <num_procs>"
echo " number of tasks for slurm, default=$default_num_procs" echo " number of tasks for slurm, default=$default_num_procs"
echo " -N <num_nodes>"
echo " number of nodes for slurm, default=$default_num_nodes"
echo " -p <partition>" echo " -p <partition>"
echo " which partition to use for slurm, default=$default_partition" echo " which partition to use for slurm, default=$default_partition"
echo " -t <tag>" echo " -t <tag>"
@@ -33,14 +31,12 @@ print_usage(){
echo " Print this message" echo " Print this message"
} }
while getopts :n:N:t:p:ih opt while getopts :n:t:p:ih opt
do do
case "$opt" in case "$opt" in
n) n)
num_procs=$OPTARG num_procs=$OPTARG
;; num_nodes=$(( 1 + ($num_procs - 1)/4))
N)
num_nodes=$OPTARG
;; ;;
t) t)
benchmark_label=$OPTARG benchmark_label=$OPTARG
@@ -67,6 +63,8 @@ then
fi fi
set -x set -x
exit 0
if [ -z "$interactively"] if [ -z "$interactively"]
then then
sbatch <<EOF sbatch <<EOF