File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
multiprocessing/work-distribution Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
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.
You can’t perform that action at this time.
0 commit comments