\documentclass{article}
\usepackage{graphicx}
\usepackage[margin=1.2in]{geometry}

\title{cs378: Concurrency: K-Means Lab 2 Writeup Template}
\author{
        You \\
        Department of Computer Science\\
        UT Austin
}
\date{\today}


\begin{document}
\maketitle

\section{Step 1: Serial Implementation} 

No deliverables in writeup. 

\section{Step 2: Coarse Parallelization}\label{step1}

\begin{figure}[t]
  \centering
  \includegraphics[width=.9\textwidth]{random-kmeans-coarse-speedup.png}
  \caption{Step 2 scalability sample graph comparing coarse mutex 
  against coarse spinlock.
  \emph{NOTE: the data in these graphs are random. If your data show different 
  trends that's GOOD.}}
\end{figure}
\label{fig:step-2}


\emph{Using the random-n65536-d32-c16 sample input, create a graph of scalability 
for \texttt{pthread\_mutex\_t} and \texttt{pthread\_spinlock\_t} for your solution from 1 
to twice the number of physical processors on your machine for your solution at this step. 
Please normalize your measurements with the single-threaded solution from Step 1. 
This means that unlike in the first lab, where we simply reported execution time, this graph is speedup over sequential.}


\begin{itemize}
\item Provide a graph of speedup similar to Figure~\ref{fig:step-2}.
\end{itemize}


\vfill
\eject

\section{Step 3: Finer-grain Synchronization}\label{step2}

\begin{figure}[t]
  \centering
  \includegraphics[width=.9\textwidth]{random-kmeans-fine-speedup.png}
  \caption{Step 2 scalability sample graph comparing coarse mutex 
  against coarse spinlock.
  \emph{NOTE: the data in these graphs are random. If your data show different 
  trends that's GOOD.}}
\end{figure}
\label{fig:step-3}

\emph{Again using the random-n65536-d32-c16.txt sample input, 
 20 maximum iterations, and a threshold of 0.0000001, create another speedup graph 
 like the one from Step 2, where \texttt{pthread\_mutex\_t} and \texttt{pthread\_spinlock\_t} 
 primitives are used to synchronize \textit{en masse} updates accumulated privately by each 
 thread at the end of each iteration. Again your graph should be a speedup graph, 
 where data are normalized to the single-threaded Step 1 implementation.}

\begin{itemize}
\item Provide a graph of speedup similar to Figure~\ref{fig:step-3}.
\end{itemize}
  
\title{cs378: Concurrency: K-Means Lab 2 Writeup Template}
\author{
        You \\
        Department of Computer Science\\
        UT Austin
}
\date{\today}


\section{Step 2: Coarse Parallelization}\label{step1}

\begin{figure}[t]
  \centering
  \includegraphics[width=.9\textwidth]{random-kmeans-coarse-speedup.png}
  \caption{Step 2 scalability sample graph comparing coarse mutex 
  against coarse spinlock.
  \emph{NOTE: the data in these graphs are random. If your data show different 
  trends that's GOOD.}}
\end{figure}
\label{fig:step-2}


\emph{Using the random-n65536-d32-c16 sample input, create a graph of scalability 
for \texttt{pthread\_mutex\_t} and \texttt{pthread\_spinlock\_t} for your solution from 1 
to twice the number of physical processors on your machine for your solution at this step. 
Please normalize your measurements with the single-threaded solution from Step 1. 
This means that unlike in the first lab, where we simply reported execution time, this graph is speedup over sequential.}


\begin{itemize}
\item Provide a graph of speedup similar to Figure~\ref{fig:step-2}.
\end{itemize}


\vfill
\eject

\section{Step 3: Finer-grain Synchronization}\label{step2}

\begin{figure}[t]
  \centering
  \includegraphics[width=.9\textwidth]{random-kmeans-fine-speedup.png}
  \caption{Step 2 scalability sample graph comparing coarse mutex 
  against coarse spinlock.
  \emph{NOTE: the data in these graphs are random. If your data show different 
  trends that's GOOD.}}
\end{figure}
\label{fig:step-3}

\emph{Again using the random-n65536-d32-c16.txt sample input, 
 20 maximum iterations, and a threshold of 0.0000001, create another speedup graph 
 like the one from Step 2, where \texttt{pthread\_mutex\_t} and \texttt{pthread\_spinlock\_t} 
 primitives are used to synchronize \textit{en masse} updates accumulated privately by each 
 thread at the end of each iteration. Again your graph should be a speedup graph, 
 where data are normalized to the single-threaded Step 1 implementation.}

\begin{itemize}
\item Provide a graph of speedup similar to Figure~\ref{fig:step-3}.
\end{itemize}
  

\section{Step 4: Barrier Implementation}

\begin{figure}[t]
  \centering
  \includegraphics[width=.9\textwidth]{random-kmeans-ultra-fine-speedup.png}
  \caption{Step 4 speedup sample graph comparing your barrier to pthreads
  \emph{NOTE: the data in these graphs are random. If your data show different 
  trends that's GOOD.}}
\end{figure}
\label{fig:step-4}

\emph{In your writeup, describe your design. Why did you choose the approach you chose?
  Under what conditions do you expect your barrier to perform best and worst. Finally
  compare the performance of your implementation using your barrier against your implementation using
  a pthreads barrier. This comparision should involve generating the another version of
  the speedup graphs described in previous sections. What performance trends do you observe
  with your barrier? Please explain or speculate about why your barrier exhibits the scalability trends you observe.}

\begin{itemize}
\item Provide a graph of speedup similar to Figure~\ref{fig:step-4}.
\end{itemize}  


\section{Step 5: Even finer-grain synchronization (optional)}
\label{step5}

\begin{figure}[t]
  \centering
  \includegraphics[width=.9\textwidth]{random-kmeans-ultra-fine-speedup.png}
  \caption{Step 5 speedup sample graph comparing who knows what 
  synchronization techniques.
  \emph{NOTE: the data in these graphs are random. If your data show different 
  trends that's GOOD.}}
\end{figure}
\label{fig:step-5}

\emph{In this optional step, you may, explore other ways to make
  synchronization even finer grained to reduce contention and increase
  scalability. Can you use CAS-based updates? HTM? Does padding data
  structures to avoid false sharing have any impact on your
  performance?  Locks per-dimension? Functional decomposition 
  instead of domain decomposition? Credit will be given for any reasonable solution
  that undertakes this section, as long as the solution is still
  correct: trying to improve scalability is a worthwhile endeavor,
  even if you don't succeed. Include graphs, along
  with some conjecture explaining the performance behavior of your
  implementation(s).}

\begin{itemize}
\item Provide a graph of speedup similar to Figure~\ref{fig:step-5}.
\end{itemize}  

\bibliographystyle{abbrv}
%\bibliography{main}

\end{document}
This is never printed
