This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 418, Spring 2014 Static assignment
▪ Assignment of work to threads is pre-determined - Not necessarily compile-time (assignment algorithm may depend on runtime
parameters such as input data size, number of threads, etc.) ▪ Recall solver example: assign equal number of grid cells to each thread - We discussed blocked and interleaved static assignments ▪ Good properties: simple, essentially zero runtime overhead
(in this example: extra work to implement assignment is a little bit of indexing math)
CMU 15-418, Spring 2014 Static assignment
▪ When is static assignment applicable? ▪ When the cost (execution time) of work and the amount of work is
predictable ▪ Simplest example: it is known that all work has the same cost
Time to perform
job P1 P2 P3 P4 CMU 15-418, Spring 2014 Static assignment
▪ When is static assignment applicable?
- Time Example 2: predictable, but not all jobs have same cost (see example below)
Example 3: When statistics about execution time are known (e.g., same cost on average)
P1 P2 P3 Jobs have unequal, but known cost: assign to processors to ensure overall good load balance P4 CMU 15-418, Spring 2014 “Semi-static” assignment
▪ Cost of work predictable for near-term future - Recent past good predictor of near future
▪ Periodically pro le application and re-adjust assignment
- Assignment is static during interval between re-adjustment Image credit: http://typhon.sourceforge.net/spip/spip.php?article22 Particle simulation: Adaptive mesh...
View Full Document
- Spring '14