-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexercise5.tex
56 lines (40 loc) · 1.7 KB
/
exercise5.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
\documentclass[11pt]{article}
\include{packages}
\begin{document}
% ========== Edit your name here
%\author{Your Name}
\title{\coursename~Quiz 5: Due by \DueDate{\coursedate}{37}}
\date{}
\maketitle
\medskip
% ========== Begin answering questions here
\section*{Exercises}
\begin{enumerate}
\item Programming on paper (2 credits): \\
Write a program that computes
\begin{align*}
A = B + C
\end{align*}
where $A,B,C \in \mathbb{R}^n$ are \lstinline|std::vector<double>| in parallel. You can either use \lstinline{std::async} or \lstinline{std::execution::par} for the parallism.
\item Definitions (2 credits): \\
Explain the following terms in your own words:
\begin{itemize}
\item Asynchronous vs synchronous programming
\item Explain what a \lstinline|std::future| is and how to utilized it for parallism in your application.
\end{itemize}
\end{enumerate}
\section*{Programming exercise}
\begin{enumerate}
\item Parallel Monte-Carlo method: (2 credits)\\
Use your solution of the Monte-Carlo method and add parallelism to your implementation using \\
\lstinline|std::async| and \lstinline|std::future|. Try to launch some of the functions asynchronously and synchronize them using the future objects.
\item Parallel $N$-body simulation (4 credits)\\
Use your solution of the $N$-body implementation and add parallelism to your implementation using \\
\lstinline|std::execution::par| in some of the \lstinline|for| loops. \textbf{Optional:} Try to launch some of the functions asynchronously and synchronize them using the future objects.
% ========== Continue adding items as needed
\end{enumerate}
Please contact me, if you need the solutions of these programming exercises.
\doclicenseThis
\end{document}
\grid
\grid