Skip to content
Snippets Groups Projects
Commit 7689c82d authored by Julien  GUGLIELMINI's avatar Julien GUGLIELMINI
Browse files

Better log

parent 9ddd4fda
No related branches found
No related tags found
No related merge requests found
......@@ -5,16 +5,13 @@
trap 'rm -rf "$tmp"' EXIT
export LC_ALL=C
SECONDS=0
readonly VERSION=0.4
bold=$(tput bold)
normal=$(tput sgr0)
display_usage() {
echo "$(echo ${ZSH_ARGZERO} | awk 'BEGIN{FS="/"}{print $NF}') version ${VERSION}"
echo "wGRR version ${VERSION}"
echo "${bold}USAGE:${normal} $ZSH_ARGZERO -f <fasta_file> [OPTIONS]"
echo ""
echo "${bold}MANDATORY PARAMETERS:${normal}"
......@@ -56,7 +53,7 @@ fi
# print version
if [ "$1" = "-v" ] || [ "$1" = "--version" ]; then
echo "$(echo ${ZSH_ARGZERO} | awk 'BEGIN{FS="/"}{print $NF}') version ${VERSION}";
echo "wGRR version ${VERSION}";
exit 0;
fi
......@@ -147,26 +144,18 @@ if [[ $OUT == "N.O.O.U.T" ]] ; then
OUT=$(basename $tmp)
fi
echo "[INFO] -- $(echo ${ZSH_ARGZERO} | awk 'BEGIN{FS="/"}{print $NF}') version ${VERSION}"
echo "[INFO] -- The command is:"
echo "[INFO] -- $ZSH_ARGZERO $@"
#################################
########### TO DO ###############
#################################
## Check dependencies
if [[ ! -f wGRR.awk ]] ; then
echo "[ERROR] -- awk script wGRR.awk not found."
exit 1
fi
## Get partition (if sbatch) or check nproc (if local/Check number of threads
if [[ $SLURM_JOBID != "" ]] ; then
PARTITION=$(squeue -j $SLURM_JOBID -o "%P" -h)
BATCHFLAG=$(squeue -j $SLURM_JOBID --Format=batchflag -h | awk '{print $1}')
fi
echo "[INFO] -- wGRR version ${VERSION}"
if [[ $BATCHFLAG == 0 ]] ; then
echo "[INFO] -- The command is:"
echo "[INFO] -- ./wGRR $@"
if [[ $THREADS -gt $(nproc) ]] ; then
echo "[ERROR] -- You required $THREADS threads but your machine has $(nproc) cores."
exit 1
......@@ -176,6 +165,8 @@ if [[ $BATCHFLAG == 0 ]] ; then
module load openmpi
fi
else
echo "[INFO] -- The command is:"
echo "[INFO] -- $(scontrol show job ${SLURM_JOBID} | awk '/ +Command/{n=split($0,a,"=");print a[n]}')"
if [[ ! -f wGRR_mem.awk ]] ; then
if [[ $ARRAYSIZE > 10000 ]] ; then
echo "[ERROR] -- awk script wGRR_mem.awk not found."
......@@ -184,6 +175,16 @@ else
fi
fi
if [[ ! -f wGRR.awk ]] ; then
echo "[ERROR] -- awk script wGRR.awk not found."
exit 1
fi
if [[ ! -f wGRR_worker.zsh ]] ; then
echo "[ERROR] -- awk script wGRR_worker.zsh not found."
exit 1
fi
## Check awk
if ! AWKEXE=$(command -v gawk) ; then
if ! AWKEXE=$(command -v awk) ; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment