Skip to content

Commit

Permalink
- Added additional error checking and output to condor_submit_makeflow (
Browse files Browse the repository at this point in the history
#2097)

- Added documentation for condor_submit_makeflow
- Updated copyright boilerplate date.
  • Loading branch information
dthain committed Jul 17, 2019
1 parent 5ca2f41 commit 0ad24a2
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 4 deletions.
1 change: 1 addition & 0 deletions doc/index.html
Expand Up @@ -41,6 +41,7 @@ <h1>Cooperative Computing Tools Documentation</h1>
<li><a class="man" href="man/starch.html">starch(1)</a></li>
<li><a class="man" href="man/makeflow_ec2_setup.html">makeflow_ec2_setup(1)</a></li>
<li><a class="man" href="man/makeflow_ec2_cleanup.html">makeflow_ec2_cleanup(1)</a></li>
<li><a class="man" href="man/condor_submit_makeflow.html">condor_submit_makeflow(1)</a></li>
</ul>
<a href=jx-quick.html><b>JX Workflow Language</b></a><br>
<ul>
Expand Down
27 changes: 25 additions & 2 deletions doc/makeflow.html
Expand Up @@ -376,10 +376,33 @@ <h2>Table of Contents</h2>

<a name=htcondor><h3>HTCondor</h3></a>

<p>Use the <tt>-T condor</tt> option to submit jobs to the <a href=http://research.cs.wisc.edu/htcondor>HTCondor</a> batch system. (Formerly known as Condor.)</p>
<p>If running Makeflow directly from the command line, simply use the <tt>-T condor</tt> option to submit jobs to the <a href=http://research.cs.wisc.edu/htcondor>HTCondor</a> batch system.</p>

<p>If you have a long-running workflow, we recommend using <tt>condor_submit_makeflow</tt> like this:

<code>condor_submit_makeflow example.mf
Submitting example.mf as a background job to HTCondor...
Submitting job(s).
1 job(s) submitted to cluster 364.
Makeflow Output : makeflow.364.output
Makeflow Error : makeflow.364.error
Condor Log : makeflow.364.condorlog
</code>

<p>This will cause Makeflow itself to be submitted as a batch job itself,
so that it can be monitored by HTCondor, allowing you to log out and
return later to check the status of the workflow. You will see both
Makeflow and the jobs it runs in the HTCondor queue:</p>

<code> ID OWNER SUBMITTED RUN_TIME ST PRI SIZE CMD
10.0 dthain 7/17 13:03 0+00:00:05 R 0 1.7 makeflow -T condor
11.0 dthain 7/17 13:03 0+00:00:00 I 0 0.0 condor.sh myjob -p 1
. . .
</code>

<p>
Makeflow will automatically generate a submit file for each job.
Makeflow will automatically generate a submit file for each job,
so you don't need to write one.
However, if you would like to customize the Condor submit file,
use the <tt>-B</tt> option or <tt>BATCH_OPTIONS</tt> variable
to specify text to add to the submit file.</p>
Expand Down
39 changes: 39 additions & 0 deletions doc/man/condor_submit_makeflow.m4
@@ -0,0 +1,39 @@
include(manual.h)dnl
HEADER(condor_submit_makeflow)dnl

SECTION(NAME)
BOLD(condor_submit_makeflow) - submit workflow to HTCondor batch system

SECTION(SYNOPSIS)
LONGCODE_BEGIN
CODE(BOLD(condor_submit_makeflow [options] PARAM(workflow)))
LONGCODE_END

SECTION(DESCRIPTION)
CODE(condor_submit_makeflow) submits Makeflow itself as a batch job,
allowing HTCondor to monitor and control the job, so the user does
not need to remain logged in while the workflow runs. All options
given to condor_submit_makeflow are passed along to the underlying Makeflow.

SECTION(EXIT STATUS)
On success, returns zero. On failure, returns non-zero.

SECTION(EXAMPLE)
LONGCODE_BEGIN
condor_submit_makeflow example.mf

Submitting example.mf as a background job to HTCondor...
Submitting job(s).
1 job(s) submitted to cluster 364.
Makeflow Output : makeflow.364.output
Makeflow Error : makeflow.364.error
Condor Log : makeflow.364.condorlog
LONGCODE_END

SECTION(COPYRIGHT)
COPYRIGHT_BOILERPLATE

SECTION(SEE ALSO)
SEE_ALSO_MAKEFLOW

FOOTER
2 changes: 1 addition & 1 deletion doc/manual.h
@@ -1,6 +1,6 @@
ifdef(`HTML',`include(manual_html.h)',`include(manual_man.h)')dnl
changecom(`@@')dnl
define(COPYRIGHT_BOILERPLATE,The Cooperative Computing Tools are Copyright (C) 2003-2004 Douglas Thain and Copyright (C) 2005-2015 The University of Notre Dame. This software is distributed under the GNU General Public License. See the file COPYING for details.)dnl
define(COPYRIGHT_BOILERPLATE,The Cooperative Computing Tools are Copyright (C) 2003-2004 Douglas Thain and Copyright (C) 2005-2019 The University of Notre Dame. This software is distributed under the GNU General Public License. See the file COPYING for details.)dnl
dnl
define(SEE_ALSO_MAKEFLOW,
`LIST_BEGIN
Expand Down
29 changes: 28 additions & 1 deletion makeflow/src/condor_submit_makeflow
Expand Up @@ -13,7 +13,18 @@ then
exit 1
fi

condor_submit << EOF
submit=`which condor_submit`
if [ $? != 0 ]
then
echo "$0: Sorry, I cannot find condor_submit in your PATH."
exit 1
fi

echo "Submitting $@ as a background job to HTCondor..."

tempfile=`mktemp`

condor_submit << EOF > $tempfile
universe = scheduler
cmd = $makeflow
arguments = -T condor -l makeflow.\$(CLUSTER).makeflowlog -L makeflow.\$(CLUSTER).condorlog $@
Expand All @@ -23,3 +34,19 @@ log = makeflow.\$(CLUSTER).condorlog
getenv = true
queue
EOF

cat $tempfile

if [ $? = 0 ]
then
jobid=`cat $tempfile | grep -o 'cluster [0-9]\+' | cut -c 9-`
echo "Makeflow Output : makeflow.$jobid.output"
echo "Makeflow Error : makeflow.$jobid.error"
echo "Condor Log : makeflow.$jobid.condorlog"
rm $tempfile
exit 0
else
echo "Job submission failed!"
exit 1
fi

0 comments on commit 0ad24a2

Please sign in to comment.