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

optional fast qos submission

parent 6f1a9c58
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ display_usage() { ...@@ -19,7 +19,7 @@ display_usage() {
echo "${bold}USAGE:${normal} $ZSH_ARGZERO -f <fasta_file> [OPTIONS]" echo "${bold}USAGE:${normal} $ZSH_ARGZERO -f <fasta_file> [OPTIONS]"
echo "" echo ""
echo "${bold}MANDATORY PARAMETERS:${normal}" echo "${bold}MANDATORY PARAMETERS:${normal}"
echo " -f <string> fasta file with all proteins of all the compared genetic elements." echo " -i <string> fasta file with all proteins of all the compared genetic elements."
echo " All identifiers must be formatted as:" echo " All identifiers must be formatted as:"
echo " >element_identifier_XXX" echo " >element_identifier_XXX"
echo " where XXX is a serie of numbers unique for each protein of each element." echo " where XXX is a serie of numbers unique for each protein of each element."
...@@ -44,6 +44,8 @@ display_usage() { ...@@ -44,6 +44,8 @@ display_usage() {
echo " Only applicable to Maestro, for the wGRR calculation step." echo " Only applicable to Maestro, for the wGRR calculation step."
echo " default: not set" echo " default: not set"
echo " -T Test run. Useful to get stats on the input file and correctly set the -a parameter." echo " -T Test run. Useful to get stats on the input file and correctly set the -a parameter."
echo " -f In sbatch mode, will use the fast QOS (jobs limited to 2 hours)"
echo " Warning: be sure the jobs will run under 2 hours otherwise they will fail."
echo "" echo ""
echo "${bold}DESCRIPTION:${normal}" echo "${bold}DESCRIPTION:${normal}"
echo "This pipeline will do all proteins pairwise comparisons using the MMseqs2 software and then process " echo "This pipeline will do all proteins pairwise comparisons using the MMseqs2 software and then process "
...@@ -90,7 +92,7 @@ textifyDuration() { ...@@ -90,7 +92,7 @@ textifyDuration() {
} }
## parameters initialization ## parameters initialization
PRT="N.O.P.R.T" ## -f PRT="N.O.P.R.T" ## -i
MMPATH="N.O.P.A.T.H" ## -p MMPATH="N.O.P.A.T.H" ## -p
OUT="N.O.O.U.T" ## -o OUT="N.O.O.U.T" ## -o
THREADS=1 ## -t THREADS=1 ## -t
...@@ -102,17 +104,19 @@ MMS_DEF_MAX_SEQS=300 ...@@ -102,17 +104,19 @@ MMS_DEF_MAX_SEQS=300
MIDENT=0 MIDENT=0
MMS_MAX_SEQ_PARAM="" MMS_MAX_SEQ_PARAM=""
TESTRUN=0 ## -T TESTRUN=0 ## -T
FAST=0 ## -f
## catch option values ## catch option values
while getopts :Tf:p:o:t:a:m: option ; do while getopts :fTi:p:o:t:a:m: option ; do
case $option in case $option in
f) PRT="$OPTARG"; if [ ! -f $PRT ]; then echo "[ERROR] -- fasta file '$PRT' not found (option -f)." ; exit 1 ; fi ;; i) PRT="$OPTARG"; if [ ! -f $PRT ]; then echo "[ERROR] -- fasta file '$PRT' not found (option -f)." ; exit 1 ; fi ;;
p) MMPATH="$OPTARG" ;; p) MMPATH="$OPTARG" ;;
o) OUT="$OPTARG"; if [ -f "$OUT".wgrr.final.txt ]; then echo "[ERROR] -- file $OUT.wgrr.final.txt already exists. Change option -o or remove this file and relaunch." ; exit 1 ; fi ;; o) OUT="$OPTARG"; if [ -f "$OUT".wgrr.final.txt ]; then echo "[ERROR] -- file $OUT.wgrr.final.txt already exists. Change option -o or remove this file and relaunch." ; exit 1 ; fi ;;
t) THREADS="$OPTARG"; if [[ ! $THREADS =~ ^[0-9]+$ ]]; then echo "[ERROR] -- number of threads $THREADS must be an integer (option -t)." ; exit 1 ; fi ;; t) THREADS="$OPTARG"; if [[ ! $THREADS =~ ^[0-9]+$ ]]; then echo "[ERROR] -- number of threads $THREADS must be an integer (option -t)." ; exit 1 ; fi ;;
a) ARRAYSIZE="$OPTARG"; if [[ ! $ARRAYSIZE =~ ^[0-9]+$ ]]; then echo "[ERROR] -- number of genomes comparisons $ARRAYSIZE must be an integer (option -a)." ; exit 1 ; fi ;; a) ARRAYSIZE="$OPTARG"; if [[ ! $ARRAYSIZE =~ ^[0-9]+$ ]]; then echo "[ERROR] -- number of genomes comparisons $ARRAYSIZE must be an integer (option -a)." ; exit 1 ; fi ;;
m) MAXJOBS="$OPTARG"; if [[ ! $MAXJOBS =~ ^[0-9]+$ ]]; then echo "[ERROR] -- max number of simulteaneous jobs $MAXJOBS must be an integer (option -m)." ; exit 1 ; fi ;; m) MAXJOBS="$OPTARG"; if [[ ! $MAXJOBS =~ ^[0-9]+$ ]]; then echo "[ERROR] -- max number of simulteaneous jobs $MAXJOBS must be an integer (option -m)." ; exit 1 ; fi ;;
T) TESTRUN=1 ;; T) TESTRUN=1 ;;
f) FAST=1 ;;
:) echo "option $OPTARG : missing argument" ; exit 1 ;; :) echo "option $OPTARG : missing argument" ; exit 1 ;;
\?) echo "$OPTARG : invalid option" ; exit 1 ;; \?) echo "$OPTARG : invalid option" ; exit 1 ;;
esac esac
...@@ -321,6 +325,9 @@ else ...@@ -321,6 +325,9 @@ else
else else
JOBARRAY="1-${NJOBS}" JOBARRAY="1-${NJOBS}"
fi fi
if [[ $FAST == 1 ]] ; then
PARTITION="fast,dedicated"
fi
JID=$(sbatch --parsable --wait -p "$PARTITION" --array="$JOBARRAY" -c 1 -J "wGRR_worker" --mem=$REQMEM --wrap="./wGRR_worker.zsh $ARRAYSIZE $OUT $NJOBS 1 $PRT $tmp") JID=$(sbatch --parsable --wait -p "$PARTITION" --array="$JOBARRAY" -c 1 -J "wGRR_worker" --mem=$REQMEM --wrap="./wGRR_worker.zsh $ARRAYSIZE $OUT $NJOBS 1 $PRT $tmp")
PQT=$(sacct -X -j $JID -o Reserved -n | awk 'NR==1{prevt=0}{t=0;n=split($1,a,"-");if(n>1){t=t+a[1]*86400};split(a[n],b,":");t=t+b[1]*3600+b[2]*60+b[3];if(t<prevt){tt=tt+prevt}prevt=t}END{print tt+t}') PQT=$(sacct -X -j $JID -o Reserved -n | awk 'NR==1{prevt=0}{t=0;n=split($1,a,"-");if(n>1){t=t+a[1]*86400};split(a[n],b,":");t=t+b[1]*3600+b[2]*60+b[3];if(t<prevt){tt=tt+prevt}prevt=t}END{print tt+t}')
printf "%-10s -- %s %s %s %s %s\n" "[INFO]" "The job" $JID "has been" $(textifyDuration $PQT) "in queue" | tee -a ${OUT}.wgrr.log printf "%-10s -- %s %s %s %s %s\n" "[INFO]" "The job" $JID "has been" $(textifyDuration $PQT) "in queue" | tee -a ${OUT}.wgrr.log
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment