CS 4960-01 Homework 6

Due: Wednesday, October 8th, 2008 10:45am

For this homework, you'll create a new framework that can drive reduce and scan pieces originally written to work with the framework provided with HW4. For simplicity, we use a variant of the framework without prepare_temps.

The HW4 framework is implemented in terms of message passing. Your new implementation of the framework will use threads, instead. You'll have to implement full/empty variables that work with threads instead of message passing. Also, your framework should support any number of threads, as specified on the command line at run time.

Note: In the message-passing framework, a full/empty variable is identified using a number. That's because the identifier has to be passed in a message back to the central manager for full/empty variables. In a shared-memory setting, you should instead implement a full/empty variable as a structure or object.

You can implement the framework in either C or Java:

To work with your new framework, a “server” should not assume that the local portion of the input or result array is indexed from 0. For a given thread, accum and reduceGen or scanGen might be called with indices p to p+size instead of 0 to size. In other words, as you create a framework that uses with threads and shared memory, you can (and should) use offsets into a single array instead of creating separate arrays for each thread. All of the given uses of the framework are compatible with this refinement to the framework interface.


Last update: Monday, December 1st, 2008
mflatt@cs.utah.edu