S4 Computer architecture · Practice
Problem set 10: coherence, consistency and parallel programs
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 15 kinds solid
Check
A snooping bus moves 128 GB/s; cores run at 2 GHz and IPC 2, each making 0.005 bus misses per instruction with 64-byte lines.
(a)
How many cores can it support?
Check
A thread reads and then writes 1000 lines that no other core holds.
(a)
How many bus transactions does MSI need?
(b)
And MESI?
Check
8 threads each update their own 4-byte counter.
(a)
How many counters share each line when packed?
(b)
How much memory do the counters take when padded to a line each?
Check
A directory serves 256 cores with 64-byte lines.
(a)
What does a full bit vector add to memory?
(b)
And 8 limited pointers?
Check
A core writes a line shared by 15 other caches, on a directory protocol.
(a)
How many invalidations does the home send?
(b)
How many messages in all, counting the request, acknowledgments and the reply?
Check
A directory miss has 3 critical-path messages on an 8 × 8 mesh, each crossing the average distance at 2 ns per hop plus 20 ns of overhead.
(a)
What is its latency?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
Check
8 threads each spend 0.05 of their time holding one lock.
(a)
What is the most throughput, in threads' worth, the lock allows?
(b)
What speedup does Amdahl's law give, treating the critical section as serial?
Check
32 cores take turns with a lock until each has held it once.
(a)
How many does a test-and-test-and-set lock take?
(b)
And a ticket lock?
(c)
And an MCS lock?
Check
1024 threads meet at a barrier: a tree of fan-in 2 at 80 ns per level, or a centralized counter at 40 ns per atomic.
(a)
How long does the tree take?
Write units the way you normally would: 1.5 ns, 1500 ps and 0.0015 µs are the same answer.
(b)
And the counter?
Check
A program's parallel fraction, measured on 64 processors, is 0.9.
(a)
What scaled speedup does Gustafson's law give?
(b)
And what fixed-size speedup would Amdahl's law give, if p were the single-processor fraction?
Check
A core at 4 GHz and IPC 3 issues stores as 0.1 of its instructions; each store waits 10 cycles in the store buffer before it drains.
(a)
How many store-buffer entries are occupied on average?
Check
A program executes 1000000 fences a second, each draining the store buffer for 20 ns.
(a)
What fraction of the time do fences cost?
Check
Under contention, a load-reserved/store-conditional pair succeeds with probability 0.6 per attempt.
(a)
How many attempts does an update take on average?
(b)
What fraction of updates need more than three attempts?
Check
A parallel program suffers 2 coherence misses per thousand instructions, each costing 80 cycles, on cores whose CPI is otherwise 1.
(a)
What CPI do coherence misses add?
(b)
What share of the time do they take?
Check
In a MESI system, 8 cores each read a line, then one of them writes it 100 times with no other access in between.
(a)
How many copies does the first write invalidate?
(b)
How many bus transactions do the remaining writes need?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in S4