Skip to content

Commit

Permalink
New part 10 on DependentTaskCollections
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardomurri committed Jul 14, 2016
1 parent 76b755b commit b5ba47b
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 0 deletions.
Binary file added docs/programmers/tutorials/workflows/part10.pdf
Binary file not shown.
151 changes: 151 additions & 0 deletions docs/programmers/tutorials/workflows/part10.tex
@@ -0,0 +1,151 @@
\documentclass[english,serif,mathserif,xcolor=pdftex,dvipsnames,table]{beamer}
\usetheme{gc3}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\usepackage{gc3}

\title[Advanced workflows]{%
More on workflows
}
\author[R. Murri, S3IT UZH]{%
Riccardo Murri \texttt{<riccardo.murri@uzh.ch>}
\\[1ex]
\emph{S3IT: Services and Support for Science IT}
\\[1ex]
University of Zurich
}
\date{July~11--14, 2016}

\begin{document}

% title frame
\maketitle


\begin{frame}[fragile]
\frametitle{Automatic arrangement of tasks}

Want to avoid arranging tasks in parallel- and sequential- task collections?
Use a \texttt{DepedentTaskCollection}!

\+
\begin{python}
from gc3libs.workflow \
import DependentTaskCollection

class MyWorkflow~\HL{(DependentTaskCollection)}~:
# ...
def __init__(self, ...):
DependentTaskCollection.__init__(self)
app1 = AnApp(...)
app2 = AnotherApp(...)
app3 = AThirdApp(...)
self.add(app1)
self.add(app2)
self.add(app3, after=[app1, app2])
\end{python}
\end{frame}


\begin{frame}[fragile]
\frametitle{Usage of DependentTaskCollection}

\begin{python}
from gc3libs.workflow \
import DependentTaskCollection

class MyWorkflow(DependentTaskCollection):
# ...
def __init__(self, ...):
~\HL{DependentTaskCollection.\_\_init\_\_(self)}~
app1 = AnApp(...)
app2 = AnotherApp(...)
app3 = AThirdApp(...)
self.add(app1)
self.add(app2)
self.add(app3, after=[app1, app2])
\end{python}

\+
Initialize the base class.
\end{frame}

\begin{frame}[fragile]
\frametitle{Usage of DependentTaskCollection}

\begin{python}
from gc3libs.workflow \
import DependentTaskCollection

class MyWorkflow(DependentTaskCollection):
# ...
def __init__(self, ...):
DependentTaskCollection.__init__(self)
~\HL{app1 = AnApp(...)}~
~\HL{app2 = AnotherApp(...)}~
~\HL{app3 = AThirdApp(...)}~
self.add(app1)
self.add(app2)
self.add(app3, after=[app1, app2])
\end{python}

\+
\ldots then initialize tasks that you want to run \ldots
\end{frame}


\begin{frame}[fragile]
\frametitle{Usage of DependentTaskCollection}

\begin{python}
from gc3libs.workflow \
import DependentTaskCollection

class MyWorkflow(DependentTaskCollection):
# ...
def __init__(self, ...):
DependentTaskCollection.__init__(self)
app1 = AnApp(...)
app2 = AnotherApp(...)
app3 = AThirdApp(...)
~\HL{self.add(app1)}~
~\HL{self.add(app2)}~
~\HL{self.add(app3, after=[app1, app2])}~
\end{python}

\+
\ldots then add tasks to the collection, one by one\ldots
\end{frame}


\begin{frame}[fragile]
\frametitle{Usage of DependentTaskCollection}

\begin{python}
from gc3libs.workflow \
import DependentTaskCollection

class MyWorkflow(DependentTaskCollection):
# ...
def __init__(self, ...):
DependentTaskCollection.__init__(self)
app1 = AnApp(...)
app2 = AnotherApp(...)
app3 = AThirdApp(...)
self.add(app1)
self.add(app2)
self.add(app3, ~\HL{after=[app1, app2]}~)
\end{python}

\+
\ldots specifying dependencies among them.
\end{frame}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

0 comments on commit b5ba47b

Please sign in to comment.