Commit 9f209829 by Riccardo Vicedomini

input SGE parameters are now handled

parent aa4b9770
...@@ -35,7 +35,7 @@ NTHREADS=1 ...@@ -35,7 +35,7 @@ NTHREADS=1
NJOBS=16 NJOBS=16
function print_usage() { function print_usage() {
echo -en "\n USAGE: ${CMD_NAME} -i <input_fasta> [options]\n" echo -en "\n USAGE: ${CMD_NAME} -i <input_fasta> -N <name> [options]\n"
echo -en "\n" echo -en "\n"
echo -en " MANDATORY OPTIONS:\n echo -en " MANDATORY OPTIONS:\n
-i, --input <path>\tInput file of AA sequences in FASTA format\n -i, --input <path>\tInput file of AA sequences in FASTA format\n
...@@ -56,18 +56,26 @@ function print_usage() { ...@@ -56,18 +56,26 @@ function print_usage() {
" | column -t -s $'\t' " | column -t -s $'\t'
echo -en "\n" echo -en "\n"
echo -en " OTHER OPTIONS:\n echo -en " OTHER OPTIONS:\n
--SGE\tRun MetaCLADE jobs on a SGE HPC environment\n
-t, --threads <num>\tNumber of threads for each job (default:${NTHREADS})\n
-j, --jobs <num>\tNumber of jobs to be created (default:${NJOBS})\n -j, --jobs <num>\tNumber of jobs to be created (default:${NJOBS})\n
-t, --threads <num>\tNumber of threads for each job (default:${NTHREADS})\n
-h, --help\tPrint this help message\n -h, --help\tPrint this help message\n
-V, --version\tPrint version\n" | column -t -s $'\t' -V, --version\tPrint version\n" | column -t -s $'\t'
echo -en "\n" echo -en "\n"
echo -en " SGE OPTIONS:\n
--sge\tRun MetaCLADE jobs on a SGE HPC environment\n
--pe <name>\tParallel environment to use (mandatory)\n
--queue <name>\tName of a specific queue where jobs are submitted\n
--time-limit <hh:mm:ss>\tTime limit for submitted jobs formatted as hh:mm:ss\n
\twhere hh, mm, ss represent hours, minutes, and seconds respectively\n
\t(e.g., use --time-limit 2:30:00 for setting a limit of 2h and 30m)\n
" | column -t -s $'\t'
echo -en "\n"
} }
# retrieve provided arguments # retrieve provided arguments
opts="i:N:ad:D:e:E:W:t:j:hV" opts="i:N:ad:D:e:E:W:t:j:hV"
longopts="input:,name:,arch,domain-list:,domain-file:,evalue-cutoff:,evalue-cutconf:,work-dir,SGE,threads:,jobs:,help,version" longopts="input:,name:,arch,domain-list:,domain-file:,evalue-cutoff:,evalue-cutconf:,work-dir,threads:,jobs:,help,version,sge,pe:,queue:,time-limit:"
ARGS=$(getopt -o "${opts}" -l "${longopts}" -n "${CMD_NAME}" -- "${@}") ARGS=$(getopt -o "${opts}" -l "${longopts}" -n "${CMD_NAME}" -- "${@}")
if [ $? -ne 0 ] || [ $# -eq 0 ]; then # do not change the order of this test! if [ $? -ne 0 ] || [ $# -eq 0 ]; then # do not change the order of this test!
print_usage print_usage
...@@ -108,9 +116,6 @@ while [ -n "${1}" ]; do ...@@ -108,9 +116,6 @@ while [ -n "${1}" ]; do
shift shift
MCLADE_WORKDIR=${1} MCLADE_WORKDIR=${1}
;; ;;
--SGE)
MCLADE_USESGE=true
;;
-t|--threads) -t|--threads)
shift shift
NTHREADS=${1} NTHREADS=${1}
...@@ -127,6 +132,21 @@ while [ -n "${1}" ]; do ...@@ -127,6 +132,21 @@ while [ -n "${1}" ]; do
print_version print_version
exit 0 exit 0
;; ;;
--sge)
MCLADE_USESGE=true
;;
--pe)
shift
SGE_PENAME=${1}
;;
--queue)
shift
SGE_QUEUE=${1}
;;
--time-limit)
shift
SGE_TIMELIM=${1}
;;
--) --)
shift shift
break break
...@@ -185,7 +205,7 @@ check_cmds "python3" ...@@ -185,7 +205,7 @@ check_cmds "python3"
# Validate SGE parameters # Validate SGE parameters
if [ "${MCLADE_USESGE}" = true ] ; then if [ "${MCLADE_USESGE}" = true ] ; then
if [ -z ${SGE_PENAME} ]; then if [ -z ${SGE_PENAME} ]; then
print_error "you must set a parallel environment name with -P|--parallel-env option along with the --SGE option" print_error "you must set a parallel environment name with -P|--pe option along with the --sge option"
exit 1 exit 1
fi fi
if [ ! -z ${SGE_QUEUE} ]; then if [ ! -z ${SGE_QUEUE} ]; then
...@@ -238,8 +258,7 @@ if [ "${MCLADE_USESGE}" = true ] ; then ...@@ -238,8 +258,7 @@ if [ "${MCLADE_USESGE}" = true ] ; then
# submit filter jobs # submit filter jobs
print_status "submitting filter ijobs" print_status "submitting filter ijobs"
unset pidarr unset pidarr; pidarr=()
pidarr=()
for i in $(seq 1 ${NJOBS}); do for i in $(seq 1 ${NJOBS}); do
f="${MCLADE_WORKDIR}/jobs/1_filter/${MCLADE_JOBNAME}_${i}.sh" f="${MCLADE_WORKDIR}/jobs/1_filter/${MCLADE_JOBNAME}_${i}.sh"
# run a qsub job for each non-empty script # run a qsub job for each non-empty script
......
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