28.10.2014 Views

Synergy User Manual and Tutorial. - THE CORE MEMORY

Synergy User Manual and Tutorial. - THE CORE MEMORY

Synergy User Manual and Tutorial. - THE CORE MEMORY

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Synergy</strong> <strong>User</strong> <strong>Manual</strong> <strong>and</strong> <strong>Tutorial</strong><br />

from a tuple space, <strong>and</strong> directs the workers to terminate when all of the results are<br />

received. The three diagrams below show possible contents during an applications<br />

execution.<br />

Owin<br />

Saber<br />

Sarlac<br />

Luke<br />

Owin<br />

Saber<br />

Sarlac<br />

Luke<br />

Owin<br />

Saber<br />

Sarlac<br />

Luke<br />

(Another message tuple)<br />

(Data tuple 1)<br />

(A message tuple)<br />

ProblemTuple Space<br />

(Data tuple 2)<br />

...<br />

(Data tuple n)<br />

Result Tuple Space<br />

(Result tuple 1)<br />

(Result tuple 2)<br />

...<br />

(Result tuple n)<br />

(A message tuple)<br />

ProblemTuple Space<br />

(Another message tuple)<br />

(Termination tuple)<br />

The<br />

left-most diagram shows a problem tuple space, where work data is stored, after<br />

messages to workers <strong>and</strong> work data tuples have received. The center shows a result tuple<br />

space, where the master will receive completed subtasks. The right-most diagram shows<br />

a problem tuple space with a termination tuple, also called a poison pill, which instructs<br />

the workers to terminate. Notice that the message tuples remain in the tuple space <strong>and</strong><br />

that the data tuples are removed. This is because the messages were accessed by a read<br />

operation <strong>and</strong> the data tuples were accessed by a take operation. If the terminal message<br />

is accessed by a take operation, it must be replaced so that the next worker can access it.<br />

This scenario assumes a parallel system that can create multiple tuple spaces, such a<br />

synergy. If the system is limited to one, then it depends more heavily on name pattern<br />

matching of tuples.<br />

The master program with its accompanying tuple spaces can reside on any participating<br />

node. The worker processes take work tuples from the tuple space that match a tuple<br />

query, put the results into the result tuple space, until all work is completed, <strong>and</strong><br />

terminate when they get the terminate message tuple from the master. The diagram<br />

below shows a possible master-worker configuration. It should be noted that the master<br />

machine generally has both a master process <strong>and</strong> a worker process. Otherwise a valuable<br />

system resource would be wasted because the master machine would be idle between<br />

receiving results.<br />

83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!