

Instructor: Vlad Wojcik
![]()
DUE DATE / TIME: Friday, 12 Feb 2010, 4 PM.
THE PROBLEM:
A 3D torus supercomputer (3x4x5 processors) needs to be reset. To reset a processor means to bring it to a certain controlled state.
Every processor in the torus has exactly six immediate neighbours. We will assume that each processor runs an Ada task. Each task has a RESET entry and an ACK entry. A user program, running on the host computer, first calls the RESET entry of a task running on an arbitrarily chosen processor. Then it calls on the ACK entry of that task, waiting for the acknowledgement. When this acknowledgment is received, the user program is informed that the torus machine has been reset.
Each processor task waits first on the RESET entry call. If this is NOT the first time that entry was called, the task is ready to accept the ACK entry call immediately. Otherwise it first calls the RESET entry of all its immediate neighbours (with the exception of the neighbour that called its RESET entry), and then waits for ACKnowledgments (which may come in any order). Upon receipt of all ACKnowledgments, the task is willing to accept its own ACK entry call.
Write the most efficient Ada program to reflect this behaviour. While the torus is being reset, the program should produce a brief report, viz.:
PNO #ACKs
### ####
### ####where PNO stands for processor number and #ACKs represents the number of acknowledgments issued.
NOTE: Beware of deadlock!
SUBMISSION FORMAT:
Both hardcopy (paper) and electronic submission is required.
Hardcopy submission: Your submission envelope with the standard Cover Page should contain all relevant printouts, demonstrating flawless behaviour of your program. The envelope should be dropped in the submission box on or before deadline date / time.
Electronic submission: Please create on your PC a sub-directory bearing your student number, place within it all the files (and only the files) to be submitted. ZIP this directory and e-mail it to your instructor (once - and only once!). The title of the message should be: "COSC 3P93: Assignment 1 Submission". The message should contain your name and student number, and the attached ZIP file.
Similarly, the electronic submission should be performed on or before deadline date / time.
Instructor: Vlad Wojcik
Revised: 30 January, 2010 8:51 PM
Copyright � 2010 Brock University