DSAN 6000: Big Data and Cloud Computing
Fall 2026
Monday, September 14, 2026
| Multithreading | Asynchronous Execution | |
|---|---|---|
| Unconsciously (you do it already, “naturally”) |
Focus on one speaker within a loud room, many other sounds entering your ears | Put food in oven, set alarm, go do something else, take out of oven once alarm goes off |
| Consciously (you can do it with effort/practice) |
Pat head (up and down) and rub stomach (circular motion) “simultaneously” | Throw a ball in the air, clap 3 times, catch ball |
| From Observer’s Perspective? | Looks like multiprocessing | Doesn't look like multiprocessing |
Parallel computing is a rabbithole, but one you can safely avoid via simple heuristics (“rules of thumb”):
…Horizontally-scaled map-reduce, you say? Why, that’s exactly what Hadoop / Spark do for us!
Embarrassingly Parallel
A problem is embarrassingly parallel when it can be divided into \(N\) subtasks without any temporal dependence or need for communication between the tasks
Temporal Dependence:
Does spongebob have to wait for one krabby patty to finish cooking before starting to cook a second one?
Between-Process Communication:
Does the cooking of one patty require some piece of another partially-cooked patty?
Non-Embarrassingly-Parallel Problems
If a data-processing problem is not embarrassingly-parallel, then the tasks that need to be performed may be:

If it’s such a magical powerup, why not parallelize everything? A: Overhead costs 😞
| Embarrassingly Parallel | Loosely Coupled | Tightly Coupled | |
|---|---|---|---|
| Sending tasks to workers | ⏱️ | ⏱️ | ⏱️ |
| Facilitating communication between workers | ⏱️ | ||
| Collecting results from workers | ⏱️ | ⏱️ | |
| Merging collected results | ⏱️ | ⏱️ |
multiprocessing or joblib)joblib Doing Here?| Input | |
|---|---|
| 1 | 500 |
| 2 | 501 |
| 3 | 502 |
| 4 | 503 |
| 5 | 504 |
| \(\vdots\) | |
| 151 | 650 |
joblib / Hadoop / Spark

| Worker | |
|---|---|
![]() |
1 |
![]() |
2 |
![]() |
3 |
![]() |
4 |
How do we know whether or not the overhead is “worth it”?
\[ \begin{align*} x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} = \frac{-7 \pm \sqrt{49 - 4(6)(-3)}}{2(6)} = \frac{-7 \pm 11}{12} = \left\{\frac{1}{3},-\frac{3}{2}\right\} \end{align*} \]
| \(\leadsto\) If code is not embarrassingly parallel (instinctually requiring laborious serial execution), | \(\underbrace{6x^2 + 7x - 3 = 0}_{\text{Solve using Quadratic Eqn}}\) |
| But can be split into… | \((3x - 1)(2x + 3) = 0\) |
| Embarrassingly parallel pieces which combine to same result, | \(\underbrace{3x - 1 = 0}_{\text{Solve directly}}, \underbrace{2x + 3 = 0}_{\text{Solve directly}}\) |
| We can use map-reduce to achieve ultra speedup (running “pieces” on GPU!) | \(\underbrace{(3x-1)(2x+3) = 0}_{\text{Solutions satisfy this product}}\) |
Problem from DSAN 5000/5100: Computing SSR (Sum of Squared Residuals)
\(y = (1,3,2), \widehat{y} = (2, 5, 0) \implies \text{SSR} = (1-2)^2 + (3-5)^2 + (2-0)^2 = 9\)
Computing pieces separately:
Combining solved pieces
You may have noticed: map() and reduce() are “meta-functions”: functions that take other functions as inputs
In Python, functions can be used as vars (Hence lambda):
This relates to a whole paradigm, “functional programming”: mostly outside scope of course, but lots of important+useful takeaways/rules-of-thumb!
In CS Theory: enables formal proofs of correctness
In CS practice:
When a program doesn’t work, each function is an interface point where you can check that the data are correct. You can look at the intermediate inputs and outputs to quickly isolate the function that’s responsible for a bug.
(from Python’s “Functional Programming HowTo”)
# Convert to lowercaseEasy case: found typo in punctuation removal code. Fix the error, add comment like # Remove punctuation
Rule 1 of FP: transform these comments into function names
Hard case: Something in load_text() modifies a variable that later on breaks remove_punct() (Called a side-effect)
Rule 2 of FP: NO SIDE-EFFECTS!
remove_punct()!!! 😎 ⏱️ = 💰From Leskovec, Rajaraman, and Ullman (2014)
From Leskovec, Rajaraman, and Ullman (2014), which is (legally) free online!
From Cornell Virtual Workshop, “Understanding GPU Architecture”
DSAN 6000 Week 3: Parallelization Concepts