├── 2017.03.26-Naiad ├── demo │ ├── .gitignore │ ├── Cargo.toml │ └── src │ │ └── main.rs └── naiad-pwl-zurich.pdf ├── 2017.04.27-Cilk5 ├── .gitignore ├── Makefile ├── figs │ ├── back.png │ ├── backtofuture.jpeg │ ├── backtofuture.jpg │ ├── cilk-cactus-spawn.pdf │ ├── cilk-cactus-spawn.tex │ ├── cilk-cactus-stack.pdf │ ├── cilk-cactus-stack.tex │ ├── cilk-machines.png │ ├── cilk-smp.png │ ├── jiggy.png │ ├── last_time.jpg │ └── simplified-the.png ├── pwl-cilk5.pdf └── pwl-cilk5.tex ├── 2017.06.29-Raft └── pwl-raft-trivedi.pdf ├── README.md ├── code-of-conduct.md └── paper_ideas.md /2017.03.26-Naiad/demo/.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /2017.03.26-Naiad/demo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "pwl" 3 | version = "0.1.0" 4 | 5 | [dependencies] 6 | abomonation = "*" 7 | time = "*" 8 | timely = "*" 9 | itertools = "0.5.9" 10 | -------------------------------------------------------------------------------- /2017.03.26-Naiad/demo/src/main.rs: -------------------------------------------------------------------------------- 1 | extern crate time; 2 | extern crate timely; 3 | extern crate itertools; 4 | 5 | use std::collections::HashMap; 6 | 7 | use timely::dataflow::*; 8 | use timely::dataflow::operators::*; 9 | use timely::dataflow::channels::pact::Exchange; 10 | 11 | use itertools::Itertools; 12 | 13 | fn main() { 14 | 15 | ::timely::execute_from_args(std::env::args(), move |root| { 16 | 17 | let index = root.index(); 18 | 19 | let start = time::precise_time_s(); 20 | 21 | let mut edges = vec![ 22 | ('a', 'b'), 23 | ('a', 'c'), 24 | ('c', 'b'), 25 | ('b', 'd'), 26 | ('b', 'e'), 27 | ]; 28 | 29 | let edges_map: HashMap> = edges.drain(..) 30 | .group_by(|&(src, _)| src).into_iter() 31 | .map(|(src, group)| (src, group.collect::>())) 32 | .collect(); 33 | 34 | if index == 0 { 35 | println!("{:?}", edges_map); 36 | } 37 | 38 | let roots = vec!['a']; 39 | 40 | root.scoped::(|scope| { 41 | let root_input_stream: Stream<_, char> = if index == 0 { 42 | roots.to_stream(scope) 43 | } else { 44 | vec![].to_stream(scope) 45 | }; 46 | let output_stream = scope.scoped::(|inner| { 47 | let (loop_handle, root_feedback_stream): (_, Stream<_, char>) = inner.loop_variable(std::u64::MAX, 1); 48 | let root_input_stream = root_input_stream.enter(inner); 49 | let root_forward_stream = root_feedback_stream.concat(&root_input_stream); 50 | let edge_stream: Stream<_, (char, char)> = root_forward_stream.unary_stream( 51 | Exchange::new(|src| *src as u64), 52 | "Lookup", 53 | move |input, output| { 54 | input.for_each(|cap, data| { 55 | for src in data.drain(..) { 56 | if let Some(values) = edges_map.get(&src) { 57 | output.session(&cap).give_iterator(values.iter().cloned()); 58 | } 59 | } 60 | }); 61 | }); 62 | edge_stream 63 | .map(|(_, dst)| dst) 64 | .inspect_batch(move |ts, x| println!("loop: [{:?}] {:?} -> {:?}", index, ts, x)) 65 | .connect_loop(loop_handle); 66 | edge_stream.leave() 67 | }); 68 | output_stream.inspect_batch(move |ts, x| println!("output: [{:?}] {:?} -> {:?}", index, ts, x)); 69 | }); 70 | }).unwrap(); 71 | 72 | } 73 | 74 | -------------------------------------------------------------------------------- /2017.03.26-Naiad/naiad-pwl-zurich.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.03.26-Naiad/naiad-pwl-zurich.pdf -------------------------------------------------------------------------------- /2017.04.27-Cilk5/.gitignore: -------------------------------------------------------------------------------- 1 | pwl-cilk5.aux 2 | pwl-cilk5.fdb_latexmk 3 | pwl-cilk5.fls 4 | pwl-cilk5.log 5 | pwl-cilk5.nav 6 | pwl-cilk5.out 7 | pwl-cilk5.snm 8 | pwl-cilk5.toc 9 | pwl-cilk5.vrb 10 | -------------------------------------------------------------------------------- /2017.04.27-Cilk5/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: pwl-cilk5.pdf 2 | 3 | pwl-cilk5.pdf: 4 | latexmk --xelatex pwl-cilk5.tex 5 | -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/back.png -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/backtofuture.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/backtofuture.jpeg -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/backtofuture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/backtofuture.jpg -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/cilk-cactus-spawn.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/cilk-cactus-spawn.pdf -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/cilk-cactus-spawn.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage{tikz} 4 | \usepackage{color} 5 | \usetikzlibrary{fit,shapes,positioning,backgrounds,calc,patterns,scopes,decorations,chains,arrows} 6 | 7 | \thispagestyle{empty} 8 | 9 | \tikzset{fn-inact/.style={ 10 | rectangle, fill=black!20, thick, draw=black, 11 | rounded corners=1ex,minimum height=2.5cm, minimum width=1.8cm 12 | }} 13 | 14 | \tikzset{fn-activ/.style={ 15 | rectangle, fill=green!30, thick, draw=black, 16 | rounded corners=1ex,minimum height=2.5cm, minimum width=1.8cm 17 | }} 18 | 19 | \setlength{\parskip}{0pt} 20 | 21 | \newenvironment{sItemize}{ 22 | \begin{list}{-}{\leftmargin=1em\itemsep=0em\parskip=0pt\parsep=0pt} 23 | }{\end{list}} 24 | 25 | \definecolor{lightblue}{rgb}{0.68,0.85,0.90} 26 | \definecolor{red3}{rgb}{0.80,0.00,0.00} 27 | \definecolor{purple}{rgb}{0.63,0.13,0.94} 28 | 29 | 30 | 31 | \begin{document} 32 | \begin{tikzpicture} 33 | [every node/.style={minimum width=1cm, rectangle,draw,thick}, edge from parent/.style={draw,-stealth,very thick}] 34 | \node[fill=red3] {A} 35 | child { node[fill=green] {B} } 36 | child { node[fill=lightblue] {C} 37 | child { node[fill=orange] {D} } 38 | child { node[fill=purple] {E} } 39 | }; 40 | \end{tikzpicture} 41 | \end{document} 42 | -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/cilk-cactus-stack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/cilk-cactus-stack.pdf -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/cilk-cactus-stack.tex: -------------------------------------------------------------------------------- 1 | \documentclass{article} 2 | 3 | \usepackage{tikz} 4 | \usepackage{color} 5 | \usetikzlibrary{fit,shapes,positioning,backgrounds,calc,patterns,scopes,decorations,chains,arrows} 6 | 7 | \thispagestyle{empty} 8 | 9 | \tikzset{fn-inact/.style={ 10 | rectangle, fill=black!20, thick, draw=black, 11 | rounded corners=1ex,minimum height=2.5cm, minimum width=1.8cm 12 | }} 13 | 14 | \tikzset{fn-activ/.style={ 15 | rectangle, fill=green!30, thick, draw=black, 16 | rounded corners=1ex,minimum height=2.5cm, minimum width=1.8cm 17 | }} 18 | 19 | \setlength{\parskip}{0pt} 20 | 21 | \newenvironment{sItemize}{ 22 | \begin{list}{-}{\leftmargin=1em\itemsep=0em\parskip=0pt\parsep=0pt} 23 | }{\end{list}} 24 | 25 | \definecolor{lightblue}{rgb}{0.68,0.85,0.90} 26 | \definecolor{red3}{rgb}{0.80,0.00,0.00} 27 | \definecolor{purple}{rgb}{0.63,0.13,0.94} 28 | 29 | 30 | \begin{document} 31 | 32 | \begin{tikzpicture}[every node/.style={minimum width=1cm, rectangle,draw,thick}] 33 | \node[draw=none] (a) at (0,0) {A}; 34 | \node[fill=red3,below=5pt of a] {A}; 35 | 36 | \node[right=1cm of a,draw=none] (b) {B}; 37 | \node[fill=red3,below=5pt of b] (b1) {A}; 38 | \node[fill=green,below=1pt of b1,minimum height=1.1cm] {B}; 39 | 40 | \node[right=1cm of b,draw=none] (c) {C}; 41 | \node[fill=red3,below=5pt of c] (c1) {A}; 42 | \node[fill=lightblue,below=1pt of c1,minimum height=.7cm] {C}; 43 | 44 | \node[right=1cm of c,draw=none] (d) {D}; 45 | \node[fill=red3,below=5pt of d] (d1) {A}; 46 | \node[fill=lightblue,below=1pt of d1,minimum height=.7cm] (d2) {C}; 47 | \node[fill=orange,below=1pt of d2,minimum height=1cm] {D}; 48 | 49 | \node[right=1cm of d,draw=none] (e) {E}; 50 | \node[fill=red3,below=5pt of e] (e1) {A}; 51 | \node[fill=lightblue,below=1pt of e1,minimum height=.7cm] (e2) {C}; 52 | \node[fill=purple,below=1pt of e2,minimum height=1.3cm] {E}; 53 | \end{tikzpicture} 54 | 55 | \end{document} 56 | -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/cilk-machines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/cilk-machines.png -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/cilk-smp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/cilk-smp.png -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/jiggy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/jiggy.png -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/last_time.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/last_time.jpg -------------------------------------------------------------------------------- /2017.04.27-Cilk5/figs/simplified-the.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/figs/simplified-the.png -------------------------------------------------------------------------------- /2017.04.27-Cilk5/pwl-cilk5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.04.27-Cilk5/pwl-cilk5.pdf -------------------------------------------------------------------------------- /2017.04.27-Cilk5/pwl-cilk5.tex: -------------------------------------------------------------------------------- 1 | \documentclass[13pt]{beamer} 2 | 3 | \setbeamertemplate{navigation symbols}{} 4 | \defbeamertemplate*{footline}{infolines theme} 5 | { 6 | \leavevmode% 7 | \hbox{% 8 | \begin{beamercolorbox}[wd=.99\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}% 9 | \usebeamerfont{date in head/foot}\insertshortdate{} 10 | \hfill 11 | {\footnotesize {\small \insertframenumber{}}} %/ \inserttotalframenumber\hspace*{2ex} 12 | \end{beamercolorbox}}% 13 | \vskip0pt% 14 | } 15 | 16 | \hypersetup{colorlinks,linkcolor=blue,citecolor=darkgreen,urlcolor=blue} 17 | \usepackage{tikz} 18 | \usetikzlibrary{fit,shapes,positioning,backgrounds,calc,patterns,scopes,decorations,chains,arrows,matrix,decorations.pathreplacing} 19 | \usepackage{fontspec} 20 | \usepackage{xunicode} 21 | \usepackage{xltxtra} 22 | \defaultfontfeatures{Mapping=tex-text} 23 | %\usepackage[norules,nolineno]{lgrind} 24 | \usepackage{epsf} 25 | \usepackage{color} 26 | \usepackage{bbding} % stars ... 27 | \usepackage{pifont} % stars ... 28 | \usepackage{pstricks} 29 | \usepackage{url} 30 | %\usepackage{calc} 31 | \usepackage{graphicx} 32 | \usepackage{ifthen} 33 | \usepackage{subfigure} 34 | \usepackage{fancyhdr} 35 | \usepackage{multido} 36 | \usepackage{wasysym} 37 | \usepackage{fp} 38 | \usepackage{listings} 39 | \usepackage{amsmath} 40 | \usepackage{array} 41 | \usepackage{multirow} 42 | \usepackage{paralist} 43 | \usepackage{ulem} 44 | \normalem 45 | \lstset{language=C,tabsize=2,basicstyle=\ttfamily\normalsize,backgroundcolor=\color{LemonChiffon},framerule=1pt,frame=single} 46 | \usepackage[noend]{algorithm2e} 47 | \usepackage{verbatim} 48 | \usepackage{skull} 49 | 50 | \newenvironment{sItemize}% 51 | {\begin{list}{-}{\leftmargin=1em\itemsep=0em\parskip=0pt\parsep=-2pt}}% 52 | {\end{list}} 53 | 54 | 55 | \definecolor{lightblue}{rgb}{0.68,0.85,0.90} 56 | \definecolor{red3}{rgb}{0.80,0.00,0.00} 57 | \definecolor{darkgreen}{rgb}{0.00,0.39,0.00} 58 | \definecolor{LemonChiffon}{rgb}{1.00,0.98,0.80} 59 | \definecolor{DarkBlue}{rgb}{0.00,0.00,0.55} 60 | \tikzset{c1/.style={ellipse,draw=blue!50,fill=blue!20,ultra thick,minimum size=5mm}} 61 | \tikzset{spawn-n/.style={inner sep=2pt,circle,draw,fill=darkgreen,anchor=center,draw=darkgreen}} 62 | \tikzset{sync-n/.style={inner sep=2pt,circle,draw,fill=red3,anchor=center,draw=red3}} 63 | \tikzset{fn-n/.style={c1,anchor=center,inner sep=2pt,fill=black!60,draw=black,text=white}} 64 | \tikzset{fn-x/.style={c1,anchor=center,inner sep=1pt,fill=black!40,draw=black,text=white,thin}} 65 | \tikzset{fn-g/.style={rectangle,anchor=center,inner sep=5pt,fill=black!20,draw=black,text=white}} 66 | \tikzset{spawn-e/.style={-stealth,very thick,draw=darkgreen,fill=darkgreen}} 67 | \tikzset{sync-e/.style={-stealth,very thick,draw=red3,fill=red3}} 68 | \tikzset{fn-e/.style={-stealth,very thick,draw=black,fill=black}} 69 | \tikzset{note/.style={rectangle, fill=LemonChiffon, thick, draw=DarkBlue,rounded corners=1ex}} 70 | \tikzset{code/.style={rectangle, fill=black!10, draw=black, thick, rounded corners=1ex,text=black, inner sep=4pt}} 71 | \tikzset{cons/.style={rectangle, fill=LemonChiffon, draw=black, thick, rounded corners=1ex,text=black, inner sep=9pt}} 72 | 73 | \tikzset{fn-inact/.style={ 74 | rectangle, fill=black!20, thick, draw=black, 75 | rounded corners=1ex,minimum height=1cm, minimum width=1.3cm 76 | }} 77 | 78 | \tikzset{fn-activ/.style={ 79 | rectangle, fill=green!30, thick, draw=black, 80 | rounded corners=1ex,minimum height=1cm, minimum width=1.3cm 81 | }} 82 | 83 | % http://tex.stackexchange.com/questions/16964/block-quote-with-big-quotation-marks 84 | \usepackage{ifxetex} 85 | \ifxetex{% 86 | \newfontfamily\quotefont[Ligatures=TeX]{Linux Libertine O} % or any font on your system 87 | \else 88 | \newcommand*\quotefont{\fontfamily{fxl}} % selects Libertine for quote font 89 | \fi 90 | 91 | \title{{\LARGE The Implementation of the Cilk-5 Multithreaded Language}\\ 92 | \medskip 93 | M. Frigo, C. E. Leiserson, K. H. Randall 94 | \medskip 95 | } 96 | \subtitle{\bigskip\Large{}PWL: Zurich} 97 | \author{Kornilios Kourtis} 98 | \date{27 April, 2017} 99 | 100 | \begin{document} 101 | \maketitle 102 | 103 | \begin{frame}{Previously on PWL: Zurich} 104 | \begin{center} 105 | \includegraphics[width=.9\textwidth]{figs/last_time} 106 | \end{center} 107 | \end{frame} 108 | 109 | \begin{frame}{Today: Cilk-5} 110 | \begin{itemize} 111 | \item A parallel programming language 112 | \item how to write parallel progrems 113 | \item how to efficiently execute them 114 | \item targets single (shared-memory) machines 115 | 116 | \bigskip 117 | \item original paper written in 1998 118 | \end{itemize} 119 | \end{frame} 120 | 121 | \begin{frame}{Why this paper?}{} 122 | \begin{itemize} 123 | \item theory + practice 124 | \item topics: parallel programming, synchronization, languages 125 | \end{itemize} 126 | \end{frame} 127 | 128 | \begin{frame}{} 129 | \begin{center} 130 | \includegraphics[width=.9\textwidth]{figs/backtofuture} 131 | \bigskip 132 | 133 | \includegraphics[width=.9\textwidth]{figs/back} 134 | \end{center} 135 | \end{frame} 136 | 137 | \begin{frame}{back to 1998...}{} 138 | \centering 139 | \includegraphics[width=.9\textwidth]{figs/cilk-smp} 140 | \end{frame} 141 | 142 | \begin{frame}{back to 1998...}{} 143 | \centering 144 | \includegraphics[width=.9\textwidth]{figs/cilk-machines} 145 | \end{frame} 146 | 147 | \begin{frame}{back to 1998...}{} 148 | \begin{center} 149 | \includegraphics[width=.4\textwidth]{figs/jiggy} 150 | \end{center} 151 | \end{frame} 152 | 153 | \begin{frame}{What followed}{} 154 | \begin{itemize} 155 | \item 2006: Intel releases its first dual-core CPU 156 | \item 2006: Cilk Arts commercializes Cilk 157 | \item 2008: Cilk++ ships 158 | \item 2008: Most influential PLDI paper award for 2008 159 | \item 2009: acquired by Intel 160 | \item 2010: CilkPlus ships with Intel compiler 161 | \item 2014: CilkPlus becomes part of gcc ({\ttfamily-fcilk}) 162 | 163 | \bigskip 164 | \item Programming model also picked up by other languages: See Fork/Join 165 | in Java {\footnotesize 166 | \url{http://www.oracle.com/technetwork/articles/java/fork-join-422606.html}}, 167 | and OpenMP tasks. 168 | \end{itemize} 169 | \end{frame} 170 | 171 | 172 | 173 | \begin{frame}[fragile]{Programming model}{} 174 | \begin{itemize} 175 | \item Task parallelism 176 | \item Extends C 177 | \item two basic keywords: {\ttfamily spawn} and {\ttfamily sync}. 178 | \end{itemize} 179 | 180 | \begin{columns} 181 | \column{.5\textwidth} 182 | \begin{semiverbatim} 183 | /* Cilk example */ 184 | x = \alert{spawn} A(); 185 | y = \alert{spawn} B(); 186 | C(); 187 | \onslide<2->{\alert{sync}; 188 | /* x,y are available */} 189 | \end{semiverbatim} 190 | \column{.5\textwidth} 191 | \begin{center} 192 | \begin{tikzpicture} 193 | \node[spawn-n] (s) {}; 194 | \node[spawn-n,below = 1.3cm] (s1) {}; 195 | \node[fn-n,below right = 1.3cm and 1cm] (a) {\small A}; 196 | \node[fn-n,below right = 2.6cm and 2cm] (b) {\small B}; 197 | \node[fn-n,below = 2.6cm] (c) {\small C}; 198 | \onslide<2->{ 199 | \node[sync-n,below = 4cm] (s3) {}; 200 | \draw[sync-e] (a) -- (s3); 201 | \draw[sync-e] (b) -- (s3); 202 | \draw[sync-e] (c) -- (s3); 203 | } 204 | \draw[spawn-e] (s) -- (s1); 205 | \draw[spawn-e] (s) -- (a); 206 | \draw[spawn-e] (s1) -- (b); 207 | \draw[spawn-e] (s1) -- (c); 208 | \end{tikzpicture} 209 | \end{center} 210 | \end{columns} 211 | \end{frame} 212 | 213 | \begin{frame}[fragile]{Example: run-length encoding (RLE)}{(nope, not fib)} 214 | { 215 | \centering 216 | \Large 217 | \begin{tabular}{ll} 218 | IN: & {\ttfamily [a,a,a,a,b,b,b,c,c,c,c,c]} \\ 219 | OUT: & {\ttfamily [(a,4),(b,3),(c,5)]} \\ 220 | \end{tabular} 221 | } 222 | \end{frame} 223 | 224 | \begin{frame}[fragile]{Sequential RLE}{(accumulator)} 225 | \begin{semiverbatim} 226 | def rle(xs): 227 | ret,curr,freq = ([],xs[0],1) 228 | for item in xs[1:]: 229 | if item == curr: 230 | freq += 1 231 | else: 232 | ret.append((curr,freq)) 233 | curr,freq = (item,1) 234 | ret.append((curr,freq)) 235 | return ret 236 | \end{semiverbatim} 237 | \end{frame} 238 | 239 | \begin{frame}[fragile]{Recursive \onslide*<2->{parallel }RLE} 240 | \begin{semiverbatim} 241 | def rle_rec(xs): 242 | if len(xs) <= 1: 243 | return [(xs[0], 1)] 244 | 245 | mid = len(xs) // 2 246 | rle1 = \onslide*<2->{\alert{spawn} }rle_rec(xs[:mid]) 247 | rle2 = \onslide*<2->{\alert{spawn} }rle_rec(xs[mid:]) 248 | \onslide*<2->{\alert{sync} } 249 | return rle_merge(rle1, rle2) 250 | 251 | def rle_merge(rle1,rle2): 252 | if rle1[-1][0] == rle2[0][0]: 253 | r1, rle1 = rle1[-1], rle1[:-1] 254 | r2, rle2 = rle2[0], rle2[1:] 255 | rle1.append((r1[0],r1[1] + r2[1])) 256 | return rle1 + rle2 257 | \end{semiverbatim} 258 | 259 | \onslide<3>{ 260 | \begin{tikzpicture}[remember picture,overlay] 261 | \node[text width=6cm,xshift=-4cm,yshift=-2cm,note] at (current page.north east){ 262 | NOTE: Removing the {\ttfamily spawn} and {\ttfamily sync} keywords results in 263 | a valid sequential program. In Cilk, this is called the {\bfseries C~elision}. 264 | }; 265 | \end{tikzpicture} 266 | } 267 | \end{frame} 268 | 269 | \begin{frame}[fragile]{product using {\ttfamily spawn}/{\ttfamily sync}}{} 270 | \begin{semiverbatim} 271 | {\color{red3}cilk} int product(int *A, int n) \{ 272 | if (n == 1) 273 | return A[0]; 274 | x1 = {\color{red3}spawn} product(A,n/2); 275 | x2 = {\color{red3}spawn} product(A+n/2,n-n/2); 276 | {\color{red3}sync}; 277 | return (x1*x2); 278 | \} 279 | \end{semiverbatim} 280 | \end{frame} 281 | 282 | \begin{frame}[fragile]{also: {\ttfamily inlet} and {\ttfamily abort}}{} 283 | \begin{semiverbatim} 284 | cilk int product(int *A, int n) \{ 285 | int p=1; 286 | {\color{red3}inlet} void mult(int x) \{ 287 | p *= x; 288 | if (p == 0) 289 | {\color{red3}abort;} 290 | return; 291 | \} 292 | if (n == 1) 293 | return A[0]; 294 | mult( spawn product(A, n/2) ); 295 | mult( spawn product(A+n/2, n-n/2) ); 296 | sync; 297 | return p; 298 | \} 299 | \end{semiverbatim} 300 | \end{frame} 301 | 302 | \begin{frame}[fragile]{Executing Cilk programs}{A dynamic graph (tasks, spawns, syncs)} 303 | {\small 304 | \begin{semiverbatim} 305 | \alert{cilk} int fib(int n) \{ 306 | if (n < 2) return (n); 307 | x = \alert{spawn} fib(n - 1); 308 | y = \alert{spawn} fib(n - 2); 309 | \alert{sync}; 310 | return x + y; 311 | \} 312 | \end{semiverbatim} 313 | } 314 | 315 | \vspace{-.8cm} 316 | \begin{center} 317 | \begin{tikzpicture} 318 | %\node[fn-n] (f4) {\footnotesize f(4)}; 319 | 320 | \begin{pgfonlayer}{background} 321 | \node[minimum width=11.5cm, minimum height=4cm] (bg) {}; 322 | \end{pgfonlayer} 323 | 324 | \onslide+<2->{ 325 | \node[spawn-n,below left = 10pt and 1cm of bg.north] (f4-sp1){}; 326 | \node[spawn-n,right=1cm of f4-sp1] (f4-sp2) {}; 327 | \node[sync-n,right=1cm of f4-sp2] (f4-sy1) {}; 328 | } 329 | 330 | \only<2->{ 331 | \begin{pgfonlayer}{background} 332 | \node[rectangle,fn-g, fit=(f4-sp1) (f4-sp2) (f4-sy1)] (g4) {}; 333 | \node[right=1pt of g4.west,anchor=east] {\small f(4)}; 334 | \end{pgfonlayer} 335 | } 336 | 337 | \onslide+<2->{ 338 | \node[spawn-n,below left =1cm and 1cm of f4-sp1] (f43-sp1) {}; 339 | \node[spawn-n,right=1cm of f43-sp1] (f43-sp2) {}; 340 | \node[sync-n,right=1cm of f43-sp2] (f43-sy1) {}; 341 | } 342 | 343 | \only<2->{ 344 | \begin{pgfonlayer}{background} 345 | \node[rectangle,fn-g, fit=(f43-sp1) (f43-sp2) (f43-sy1)] (g43) {}; 346 | \end{pgfonlayer} 347 | \node[right=1pt of g43.west,anchor=east] {\small f(3)}; 348 | } 349 | 350 | \onslide+<2->{ 351 | \node[spawn-n,below right=1cm and 1.5cm of f4-sp2] (f42-sp1) {}; 352 | \node[spawn-n,right=1cm of f42-sp1] (f42-sp2) {}; 353 | \node[sync-n,right=1cm of f42-sp2] (f42-sy1) {}; 354 | 355 | } 356 | 357 | \only<2->{ 358 | \begin{pgfonlayer}{background} 359 | \node[rectangle,fn-g, fit=(f42-sp1) (f42-sp2) (f42-sy1)] (g42) {}; 360 | \node[right=1pt of g42.west,anchor=east] {\small f(2)}; 361 | \end{pgfonlayer} 362 | } 363 | 364 | \onslide+<2->{ 365 | \draw[spawn-e] (f4-sp1) -- (f43-sp1); 366 | \draw[spawn-e] (f4-sp2) -- (f42-sp1); 367 | 368 | \draw[-latex,thick] (f4-sp1) -- (f4-sp2); 369 | \draw[-latex,thick] (f4-sp2) -- (f4-sy1); 370 | } 371 | 372 | \onslide+<2->{ 373 | \node[fn-n,below = .5cm of f42-sp1] (f421) {\footnotesize f(1)}; 374 | \node[fn-n,below = .5cm of f42-sp2] (f420) {\footnotesize f(0)}; 375 | \node[spawn-n,below left =.8cm and 2cm of f43-sp1] (f432-sp1) {}; 376 | \node[spawn-n,right=1cm of f432-sp1] (f432-sp2) {}; 377 | \node[sync-n,right=1cm of f432-sp2] (f432-sy1) {}; 378 | } 379 | 380 | \only<2->{ 381 | \begin{pgfonlayer}{background} 382 | \node[rectangle,fn-g, fit=(f432-sp1) (f432-sp2) (f432-sy1)] (g432) {}; 383 | \node[right=1pt of g432.west,anchor=east] {\small f(2)}; 384 | \end{pgfonlayer} 385 | } 386 | 387 | \onslide+<2->{ 388 | \node[fn-n,below right =.6cm and 5pt of f43-sp2] (f431) {\footnotesize f(1)}; 389 | \draw[spawn-e] (f43-sp1) -- (f432-sp1); 390 | \draw[spawn-e] (f43-sp2) -- (f431); 391 | \draw[-latex,thick] (f43-sp1) -- (f43-sp2); 392 | \draw[-latex,thick] (f43-sp2) -- (f43-sy1); 393 | 394 | \draw[spawn-e] (f42-sp1) -- (f421); 395 | \draw[spawn-e] (f42-sp2) -- (f420); 396 | \draw[-latex,thick] (f42-sp1) -- (f42-sp2); 397 | \draw[-latex,thick] (f42-sp2) -- (f42-sy1); 398 | } 399 | 400 | \onslide+<2->{ 401 | \node[fn-n,below=.5cm of f432-sp1] (f4321) {\footnotesize f(1)}; 402 | \node[fn-n,below=.5cm of f432-sp2] (f4320) {\footnotesize f(0)}; 403 | \draw[spawn-e] (f432-sp1) -- (f4321); 404 | \draw[spawn-e] (f432-sp2) -- (f4320); 405 | \draw[-latex,thick] (f432-sp1) -- (f432-sp2); 406 | \draw[-latex,thick] (f432-sp2) -- (f432-sy1); 407 | 408 | } 409 | 410 | \onslide+<3->{ 411 | \draw[sync-e] (f4321) -- (f432-sy1); 412 | \draw[sync-e] (f4320) -- (f432-sy1); 413 | } 414 | \onslide+<3->{ 415 | \draw[sync-e] (f432-sy1) -- (f43-sy1); 416 | \draw[sync-e] (f431) -- (f43-sy1); 417 | \draw[sync-e] (f421) -- (f42-sy1); 418 | \draw[sync-e] (f420) -- (f42-sy1); 419 | } 420 | 421 | \onslide+<3->{ 422 | \draw[sync-e] (f43-sy1) -- (f4-sy1); 423 | \draw[sync-e] (f42-sy1) -- (f4-sy1); 424 | 425 | } 426 | \end{tikzpicture} 427 | \end{center} 428 | \end{frame} 429 | 430 | \begin{frame}{How do we efficiently execute Cilk programs?}{} 431 | 432 | \begin{quote} 433 | {\bfseries The work-first principle:} \emph{Minimize the scheduling overhead 434 | borne by the \alert<2>{work} of a computation. Specifically, move overheads out of the 435 | \alert<2>{work} and onto the \alert<2>{critical path}.} 436 | \end{quote} 437 | 438 | 439 | \bigskip\bigskip 440 | (i.e., make common case fast, push overheads to the rare case) 441 | 442 | \end{frame} 443 | 444 | \begin{frame}{Performance model} 445 | \begin{columns} 446 | \column{.4\textwidth} 447 | \begin{tikzpicture}[scale=.8,transform shape] 448 | \node[fn-x] (root) {}; 449 | \node[fn-x,below =1cm of root.center,anchor=center] (o) {}; 450 | \node[fn-x,below left = 1cm and 1cm of o.center,anchor=center] (l) {}; 451 | \node[fn-x,below right = 1.4cm and 2cm of o.center,anchor=center] (r) {}; 452 | 453 | \draw[fn-e] (root) -- (o); 454 | \draw[fn-e] (o) -- (l); 455 | \draw[fn-e] (o) -- (r); 456 | 457 | \node[fn-x,below left = 1cm and 1cm of l.center,anchor=center] (ll) {}; 458 | \node[fn-x,below right = 1cm and .5cm of l.center,anchor=center] (lr) {}; 459 | \node[fn-x,below left = 1cm and .7cm of lr.center,anchor=center] (lrl) {}; 460 | \node[fn-x,below right = 1cm and .7cm of lr.center,anchor=center] (lrr) {}; 461 | \draw[fn-e] (l) -- (ll); 462 | \draw[fn-e] (l) -- (lr); 463 | \draw[fn-e] (lr) -- (lrl); 464 | \draw[fn-e] (lr) -- (lrr); 465 | 466 | \node[fn-x,below = 2cm of ll.center,anchor=center] (lld) {}; 467 | \node[fn-x,below = 1cm of lrl.center,anchor=center] (lrld) {}; 468 | \node[fn-x,below = 1cm of lrr.center,anchor=center] (lrrd) {}; 469 | \node[fn-x,below = 1cm of lrld.center,anchor=center] (m) {}; 470 | \node[fn-x,below = 1cm of m.center,anchor=center] (mm) {}; 471 | 472 | \draw[fn-e] (ll) -- (lld); 473 | \draw[fn-e] (lrl) -- (lrld); 474 | \draw[fn-e] (lrr) -- (lrrd); 475 | \draw[fn-e] (lld) -- (m); 476 | \draw[fn-e] (lrld) -- (m); 477 | \draw[fn-e] (lrrd) -- (m); 478 | \draw[fn-e] (m) -- (mm); 479 | 480 | \node[fn-x,below right = 1cm and 1cm of r.center,anchor=center] (rr) {}; 481 | \node[fn-x,below left = 1cm and 1cm of r.center,anchor=center] (rl) {}; 482 | \node[fn-x,below = 2.1cm of rl.center,anchor=center] (rld) {}; 483 | \node[fn-x,below = 1cm of rr.center,anchor=center] (rrd) {}; 484 | 485 | \draw[fn-e] (r) -- (rl); 486 | \draw[fn-e] (r) -- (rr); 487 | \draw[fn-e] (rr) -- (rrd); 488 | \draw[fn-e] (rl) -- (rld); 489 | 490 | \node[fn-x,below right = .2cm and 2.5cm of mm.center,anchor=center] (mmm) {}; 491 | 492 | \draw[fn-e] (rrd) -- (mmm); 493 | \draw[fn-e] (rld) -- (mmm); 494 | \draw[fn-e] (mm) -- (mmm); 495 | 496 | \onslide<2>{ 497 | \foreach \n in {root,o,l,r,ll,lr,lrl,lrr,lld,lrld,lrrd,m,mm,rr,rl,rld,rrd,mmm} 498 | \node[fn-x,fill=red3] at (\n) {}; 499 | } 500 | 501 | \onslide<3>{ 502 | \foreach \n in {root,o,l,lr,lrl,lrld, m,mm,mmm} 503 | \node[fn-x,fill=red3] at (\n) {}; 504 | } 505 | \end{tikzpicture} 506 | 507 | \column{.6\textwidth} 508 | \begin{sItemize} 509 | \item $T_p$: Execution time on P CPUs 510 | \medskip 511 | 512 | \item<2-> $T_1$: {\bfseries work} \\ 513 | {\small (Execution time for all nodes)} 514 | \item<3-> $T_\infty$: {\bfseries span} / {\bfseries critical path} \\ 515 | {\small (Execution time for $\infty$ CPUs)} 516 | 517 | \bigskip \bigskip 518 | \item<4-> work-first: move overheads to $T_\infty$ 519 | 520 | \end{sItemize} 521 | 522 | \end{columns} 523 | \end{frame} 524 | 525 | \begin{frame}{Scheduiling tasks}{} 526 | \begin{center} 527 | \begin{tikzpicture} 528 | \begin{scope}[every node/.style={minimum width=1cm,minimum height=15pt,rectangle,draw}] 529 | \begin{scope}[start chain=going above,node distance=0pt] 530 | \node[on chain,draw=none] (p0) {$P_0$}; 531 | \foreach \i in {1,...,5} 532 | \node[on chain,draw] (n0-\i) {}; 533 | 534 | \node[on chain,draw=none,right=2cm] at (p0) (p1) {$P_1$}; 535 | \foreach \i in {1,...,5} 536 | \node[on chain,draw] (n1-\i) {}; 537 | 538 | \node[on chain,draw=none,right=2cm] at (p1) (p2) {$P_2$}; 539 | \foreach \i in {1,...,5} 540 | \node[on chain,draw] (n2-\i) {}; 541 | 542 | \node[on chain,draw=none,right=2cm] at (p2) (p3) {$P_3$}; 543 | \foreach \i in {1,...,5} 544 | \node[on chain,draw] (n3-\i) {}; 545 | \end{scope} 546 | 547 | \node[rectangle,fill=none,draw=none,anchor=center] at (n0-1) {\footnotesize $T_0$}; 548 | \node[rectangle,fill=none,draw=none,anchor=center] at (n0-2) {\footnotesize $T_1$}; 549 | \node[rectangle,fill=none,draw=none,anchor=center] at (n0-3) (t2) {\footnotesize $T_2$}; 550 | \node[rectangle,fill=none,draw=none,anchor=center] at (n1-1) {\footnotesize $T_3$}; 551 | \node[rectangle,fill=none,draw=none,anchor=center] at (n1-2) {\footnotesize $T_4$}; 552 | \node[rectangle,fill=none,draw=none,anchor=center] at (n3-1) {\footnotesize $T_5$}; 553 | \node[rectangle,fill=none,draw=none,anchor=center] at (n3-2) {\footnotesize $T_6$}; 554 | 555 | \onslide<2> { 556 | \draw[-latex,ultra thick,red] ($ (t2.center) + (0,-0.1)$) to[out=-90,in=180] 557 | ++(1.3,-.5) node[inner sep=1,draw=none,fill=white] 558 | {\bfseries\large spawn} to[out=0,in=180] (n2-1.west); 559 | } 560 | \onslide<3-> { 561 | \draw[-latex,ultra thick,red] ($ (p2) + (-0.3,0)$) to[out=-90,in=180] 562 | ++(-1.3,-.3) node[inner sep=1,draw=none,fill=white] 563 | {\bfseries\large steal} to[out=180,in=0] (n0-1.east); 564 | } 565 | \end{scope} 566 | \end{tikzpicture} 567 | \end{center} 568 | 569 | \begin{overlayarea}{\textwidth}{4.4cm} 570 | \onslide*<2> { 571 | {\bfseries work sharing:} when new tasks are created, scheduler 572 | tries to send them to inactive CPUs 573 | } 574 | \onslide+<3->{% 575 | {\bfseries work stealing:} Idle processors try to steal tasks 576 | \begin{itemize} 577 | \item child executes first 578 | \item tasks are stolen from the bottom 579 | \item intuitively similar to DFS (good space properties) 580 | \item where do we steal from? \onslide<4->{\bfseries randomly choose} 581 | \end{itemize} 582 | } 583 | \end{overlayarea} 584 | \end{frame} 585 | 586 | \begin{frame}{Cilk's work-stealing scheduler} 587 | 588 | \begin{itemize} 589 | \item $T_p = T_1 / P + \mathcal{O}(T_\infty)$ \\ 590 | \begin{itemize} 591 | \item[-] {\small ($T_1 / P$ and $T_\infty$ are lower bounds)} 592 | \end{itemize} 593 | \bigskip 594 | \item requires $S_p \leq P S_1$ stack space 595 | \end{itemize} 596 | 597 | \vfill 598 | see: Scheduling Multithreaded Computations by Work Stealing, by Blumofe and 599 | Leiserson. 600 | \end{frame} 601 | 602 | \begin{frame}{Parallel slackness}{Cilk's basic assumption} 603 | \begin{itemize} 604 | \item program parallelism $T_1 / T_\infty$ 605 | \item machine parallelism $P$ 606 | 607 | \bigskip 608 | \item $P \ll T_1 / T_\infty$ 609 | \item parallel slack: $\left( T_1 / T_\infty \right) / P$ 610 | \medskip 611 | 612 | \begin{equation*} 613 | \left.% 614 | \begin{aligned} 615 | T_p &= T_1 / P + \mathcal{O}(T_\infty) \\ 616 | T_1 / P &\gg T_\infty \\ 617 | \end{aligned}% 618 | \qquad 619 | \right \} \Rightarrow T_p \approx T_1 / P \qquad \text{\small(linear speedup)} 620 | \end{equation*} 621 | 622 | \medskip 623 | \item Intiuitively: 624 | \begin{itemize} 625 | \item[+] program does not depend on number of CPUs 626 | \item[+] allows better load balancing 627 | \end{itemize} 628 | 629 | \end{itemize} 630 | \end{frame} 631 | 632 | \begin{frame}{Parallel slackness $\Rightarrow$ work-first principle} 633 | 634 | \begin{eqnarray*} 635 | T_p &\approx& T_1 / P \\ 636 | c_1 = T_1/T_s \Rightarrow T_p &\approx& c_1 T_s / P \qquad \text{\small $T_s$: time of C elision} \\ 637 | \end{eqnarray*} 638 | 639 | \begin{itemize} 640 | \item[] principle: minimize $c_1$ even at the expanse of $c_\infty$ 641 | \item[] (yet, this has limits -- authors' discussion on Cilk-4) 642 | \end{itemize} 643 | 644 | \end{frame} 645 | 646 | \begin{frame}{Compilation strategy}{} 647 | Two versions of each Cilk function (task) 648 | \begin{itemize} 649 | \item fast version 650 | \begin{itemize} 651 | \item invariant: never stolen 652 | \item as close to C elision as possible 653 | \end{itemize} 654 | 655 | \item slow version 656 | \begin{itemize} 657 | \item when a task is stolen, slow version is executed on thief processor 658 | \item needs to restore state 659 | \end{itemize} 660 | 661 | \item Original implementation: cilk2c translation 662 | \end{itemize} 663 | \end{frame} 664 | 665 | \begin{frame}[fragile]{C elision}{Only use the execution stack} 666 | \begin{semiverbatim}{\small 667 | f(n) \{ 668 | // spawn f(n-1) 669 | x = f(n-1); 670 | // spawn f(n-2) 671 | y = f(n-2); 672 | // sync 673 | return x + y; 674 | \} 675 | }\end{semiverbatim} 676 | %\begin{tikzpicture}[] 677 | %\node[fn-inact,minimum height=5cm,label=above:stack] (s) {}; 678 | %\node<1-7>[fn-activ,anchor=north] at (s.north) (f3) {f(3)}; 679 | %\node<1-6>[fn-activ,anchor=north] at (f3.south) (f2) {f(2)}; 680 | %\node<2>[fn-activ,anchor=north] at (f2.south) {f(1)}; 681 | %\node<4>[fn-activ,anchor=north] at (f2.south) {f(0)}; 682 | %\end{tikzpicture} 683 | \end{frame} 684 | 685 | \begin{frame}{Cactus stack}{} 686 | \begin{columns} 687 | \column{.3\textwidth} 688 | \includegraphics[width=\textwidth]{figs/cilk-cactus-spawn} 689 | \column{.7\textwidth} 690 | \includegraphics[width=\textwidth]{figs/cilk-cactus-stack} 691 | \end{columns} 692 | \end{frame} 693 | 694 | \begin{frame}[fragile]{Cilk fast version}{use the execution stack, record state} 695 | \begin{semiverbatim}{\small 696 | f(n) \{ 697 | frame = alloc_frame(); 698 | // spawn f(n-1) 699 | frame->entry = 1; 700 | frame->n = n; 701 | push(frame); 702 | x = f(n-1); 703 | frame = pop(); 704 | if (!frame) 705 | return STOLEN; 706 | // spawn f(n-2) 707 | ... 708 | // sync 709 | free_frame(frame) 710 | return x + y; 711 | \} 712 | }\end{semiverbatim} 713 | \end{frame} 714 | 715 | 716 | \begin{frame}[fragile]{Cilk slow version}{restore state, sync} 717 | \begin{semiverbatim}{\small 718 | f_slow(frame) \{ 719 | switch (frame->entry) \{ 720 | case 1: goto a; 721 | ... 722 | \} 723 | // spawn f(n-1) 724 | ... (same as fast version) ... 725 | if (0) \{ a: n = frame->n; \} 726 | // spawn f(n-2) 727 | ... (same as fast version) ... 728 | // sync 729 | wait_for_children(); 730 | free_frame(frame) 731 | return frame->x + frame->y; 732 | \}} 733 | \end{semiverbatim} 734 | \end{frame} 735 | 736 | 737 | \begin{frame}{worker/thief synchronization}{} 738 | \begin{itemize} 739 | \item basic scheduler data structure: double-ended queue (\emph{deque}) 740 | \item worker: operates on {\bfseries T}ail: push / pop 741 | \item thief: operates on {\bfseries H}ead: steal 742 | 743 | \medskip 744 | \item traditional approach: lock for accessing deque 745 | \begin{itemize} 746 | \item adds overhead to worker! 747 | \end{itemize} 748 | \end{itemize} 749 | \end{frame} 750 | 751 | \begin{frame}{TH(E) protocol}{} 752 | \includegraphics[width=.9\textwidth]{figs/simplified-the} 753 | \end{frame} 754 | 755 | \begin{frame}[fragile]{Note \#1: improving performance}{} 756 | 757 | \begin{semiverbatim} 758 | def rle_rec(xs): 759 | if len(xs) <= cutoff: 760 | return rle(xs) 761 | mid = len(xs) // 2 762 | rle1 = spawn rle_rec(xs[mid:]) 763 | rle2 = spawn rle_rec(xs[:mid]) 764 | sync 765 | return rle_merge(rle1, rle2) 766 | \end{semiverbatim} 767 | \end{frame} 768 | 769 | \begin{frame}{Note \#2: data structures}{} 770 | \begin{itemize} 771 | \item efficient partition and concatation 772 | \item lists: poor partition 773 | \item arrays: poor concatation 774 | 775 | \medskip 776 | \item Ropes: an Alternative to Strings\\ 777 | Boehm et al. (1995) 778 | \item Skip lists: a probabilistic alternative to balanced trees\\ 779 | Pugh (1990) 780 | \item implementation: \url{https://github.com/kkourt/xarray} 781 | \end{itemize} 782 | \end{frame} 783 | 784 | \begin{frame}[fragile]{Note \#3: data vs task parallelism}{} 785 | 786 | \begin{semiverbatim}{\large 787 | reduce(rle_merge, map(lambda x: [(x,1)], input)) 788 | }\end{semiverbatim} 789 | 790 | \begin{itemize} 791 | \item[] ({\ttfamily rle\_merge} is an associative operation) 792 | \end{itemize} 793 | \end{frame} 794 | 795 | 796 | \begin{frame}{}{} 797 | 798 | \begin{center} 799 | \LARGE 800 | Thank you! 801 | 802 | \bigskip 803 | Qs? Pizza? 804 | \end{center} 805 | \end{frame} 806 | 807 | \end{document} 808 | -------------------------------------------------------------------------------- /2017.06.29-Raft/pwl-raft-trivedi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papers-we-love/zurich/9375cbf591b25187b5473e33c073244dfb9c1615/2017.06.29-Raft/pwl-raft-trivedi.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Papers We ❤️ Zürich 2 | 3 | This is the repository for the Zurich chapter of Papers We Love. 4 | 5 | Do you want to talk about a recent paper that you are excited about? Do you 6 | want to explain fundamental papers of your field to a wider audience? Do you 7 | want to (re-)discover important research works in computer science? Do you have 8 | this really cool paper you want to tell us about? Present the papers that you 9 | love, tell us about how you've implement them and use them, or simply listen 10 | and discuss! 11 | 12 | We're curating this repository for papers presented at PWL Zürich. You can 13 | contribute by adding PR's for papers, code, and/or links to other repositories, 14 | like the _main_ Papers We Love repo, 15 | [here](https://github.com/papers-we-love/papers-we-love). 16 | 17 | We follow the Papers We Love [Code of Conduct](code-of-conduct.md). 18 | 19 | We keep a [list of papers that we would like to talk about](paper_ideas.md). 20 | Send us pull requests to add your own! 21 | 22 | We also have a meetup group: https://www.meetup.com/Papers-we-love-Zurich/ for 23 | posting events, etc. 24 | 25 | ### Upcoming meetups 26 | 27 | ### Past meetups 28 | 29 | #### Natallie Baikevich on Automatic Construction of Inlining Heuristics using Machine Learing 30 | 31 | * https://www.meetup.com/Papers-we-love-Zurich/events/242544627/ 32 | * Thursday, September 14, 2017 6:30 PM 33 | * ETH Zürich, CAB H53 34 | * [paper](https://www.eecis.udel.edu/~skulkarn/papers/cgo-2013.pdf) 35 | * [slides](https://www.slideshare.net/luajalla/inlining-heuristics) 36 | 37 | Method inlining is a very important but also dangerous compiler optimization: an 38 | inlining decision might lead to significant speedup or performance degradation 39 | and has to be constructed carefully. The paper compares various features and 40 | inlining techniques, in particular neuro-evolution. We will also discuss how 41 | having an idea about inlining traps and benefits might come useful in the 42 | "real-world", where not everybody is a compiler developer. 43 | 44 | 45 | 46 | #### Animesh Trivedi on Raft: In Search of an Understandable Consensus Algorithm 47 | 48 | * https://www.meetup.com/Papers-we-love-Zurich/events/240580418/ 49 | * Thursday, June 29, 2017 6:30 PM 50 | * ETH Zürich, CAB H 52 51 | * [slides](2017.06.29-Raft//pwl-raft-trivedi.pdf) 52 | 53 | This time around we are going to discuss the Raft distributed consensus 54 | algorithm from Diego Ongaro and John Ousterhout. The paper was originally 55 | published at USENIX ATC'14 and was awarded the best paper. Since then, the 56 | algorithm has been a part of teaching at many universities, has had many 57 | open-sourced implementations in multiple languages, and has found its way into 58 | production-level codes. This instantaneous acceptance into the systems building 59 | community raises an interesting question about what makes Raft so approachable 60 | than in comparison to others options, most notably Paxos? I will present my 61 | impressions of the paper and what makes it an interesting read. 62 | 63 | #### The implementation of the Cilk-5 multithreaded language. 64 | 65 | * https://www.meetup.com/Papers-we-love-Zurich/events/238755473/ 66 | * Thursday, April 27, 2017 6:30 PM 67 | * ETH Zürich, CAB G 52 68 | * [slides](2017.04.27-Cilk5/pwl-cilk5.pdf) 69 | 70 | This time we are going to talk about an older paper. Published in 1998 by Matteo 71 | Frigo, Charles E. Leiserson, and Keith H. Randall, The implementation of the 72 | Cilk-5 multithreaded language 73 | ([pdf](http://supertech.csail.mit.edu/papers/cilk5.pdf)) is about expressing 74 | parallel programs and building a run-time system that efficiently executes them. 75 | The paper is strongly motivated by theory, but also very practical. Many of the 76 | techniques and approaches used in the paper are (I think) still relevant today. 77 | 78 | #### Naiad: A Timely Dataflow System 79 | 80 | * https://www.meetup.com/Papers-we-love-Zurich/events/237963794/ 81 | * Thursday, March 23, 2017 6:30 PM 82 | * ETH Zürich, CAB H 52 83 | * [slides](2017.03.26-Naiad/naiad-pwl-zurich.pdf), [demo](2017.03.26-Naiad/demo) 84 | 85 | Andrea Lattuada will (andreal@inf.ethz.ch) tell us all about Naiad: A Timely 86 | Dataflow System by Derek G. Murray, Frank McSherry, Rebecca Isaacs, Michael 87 | Isard, Paul Barham, and Martín Abadi. 88 | 89 | This paper proposes a very powerful computational model for dataflow programming 90 | designed to minimise unnecessary synchronisation. The idea is to have a system 91 | that can be the foundation for various data-processing frameworks that can 92 | interoperate. There is an open-source implementation in rust 93 | (https://github.com/frankmcsherry/timely-dataflow) by one of the authors. It was 94 | awarded a best paper award at SOSP 2013. 95 | 96 | 97 | ### Contact 98 | 99 | - Kornilios Kourtis | [GitHub](https://github.com/kkourt) | [Twitter](https://twitter.com/kkourt) 100 | - Vasia Kalavri | [GitHub](https://github.com/vasia) | [Twitter](https://twitter.com/vkalavri) 101 | - Andrea Lattuada | [GitHub](https://github.com/utaal) | [Twitter](https://twitter.com/utaal) 102 | -------------------------------------------------------------------------------- /code-of-conduct.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | All attendees, speakers, exhibitors, organizers, contributors and volunteers are required to conform to the following Code of Conduct. 4 | 5 | Papers We Love events are for anyone interested in Computer Science/Computer Engineering, its history, and related fields to discuss academic research in a fun, engaging and respectful environment. 6 | 7 | **Be an adult, don't be a jerk.** 8 | 9 | We value the participation of each member of the community and want all attendees to have an enjoyable and fulfilling experience. Accordingly, all attendees are expected to show respect and courtesy to other attendees throughout the meet-ups and at all Papers We Love events and interactions on the GitHub repository, IRC or [Slack](https://paperswelove.slack.com/messages/general/) channels. 10 | 11 | Need help? 12 | ---------- 13 | 14 | If you are experiencing harassment on or have concerns about content within the [GitHub repo](https://github.com/papers-we-love/zurich), the **#paperswelove** IRC channel on Freenode, the **paperswelove.slack.com** Slack, or [PapersWeLove.org](http://paperswelove.org) please contact: 15 | 16 | - **Kornilios Kourtis** [me@kkourt.io](mailto:me@kkourt.io) 17 | - **All** [contact@paperswelove.org](mailto:contact@paperswelove.org) 18 | 19 | The organizers of your local Papers We Love meet-up/event are available to help you with any issues or concerns at live events. 20 | 21 | What it means 22 | ------------- 23 | 24 | Papers We Love is dedicated to providing a harassment-free experience for everyone, regardless of gender, sexual orientation, disability, physical appearance, body size, race, or religion. We do not tolerate harassment of meet-up participants in any form. 25 | 26 | All communication should be appropriate for a professional audience including people of many different backgrounds. Sexual language and imagery is not appropriate for any meet-up, including talks. 27 | 28 | Be kind to others. Do not insult or put down other attendees. Behave professionally. Remember that harassment and sexist, racist, or exclusionary jokes are not appropriate for Papers We Love. 29 | 30 | Attendees violating these rules may be asked to leave the meet-up at the sole discretion of the organizers. 31 | 32 | Thank you for helping make this a welcoming, friendly event for all. 33 | 34 | Spelling it out 35 | --------------- 36 | 37 | Harassment includes offensive verbal comments related to gender, sexual orientation, disability, physical appearance, body size, race, religion, sexual images in public spaces, deliberate intimidation, stalking, following, harassing photography or recording, sustained disruption of talks or other events, inappropriate physical contact, and unwelcome sexual attention. 38 | 39 | Participants asked to stop any harassing behavior are expected to comply immediately. 40 | 41 | Contributors to the GitHub repository, the Meetup and/or event-related sites, sponsors, or similar are also subject to the anti-harassment policy. Organizers (including volunteers) should not use sexualized clothing/uniforms/costumes, or otherwise create a sexualized environment.. 42 | -------------------------------------------------------------------------------- /paper_ideas.md: -------------------------------------------------------------------------------- 1 | ### Paper suggestions and ideas 2 | 3 | If you are interested in talking about paper, please let us know by modifying 4 | this page and doing a pull request. 5 | 6 | --------------------------------------------------------------------------------