CSEP 524, Spring 2015: Homework 4
Due: Wednesday, May 6, end of the day (midnight pacific time).
Please use the dropbox linked from the CSEP 524 web page to submit your homework online. Any common format like text, pdf, doc/docx is fine.
- Read Partitioned Global Address Space Languages,
by Mattias De Wael, Stefan Marr, Bruno De Fraine, Tom Van Cutsem, and Wolfgang De Meuter.
Write a short review and summary of the paper (between a half and a full page, using a reasonable font size). What are your thoughts on the current state of PGAS
- Multiple producer, multiple consumer bounded buffer: In Chapel, implement a bounded buffer that may be accessed by any number of consumer tasks and
any number of producer tasks. Follow these guidelines:
An interface and test code can be found in BoundedBuffer.chpl.
P producers produce a total of N elements. C consumers keep consuming until they consume a TERM element. A working solution:
- Your solution must not contain any data races to be correct.
- Your solution must, in principle, be relatively scalable to multiple producers and consumers. For example, the produce and consume procedures should not be
implemented with a single lock over the entire buffer.
- Always terminates (no deadlock)
- Prints producer and consumer counts that each add up to N. Include brief test output to show that your program works for a few representative inputs, such as
when C and P differ.
- Correctly handles the case where the consumers get ahead of the producers (if consumers have read all of the data, and not seen a TERM, they should wait for
more data to be written).
- If the buffer is full, producers should wait until space becomes available.
Thanks to Brad Chamberlain for providing this problem!
- Chapel may be downloaded here.
- Debugging may be aided by including assertions that buffer invariants hold at the start and end of produce() and consume() (as well as elsewhere depending on your design).
- If you run into Chapel bugs, or confusing error messages, feel free to send questions or test cases that produce the bug to chapel-bugs at lists.sourceforge.net.
- General questions about Chapel can be sent to Brad (bradc at cray.com) or to chapel_info at cray.com
- Specific questions about the homework, however, should be sent to me (miker at cs) and Amnon (amnonh at cs).