CS475 Lab 6: Back to Card Game

Introduction

The purpose of this exercise is for you to better usderstand and analyze the card game and associated algorithm that we did in the first day of class. In the lab, you will be in a small group, actually (re)play the game a few times, and try to think about some questions about it (mostly easy, some subtle, and some that will require offline thinking).

Card Game Rules:

Basic step: repeat ad nauseum (while true do): Protocol

Let's Play!

Split into groups with 5 players: 4 PEs (precessing elements) and one conductor. Play the game with only 4 cards. Replay a couple of time and look at the cards coming out. Discuss what the algorithm does.

Now let's analyze the algorithm, qualitatively as well as quantitatively.

First set of questions:

set that the number of cards is equal to the number of PEs (p). Define one step as one iteration through the read-compare/swap-optionally-write cycle.

Second set of questions:

We now want to use the p-PE "machine" to process a larger number of inputs, say n=k*p. So play the game a couple of times with 8 cards. Carefully observe what's happening, and then answer the following questions.