Universität Paderborn - Home Universität Paderborn
Die Universität der Informationsgesellschaft

Parallel Programming WS 2014/2015 - Assignment 7

Kastens, Pfahler
Institut für Informatik, Fakultät für Elektrotechnik, Informatik und Mathematik, Universität Paderborn
Feb. 02, 2015

Exercise 1 (Synchronous Message Passing)

Consider the following CSP program:

   process Compare
      var i : integer;
          x : (1..10)integer;
      i := 1;
      do i <= 10 -> if x(i) >= 0 -> skip;
                    [] x(i) < 0  -> Count!x(i);
                    fi
                    i := i + 1;
      od
   end
   
   process Count
      var y, sum : integer;
      sum := 0;
      do Compare?y -> sum := sum + y;
      od;
      Print!sum
   end

What does this program compute? How does it terminate?

Exercise 2 (Synchronous Message Passing)

Write a system of processes "Even", "Odd", and "Sum" in the above notation.

Exercise 3 (Distributed Systems: Probe and echo)

Directory blatt7/ProbeNet contains a framework for probe and echo operations in a net (see Slide 73, Slide 74). Apply the probe and echo approach to compute the sum of numbers where one number is stored locally at each node of a net.

The framework consists of the following important classes:

Complete the run() method of the inner class Main.Prober according to the algorithm outlined on Slide 74. The code for the initiator node is provided. Test your implementation using different initiators.

Generiert mit Camelot | Probleme mit Camelot? | Geändert am: 02.02.2015