Skip to content

Commit f46b8fc

Browse files
committed
Add exercise assignment for Work distribution
1 parent a8abc4b commit f46b8fc

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Work distribution
2+
3+
Read the atom coordinates of the Zika virus [5ire.pdb](5ire.pdb) using the
4+
simple parser provided in [pdb.py](pdb.py) (see comments in the file for
5+
examples on how to use it). In [center-of-coords.py](center-of-coords.py) is a
6+
skeleton code you may also use as a starting point.
7+
8+
Calculate the center of coordinates in parallel by dividing the coordinates
9+
in smaller chunks (e.g. 100 coordinates) to separate tasks. After completing
10+
the tasks in worker processes, combine the results in the master process.
11+
12+
If needed, figure out also how to deal with any coordinates left out of the
13+
neat uniform-sized chunks.
14+
15+
a) Use a Pool of Workers to distribute the tasks to worker processes.
16+
*Hint*: if you return also the weight of each chunk, you can process also
17+
non-uniform sized chunks.
18+
19+
OR
20+
21+
b) Use a Queue to distribute the tasks to worker processes. Store the results
22+
for each chunk in a separate queue.

0 commit comments

Comments
 (0)