CS 574

Homework 2

Due Monday, November 24, 2003

This homework is due at 11:00 AM if submitted by email, or you can turn it in on paper in class at 11:30

  1. When should a process migrate?

    Suppose you are building an environment supporting process migration for compute-bound processes. Your environment will automatically and transparently pick up a process and move it whenever it decides that it's likely that it will finish faster when it's on some other processor.

    Here are some assumptions about your environment:

    1. Your network topology doesn't matter. Assume you can simply transfer bits from one processor to any other processor in the system at a rate of 100 Mbits/second, and that you needn't worry about collisions.
    2. You have perfect knowledge about the amount of free CPU time available on every machine in the system.
    3. An estimate for how long a process will take to execute is t × 2½ where t is the time taken so far. So if a process has used ten seconds of CPU time so far we can reasonably guess that it will take a total of 14 seconds.
    4. The time to freeze a process, move it to another machine, and unfreeze it is dominated by the network time (so it's just 100 Mbit/sec, with no other considerations).
    5. It's a really, really compute-bound process: all that's relevant is the CPU usage of the process; you don't need to worry about residual state at all.

    Now, then:

    1. (10 points) Show that the estimate for time to completion of a process isn't totally unreasonable. In particular, show that if a process will take time T to complete and the error in the estimate of time to completion is given by | T - ct | where c is a constant and t is the run time so far, c = 2½ minimizes the mean error over the course of the program run time.
    2. (20 points) Develop an inequality which will determine when migrating a process from the local machine to a remote machine is a Good Idea based on the run time so far of the process, the size of the process, the percentage of the CPU time the process is receiving on its current host, and the percentage of time available for the process to take on the remote host.

  2. Suppose you had a system using distributed shared memory, with the following characteristics:

    1. Variables' home nodes move with their write-access. Each variable has an initial home node; after that, any time a new processor obtains write access to the variable the home moves to the new processor. A pointer gets left behind, so if a processor tries to get access to a variable by sending a message to its old home node, the message is forwarded to the new home (and when the request is satisfied, the new processor learns the new home location as well). Every processor knows every variable's initial home nome.
    2. Read access and write access are requested automatically as a result of variable access in code execution (so if a processor tries to read variable X and it doesn't already have access to X, it will request read-access from X's home).
    3. When a processor has write access to a variable, and receives a message requesting read access, it doesn't retain read access (though it is still the variable's home).

    Suppose variables w, x, y, and z are initially homed on processors P0, P1, P2, and P3 respectively. Also, assume nobody has any accessto any of them before you start.

    Now, suppose the processors execute the following code snippets, in the order shown below:
    ProcessorCode
    P1x = 1;
    P1y = 1;
    P4z = x + y;
    P0w = x + y + z;

    1. (10 points) Draw a diagram showing the reading and writing of variables and their resulting values, using the notation from the "Memory Consistency Models" lecture.
    2. (20 points) Make a table showing the messages that have to be sent between the processors to accomplish this. The table's columns should the be processor sending the message, the processor receiving the message, and a brief description of the meaning of the message.
    3. (10 points) The most striking difference between the DSM system being described here and one like Alewife is that this system doesn't use fixed homes. How would you expect this decision to affect the amount of message traffic compared to Alewife for situations in which (1) there is very little shared memory processing being done at all, (2) programs are written so that typically only a single processor, which is likely to not be the original home, writes to a given variable but many processors end up reading what that one writer does, and (3) lots of processors end up writing to all the variables somewhat randomly.

  3. (15 points) The following are two 16 bit messages followed by 3 bit CRCs calculated using x3 + x2 + 1. The messages read left to right (so the most significant bit is on the left like Ian used in his talk, not like the paper). One of the messages was corrupted in transit; one wasn't. Which is which?

    1. 0110010100101010011
    2. 1011101010011100110


Last modified: Wed Nov 12 20:09:46 MST 2003