Skip to content
Snippets Groups Projects
Commit daef0163 authored by Blaise Li's avatar Blaise Li
Browse files

More verbose wrapper script.

Indicate original config file.
parent 8214c5aa
No related branches found
No related tags found
No related merge requests found
...@@ -77,14 +77,15 @@ output_dir=$(grep "output_dir" "${configfile}" | mawk '{print $NF}' | sed 's/,$/ ...@@ -77,14 +77,15 @@ output_dir=$(grep "output_dir" "${configfile}" | mawk '{print $NF}' | sed 's/,$/
mkdir -p ${output_dir} mkdir -p ${output_dir}
start_day=$(date +"%Y-%m-%d") start_day=$(date +"%Y-%m-%d")
log_base="${output_dir}/$(date +"%d%m%y_%Hh%Mm")" log_base="${output_dir}/$(date +"%d%m%y_%Hh%Mm")"
> ${log_base}.log
config_base=$(basename ${configfile}) config_base=$(basename ${configfile})
config_snapshot="${output_dir}/${config_base}" 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} cp -f ${configfile} ${config_snapshot}
snakefile_base=$(basename ${snakefile}) snakefile_base=$(basename ${snakefile})
snakefile_snapshot="${output_dir}/${snakefile_base}" 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} cp -f ${snakefile} ${snakefile_snapshot}
kilobytes_tot=$(mawk '$1 == "MemTotal:" {print $2}' /proc/meminfo) kilobytes_tot=$(mawk '$1 == "MemTotal:" {print $2}' /proc/meminfo)
...@@ -99,7 +100,7 @@ megabytes_resource=$(echo "${kilobytes_tot} / 1100" | bc) ...@@ -99,7 +100,7 @@ megabytes_resource=$(echo "${kilobytes_tot} / 1100" | bc)
# TODO: check that this works # TODO: check that this works
cmd="(cd ${output_dir}; snakemake -s ${snakefile_base} --configfile ${config_base} --resources mem_mb=${megabytes_resource} $@)" 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://unix.stackexchange.com/a/245610/55127
# https://stackoverflow.com/a/692407/1878788 # https://stackoverflow.com/a/692407/1878788
# Migh make things too slow? # Migh make things too slow?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment