
The MultiProcessor Simulator / Experimental Version 1.0

by Fe'lix E. Quevedo Stuva


Maximum Finding Algorithm CRWR SM MIMD.

This example uses the share memory feature of the MPsim. It also intends
to show how to make a user semaphore and simulate a SIMD machine.
This algorithm is known to be the fastest.

The host program creates the share segment, prepares data, and loads the
processor program one at a time. Once all the processors are loaded, the
host wiats for all the processors to complete the first step. Once all the 
processors has completed the first step, it resets the step flag and
waits for the second step. Finally displays the results on the
corresponding share memory area.

The processor program in the first step obtains the maximum of the two
assigned values, marking the looser vector. Then increments the flag a
and if its a second step processor, waits for the host to reset the flag.
Once the processor resets the flag verifies if the assigned looser index
value is winner (not looser) to save the maximum value on the correspponding
share memory area.
