Commit 9f209829 by Riccardo Vicedomini

input SGE parameters are now handled

parent aa4b9770
......@@ -35,7 +35,7 @@ NTHREADS=1
NJOBS=16
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 " MANDATORY OPTIONS:\n
-i, --input <path>\tInput file of AA sequences in FASTA format\n
......@@ -56,18 +56,26 @@ function print_usage() {
" | column -t -s $'\t'
echo -en "\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
-t, --threads <num>\tNumber of threads for each job (default:${NTHREADS})\n
-h, --help\tPrint this help message\n
-V, --version\tPrint version\n" | column -t -s $'\t'
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
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}" -- "${@}")
if [ $? -ne 0 ] || [ $# -eq 0 ]; then # do not change the order of this test!
print_usage
......@@ -108,9 +116,6 @@ while [ -n "${1}" ]; do
shift
MCLADE_WORKDIR=${1}
;;
--SGE)
MCLADE_USESGE=true
;;
-t|--threads)
shift
NTHREADS=${1}
......@@ -127,6 +132,21 @@ while [ -n "${1}" ]; do
print_version
exit 0
;;
--sge)
MCLADE_USESGE=true
;;
--pe)
shift
SGE_PENAME=${1}
;;
--queue)
shift
SGE_QUEUE=${1}
;;
--time-limit)
shift
SGE_TIMELIM=${1}
;;
--)
shift
break
......@@ -185,7 +205,7 @@ check_cmds "python3"
# Validate SGE parameters
if [ "${MCLADE_USESGE}" = true ] ; 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
fi
if [ ! -z ${SGE_QUEUE} ]; then
......@@ -238,8 +258,7 @@ if [ "${MCLADE_USESGE}" = true ] ; then
# submit filter jobs
print_status "submitting filter ijobs"
unset pidarr
pidarr=()
unset pidarr; pidarr=()
for i in $(seq 1 ${NJOBS}); do
f="${MCLADE_WORKDIR}/jobs/1_filter/${MCLADE_JOBNAME}_${i}.sh"
# 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