Commit daef0163 authored by Blaise Li's avatar Blaise Li
Browse files

More verbose wrapper script.

Indicate original config file.
parent 8214c5aa
......@@ -77,14 +77,15 @@ output_dir=$(grep "output_dir" "${configfile}" | mawk '{print $NF}' | sed 's/,$/
mkdir -p ${output_dir}
start_day=$(date +"%Y-%m-%d")
log_base="${output_dir}/$(date +"%d%m%y_%Hh%Mm")"
> ${log_base}.log
config_base=$(basename ${configfile})
config_snapshot="${output_dir}/${config_base}"
echo "Saving a local copy of the configuration in ${config_snapshot}"
echo "Saving a local copy of the configuration file ${configfile} in ${config_snapshot}" | tee -a ${log_base}.log
cp -f ${configfile} ${config_snapshot}
snakefile_base=$(basename ${snakefile})
snakefile_snapshot="${output_dir}/${snakefile_base}"
echo "Saving a local copy of the snakefile in ${snakefile_snapshot}"
echo "Saving a local copy of the snakefile in ${snakefile_snapshot}" | tee -a ${log_base}.log
cp -f ${snakefile} ${snakefile_snapshot}
kilobytes_tot=$(mawk '$1 == "MemTotal:" {print $2}' /proc/meminfo)
......@@ -99,7 +100,7 @@ megabytes_resource=$(echo "${kilobytes_tot} / 1100" | bc)
# TODO: check that this works
cmd="(cd ${output_dir}; snakemake -s ${snakefile_base} --configfile ${config_base} --resources mem_mb=${megabytes_resource} $@)"
echo ${cmd} > ${log_base}.log
echo ${cmd} | tee -a ${log_base}.log
# https://unix.stackexchange.com/a/245610/55127
# https://stackoverflow.com/a/692407/1878788
# Migh make things too slow?
......
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