Skip to content

Commit

Permalink
Fix explanation of early termination of StagedTaskCollection.
Browse files Browse the repository at this point in the history
In part 08 of the programmers' "workflow" tutorial.
  • Loading branch information
riccardomurri committed Nov 22, 2016
1 parent c6d3a06 commit 9bd8eee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 40 deletions.
Binary file modified docs/programmers/tutorials/workflows/part08.pdf
Binary file not shown.
53 changes: 13 additions & 40 deletions docs/programmers/tutorials/workflows/part08.tex
Expand Up @@ -181,8 +181,9 @@
def stage1(self):
if self.tasks[0].execution.exitcode != 0:
self.execution.exitcode = 1
return Run.State.TERMINATED
# set collection signal and exit code,
# and state to TERMINATED
return (0, 1)
else:
# run 2nd step
return Application(...)
Expand Down Expand Up @@ -273,8 +274,9 @@
def stage1(self):
~\HL{if self.tasks[0].execution.exitcode != 0:}~
self.execution.exitcode = 1
return Run.State.TERMINATED
# set collection signal and exit code,
# and state to TERMINATED
return (0, 1)
else:
# run 2nd step
return Application(...)
Expand Down Expand Up @@ -305,8 +307,9 @@
def stage1(self):
if self.tasks[0].execution.exitcode != 0:
self.execution.exitcode = 1
~\HL{return Run.State.TERMINATED}~
# set collection signal and exit code,
# and state to TERMINATED
~\HL{return (0, 1)}~
else:
# run 2nd step
return Application(...)
Expand All @@ -319,40 +322,10 @@
\begin{column}{0.4\textwidth}
\raggedleft
\+\+\+\+\+
To abort the sequence, return \texttt{Run.State.TERMINATED},
instead of a \texttt{Task} instance.
\end{column}
\end{columns}
\end{frame}
\begin{frame}[fragile]
\begin{columns}[c]
\begin{column}{0.6\textwidth}
\begin{lstlisting}
class Pipeline(StagedTaskCollection):
# ...
def stage1(self):
if self.tasks[0].execution.exitcode != 0:
~\HL{self.execution.exitcode = 1}~
return Run.State.TERMINATED
else:
# run 2nd step
return Application(...)
# ...
def stage~$N$~(self):
# ...
\end{lstlisting}
\end{column}
\begin{column}{0.4\textwidth}
\raggedleft
\+\+\+\+\+
Don't forget to set the \texttt{StagedTaskCollection}'s own exit
code if you do this.
\+\+\+\+\+
To abort the sequence, return an integer (termination
status) or a pair \emph{(signal, exit code)}, instead of a
\texttt{Task} instance.
\end{column}
\end{columns}
\end{frame}
Expand Down

0 comments on commit 9bd8eee

Please sign in to comment.