Commit 5d4367e9 authored by Christian Meesters's avatar Christian Meesters

refactored and debugged basics - submitted for further testing

parent 9549d2c6
......@@ -38,6 +38,7 @@ cluster=$(sacctmgr show cluster -p --noheader| cut -f1 -d '|')
_arg_queue="parallel"
_arg_constraint="broadwell"
_arg_runlimit=300
SCRIPT="$0"
SCRIPT_VERSION="0.1"
......@@ -247,33 +248,31 @@ if [ -z "$SLURM_JOB_ID" ]; then
if [[ ! -d "${_arg_outdir// }" ]]; then
mkdir -p "${_arg_outdir}"
else
error "${_arg_outdir// } exists already! Possibly over overwrite of results. Cowardly giving up."
error "'${_arg_outdir// }' exists already! Possibly overwrite of results. Cowardly giving up."
fi
# TODO check scalability and time constraints
# cluster specific settings
if [ "$cluster" = "mogon2" ]; then
queue="parallel"
cpus=40
autoscaler=2
atoms=$(sed -n '/\*/,/\*/p' $sample | egrep -v '\*' | wc -l)
# cpus=$(( autoscaler* atoms / cpus * cpus))
cpuspertask=2 # don't use threads as mpi-rank
# tasks=$(( autoscaler* atoms / cpus * cpus / cpuspertask ))
tasks=$(( autoscaler* atoms /cpus * cpus/cpuspertask))
pernode=$(( cpus/cpuspertask ))
nodes=$(( tasks/pernode ))
echo -n "automatic scaling for sample $samplename via $autoscaler*#atoms ($atoms) suggests: "
echo "$(( autoscaler* atoms / cpus * cpus)) processes"
echo "apllying autoscaler to input-file"
sed -i "s/nproc.*$/nprocs $tasks/" $sample
else
queue="nodeshort"
tasks=64
cpus=64
fi
# software specific settings
autoscaler=2 # a fudge-factor specific to orca
cpuspertask=2 # don't use threads as mpi-rank
atoms=$(sed -n '/\*/,/\*/p' $sample | egrep -v '\*' | wc -l)
tasks=$(( autoscaler* atoms /cpus * cpus/cpuspertask))
pernode=$(( cpus/cpuspertask ))
nodes=$(( tasks/pernode ))
echo -n "automatic scaling for sample $samplename via $autoscaler*#atoms ($atoms) suggests: "
echo "$(( autoscaler* atoms / cpus * cpus)) processes"
echo "apllying autoscaler to input-file"
sed -i "s/nproc.*$/nprocs $tasks/" $sample
#TODO: check sensible time constraint
# saving standard settings
# submit_statement="sbatch -A ${_arg_assoc} -p ${queue} -J ${_arg_tag} -o ${_arg_outdir}/${samplename%%.*}_%j.log -n $tasks -t 120:00:00 --signal=B:SIGUSR2@600 -N 1"
submit_statement="sbatch -A ${_arg_assoc} -p ${queue} -J ${_arg_tag} -o ${_arg_outdir}/${samplename%%.*}_%j.log -n $tasks -c $cpuspertask -t ${_arg_runlimit} --signal=B:SIGUSR2@600 -N ${nodes}"
$submit_statement --wrap "$(cat << EOF
......@@ -288,8 +287,8 @@ if [ -z "$SLURM_JOB_ID" ]; then
# Go to jobdir and start the program
cd /localscratch/\${SLURM_JOB_ID}
export RSH_COMMAND=ssh
#eval \$(which orca) "\$scratch"/\$(basename $sample)
$EBROOTORCA/orca "\$scratch"/\$(basename $sample) "-np \${SLURM_NTASKS} -npernode \${PERNODE} --verbose"
set -x
$EBROOTORCA/orca "\$scratch"/\$(basename $sample) "-np \${SLURM_NTASKS} -npernode ${pernode} "
cleanup
EOF
)"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment