Commit b46f6d15 by Riccardo Vicedomini

first working implementation of MetaCLADE with SGE support

parent f1060fcf
......@@ -243,19 +243,19 @@ if [ "${MCLADE_USESGE}" = true ] ; then
f="${MCLADE_WORKDIR}/jobs/1_search/${MCLADE_JOBNAME}_${i}.sh"
# run a qsub job for each non-empty script
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=$!
pidarr[$i]=$pid
((i++))
fi
done
# wait search jobs to finish
print_status "waiting the search jobs to finish"
for i in ${!pidtab[@]}; do
wait ${pidtab[${i}]}
ret=$?
if ((ret != 0)); then
echo "MetaCLADE search job ${i} failed (exit status: ${ret})"
for i in ${!pidarr[@]}; do
wait ${pidarr[${i}]}
pret=$?
if ((pret != 0)); then
echo "search job ${i} failed (exit status: ${pret})"
exit 1
fi
done
......@@ -268,19 +268,19 @@ if [ "${MCLADE_USESGE}" = true ] ; then
f="${MCLADE_WORKDIR}/jobs/2_filter/${MCLADE_JOBNAME}_${i}.sh"
# run a qsub job for each non-empty script
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=$!
pidarr[$i]=$pid
((i++))
fi
done
# wait search jobs to finish
print_status "waiting the filter jobs to finish"
for i in ${!pidtab[@]}; do
wait ${pidtab[${i}]}
ret=$?
if ((ret != 0)); then
echo "MetaCLADE filter job ${i} failed (exit status: ${ret})"
for i in ${!pidarr[@]}; do
wait ${pidarr[${i}]}
pret=$?
if ((pret != 0)); then
echo "filter job ${i} failed (exit status: ${pret})"
exit 1
fi
done
......@@ -289,10 +289,10 @@ if [ "${MCLADE_USESGE}" = true ] ; then
# create architecture
print_status "computing architecture"
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=$?
if ((qret != 0)); then
echo "error during MetaCLADE architecture step ($qret)"
echo "architecture job failed (exit status: ${qret})"
exit 1
fi
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