69 lines
1.9 KiB
TeX
69 lines
1.9 KiB
TeX
% Preamble
|
|
\documentclass[11pt,fleqn]{article}
|
|
\usepackage{amsmath, amsthm, amssymb}
|
|
\usepackage{fancyhdr}
|
|
\oddsidemargin -0.25in
|
|
\textwidth 6.75in
|
|
\topmargin -0.5in
|
|
\headheight 0.75in
|
|
\headsep 0.25in
|
|
\textheight 8.75in
|
|
\pagestyle{fancy}
|
|
\renewcommand{\headrulewidth}{0pt}
|
|
\renewcommand{\footrulewidth}{0pt}
|
|
\fancyhf{}
|
|
\lhead{HW Chap. 5\\\ \\\ }
|
|
\rhead{Josh Holtrop\\2008-11-05\\CS 677}
|
|
\rfoot{\thepage}
|
|
|
|
\begin{document}
|
|
|
|
\noindent
|
|
\begin{enumerate}
|
|
\item[1.]{
|
|
The best known sequential sorting algorithms have a complexity of $O (n \log n)$.
|
|
So, the speedup factor is given by
|
|
$$ s = \frac{T_s}{T_p} = \frac{n \log n}{cn} = \frac{\log n}{c} $$
|
|
}
|
|
|
|
\item[2.]{
|
|
The total processing time when the program is run on $p$ processors
|
|
will be given by the initialization phase plus the compute phase
|
|
divided by $p$ processors.
|
|
So, the speedup is given by
|
|
$$ s = \frac{T_s}{T_p} = \frac{n + n^3}{n + \frac{n^3}{p}} $$
|
|
}
|
|
|
|
\item[3.]{
|
|
Using Amdahl's law, the maximum speedup is $1/f$, where $f$ is the
|
|
serial fraction of execution time.
|
|
So, the maximum fraction of execution time a program can spend on
|
|
serial code if the parallel version must achieve a speedup
|
|
factor of 10 is 10\%.
|
|
}
|
|
|
|
\vskip 1em
|
|
\item[4.]{
|
|
Using Gustafson's law, the scaled speedup factor is given by
|
|
$$ S_G = p + (1 - p) T_s = 8 + (1 - 8) \frac{1}{24} = 7.708 $$
|
|
}
|
|
|
|
\item[5.]{
|
|
Output from instrumented Floyd program: \\
|
|
\texttt{
|
|
\$ ./floyd-sequential adjacency.dat \\
|
|
Serial execution time: 0.0248399 seconds \\
|
|
Parallel execution time: 2.01773 seconds
|
|
}
|
|
|
|
This means that the percent of sequential code is roughly 1.23\%
|
|
(for a problem size of $n = 400$).
|
|
Using Amdahl's law, the maximum speedup that can be achieved with
|
|
this program (for this problem size) is given by
|
|
$$ S_{\textrm{max}} = \frac{1}{1.23\%} = 81.25 $$
|
|
}
|
|
|
|
\end{enumerate}
|
|
|
|
\end{document}
|