S452 of 55
0 XP
  1. Hook
  2. Problems

S4 · Problem set 10

Problem set 10: coherence, consistency and parallel programs

These problems use lessons 2, 31 to 34 and 49: parallel speedup, snooping and directory coherence, on-chip networks, consistency and synchronization, and the MESI coherence project. They follow parallel programs from their speedup limits down to the messages and misses that set them.

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?

Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.

Practice

Keep practicing

15 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.