Commit b46f6d15 by Riccardo Vicedomini

first working implementation of MetaCLADE with SGE support

parent f1060fcf
...@@ -243,19 +243,19 @@ if [ "${MCLADE_USESGE}" = true ] ; then ...@@ -243,19 +243,19 @@ if [ "${MCLADE_USESGE}" = true ] ; then
f="${MCLADE_WORKDIR}/jobs/1_search/${MCLADE_JOBNAME}_${i}.sh" f="${MCLADE_WORKDIR}/jobs/1_search/${MCLADE_JOBNAME}_${i}.sh"
# run a qsub job for each non-empty script # run a qsub job for each non-empty script
if [ -f "${f}" ] && [ -s "${f}" ]; then if [ -f "${f}" ] && [ -s "${f}" ]; then
qsub $SGE_QUEUEARG $SGE_TIMELIMARG -e "${MCLADE_WORKDIR}/log/search_${i}.err" -o "${MCLADE_WORKDIR}/log/search_${i}.out" -cwd -sync yes -N ${MCLADE_JOBNAME} -pe ${SGE_PENAME} ${NTHREADS} -b y ${PEXEC_CMD} ${f} & CMD="${PEXEC_CMD} ${f}"
qsub $SGE_QUEUEARG $SGE_TIMELIMARG -e ${MCLADE_WORKDIR}/log/search_${i}.err -o ${MCLADE_WORKDIR}/log/search_${i}.out -cwd -sync yes -N ${MCLADE_JOBNAME} -pe ${SGE_PENAME} ${NTHREADS} -b y "${CMD}" 2>&1 >"${MCLADE_WORKDIR}/log/search_qsub_${i}.log" &
pid=$! pid=$!
pidarr[$i]=$pid pidarr[$i]=$pid
((i++))
fi fi
done done
# wait search jobs to finish # wait search jobs to finish
print_status "waiting the search jobs to finish" print_status "waiting the search jobs to finish"
for i in ${!pidtab[@]}; do for i in ${!pidarr[@]}; do
wait ${pidtab[${i}]} wait ${pidarr[${i}]}
ret=$? pret=$?
if ((ret != 0)); then if ((pret != 0)); then
echo "MetaCLADE search job ${i} failed (exit status: ${ret})" echo "search job ${i} failed (exit status: ${pret})"
exit 1 exit 1
fi fi
done done
...@@ -268,19 +268,19 @@ if [ "${MCLADE_USESGE}" = true ] ; then ...@@ -268,19 +268,19 @@ if [ "${MCLADE_USESGE}" = true ] ; then
f="${MCLADE_WORKDIR}/jobs/2_filter/${MCLADE_JOBNAME}_${i}.sh" f="${MCLADE_WORKDIR}/jobs/2_filter/${MCLADE_JOBNAME}_${i}.sh"
# run a qsub job for each non-empty script # run a qsub job for each non-empty script
if [ -f "${f}" ] && [ -s "${f}" ]; then if [ -f "${f}" ] && [ -s "${f}" ]; then
qsub $SGE_QUEUEARG $SGE_TIMELIMARG -e "${MCLADE_WORKDIR}/log/filter_${i}.err" -o "${MCLADE_WORKDIR}/log/filter_${i}.out" -cwd -sync yes -N ${MCLADE_JOBNAME} -pe ${SGE_PENAME} ${NTHREADS} -b y ${PEXEC_CMD} ${f} & CMD="${PEXEC_CMD} ${f}"
qsub $SGE_QUEUEARG $SGE_TIMELIMARG -e "${MCLADE_WORKDIR}/log/filter_${i}.err" -o "${MCLADE_WORKDIR}/log/filter_${i}.out" -cwd -sync yes -N ${MCLADE_JOBNAME} -pe ${SGE_PENAME} ${NTHREADS} -b y "${CMD}" 2>&1 >"${MCLADE_WORKDIR}/log/filter_qsub_${i}.log" &
pid=$! pid=$!
pidarr[$i]=$pid pidarr[$i]=$pid
((i++))
fi fi
done done
# wait search jobs to finish # wait search jobs to finish
print_status "waiting the filter jobs to finish" print_status "waiting the filter jobs to finish"
for i in ${!pidtab[@]}; do for i in ${!pidarr[@]}; do
wait ${pidtab[${i}]} wait ${pidarr[${i}]}
ret=$? pret=$?
if ((ret != 0)); then if ((pret != 0)); then
echo "MetaCLADE filter job ${i} failed (exit status: ${ret})" echo "filter job ${i} failed (exit status: ${pret})"
exit 1 exit 1
fi fi
done done
...@@ -289,10 +289,10 @@ if [ "${MCLADE_USESGE}" = true ] ; then ...@@ -289,10 +289,10 @@ if [ "${MCLADE_USESGE}" = true ] ; then
# create architecture # create architecture
print_status "computing architecture" print_status "computing architecture"
f="${MCLADE_WORKDIR}/jobs/3_arch/${MCLADE_JOBNAME}.sh" f="${MCLADE_WORKDIR}/jobs/3_arch/${MCLADE_JOBNAME}.sh"
qsub $SGE_QUEUEARG $SGE_TIMELIMARG -e "${MCLADE_WORKDIR}/log/arch.err" -o "${MCLADE_WORKDIR}/log/arch.out" -cwd -sync yes -N ${MCLADE_JOBNAME} -pe ${SGE_PENAME} 1 -b y ${PEXEC_CMD} ${f} qsub $SGE_QUEUEARG $SGE_TIMELIMARG -e "${MCLADE_WORKDIR}/log/arch.err" -o "${MCLADE_WORKDIR}/log/arch.out" -cwd -sync yes -N ${MCLADE_JOBNAME} -pe ${SGE_PENAME} 1 -b y ${PEXEC_CMD} ${f} 2>&1 >>"${MCLADE_WORKDIR}/log/arch_qsub.log"
qret=$? qret=$?
if ((qret != 0)); then if ((qret != 0)); then
echo "error during MetaCLADE architecture step ($qret)" echo "architecture job failed (exit status: ${qret})"
exit 1 exit 1
fi fi
print_status "architecture job finished successfully" print_status "architecture job finished successfully"
......
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