\title{cs378: Concurrency: Lab 3 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 1: Sequential Solution}\label{step1}

\begin{figure}[h]
  \centering
  \includegraphics[width=.65\textwidth]{lab3-seq.pdf}
  \caption{Step 1 sequential runtime graph. Note: data is not accurate.}
\label{fig:seq}
\end{figure}

\emph{Using Go's time package, report the time taken by your serial implementation to perform the following tasks. You can report the runtimes using graph(s) or table(s). See Figure~\ref{fig:seq} for reference.}

\begin{itemize}
\item Generate the hashes
\item Generate the hashes and insert them into the data structure
\item Perform the tree comparisons and store the results in the adjacency matrix
\end{itemize}


\section{Step 2: Parallelize Hash Operations}\label{step2}

\begin{figure}[h!]
  \centering
  \includegraphics[width=.65\textwidth]{lab3-hash.pdf}
  \caption{Step 2 hashing speedup graph. Note: data is not accurate.}
\label{fig:hash}
\end{figure}

\begin{figure}[h!]
  \centering
  \includegraphics[width=.65\textwidth]{lab3-hash+insert.pdf}
  \caption{Step 2 hashing + insert speedup graph. Note: data is not accurate.}
\label{fig:hash-and-insert}
\end{figure}

\begin{figure}[h!]
  \centering
  \includegraphics[width=\textwidth]{lab3-hash+multi-insert.pdf}
  \caption{Step 2 (optional) hashing + multiple insert speedup graph. Note: data is not accurate.}
\label{fig:hash-and-multi-insert}
\end{figure}

\emph{Using graphs, report the following data:}

\begin{itemize}
\item The speedup over sequential from using goroutine and thread pool parallelism to perform hashing with both coarse.txt and fine.txt. Use several different values for the number of threads and make them interesting (powers of 2, the number of cores / hyperthreads on your CPU, and twice the number of cores / hyperthreads on your CPU are good). See Figure~\ref{fig:hash} for reference.
\item The same data as above, but including the time it takes to insert into the shared data structure. See Figure~\ref{fig:hash-and-insert} for reference.
\item If doing the optional fine-grain parallelism exercise, also report similar speedups over sequential for different numbers of channels and mutexes. See Figure~\ref{fig:hash-and-multi-insert} for reference.
\end{itemize}

\emph{In addition, answer the following questions with a brief (about 2 sentences) answer:}

\begin{itemize}
\item Was either approach to parallelism significantly faster at hashing or hashing and inserting? If so, why do you think this was the case?
\item Which approach had more overhead when accessing the data structure (if either)?
\item How did the fine.txt input affect your scalability?
\item If you implemented fine-grain data-structure access, did this significantly improve performance? If not, why do you think this was the case?
\item After having tried both approaches, which do you prefer and why?
\end{itemize}


\section{Step 3: Parallelize Tree Comparisons}\label{step3}

\begin{figure}[h!]
  \centering
  \includegraphics[width=.65\textwidth]{lab3-comp.pdf}
  \caption{Step 3 tree comparison speedup graph. Note: data is not accurate.}
\label{fig:comp}
\end{figure}

\emph{Using a graph, report the speedup over sequential from using goroutine and thread pool parallelism to perform tree comparison with coarse.txt. Use several different values for the number of threads and make them interesting (powers of 2, the number of cores / hyperthreads on your CPU, and twice the number of cores / hyperthreads on your CPU are good). See Figure~\ref{fig:comp} for reference. In addition, briefly answer the following questions:}

\begin{itemize}
\item Was either approach signficantly faster? If so, why do think this was the case?
\item How did the complexity of the approaches compare? Did you find that one was much simpler?
\item Now that your implementation is finished, how did you like Go? Would you still prefer working with C++ in the future (for performance and/or usability)?
\end{itemize}

\bibliographystyle{abbrv}
%\bibliography{main}

\end{document}
This is never printed
