-
Notifications
You must be signed in to change notification settings - Fork 22
/
hw12.tex
33 lines (23 loc) · 2.28 KB
/
hw12.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
\documentclass[12pt]{article}
\usepackage{fullpage,hyperref}\setlength{\parskip}{3mm}\setlength{\parindent}{0mm}
\begin{document}
\begin{center}\bf
Homework 12. Due by 5pm on Thursday 11/18.
Statistical computing on greatlakes
\end{center}
From homework 11, we understand the relevance of being able to implement embarrassingly parallel calculations. In the context of statistical computing in R, we are motivated to learn to use \texttt{foreach} on the greatlakes cluster accessed via the terminal. In this homework we carry out a simple example, since many of us are new to Linux clusters in general, and working at a greatlakes terminal in particular. Once you can run a simple multicore \texttt{foreach} on greatlakes you are prepared for a large fraction of all statistical parallel computing tasks. Work through the questions below and write brief answers to the following questions, by editing the tex file available at \url{https://github.com/ionides/810f21}, and submit the resulting pdf file via Canvas.
\begin{enumerate}
\item R has a reputation of being convenient for data analysis but slow in some situations, both features shared with Python. Loops in R can be slow, though this may be avoidable by careful coding (\url{https://adv-r.hadley.nz/control-flow.html#common-pitfalls}). If R run time starts limiting your research---i.e., whenever there is a numerical result you would like to see but you don't have the patience to wait for it to be computed---you have various options, including:
\begin{enumerate}
\item Use smaller examples.
\item Write the critical part of your code in C called from R. This can make use of the C functions underpinning the R language\\
(\url{https://cran.r-project.org/doc/manuals/R-exts.html#The-R-API}).
\item Work on rewriting your R code to make it more efficient.
\item Run your code on a more powerful machine, maybe moving from your laptop to greatlakes.
\end{enumerate}
Comment on situations when each approach might be suitable. Do you have advice, or relevant experiences?
YOUR ANSWER HERE.
\item Follow the instructions at \url{https://ionides.github.io/810f21/gl/slides.pdf} to run a job testing foreach on greatlakes. Report back on your results, and any problems that arose or advice to share.
YOUR ANSWER HERE.
\end{enumerate}
\end{document}