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

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

\begin{document}
\maketitle

\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: Extra Credit: Even finer-grain synchronization}
\label{step4}

\begin{figure}[t]
  \centering
  \includegraphics[width=.9\textwidth]{random-kmeans-ultra-fine-speedup.png}
  \caption{Step 4 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-4}

\emph{In this step, you may, for extra credit, 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? Extra 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. If you do this, 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-4}.
\end{itemize}  

\bibliographystyle{abbrv}
%\bibliography{main}

\end{document}
This is never printed
