Page 1 of 1

Joining arrays of Apl computational nodes.

PostPosted: Tue May 28, 2013 9:21 pm
by Dr.BeauWebber
How do we knit an array of Apl array computational nodes into a working parallel processor ?
The Parallela has multiple processing elements – they can all run the same program, or the data (or program) can be moved from one processor to another, in a pipe-line or systolic loop, so as to perform a sequence of operations on the data.
Well the simplest method to do this is simple to demonstrate on a multi-processor lap-top :
Just join the processes together using pipe – most simply: standard input and standard output for the data (plus a control input and status output) :
Here is a simple standard c-shell pipeline as a demonstration of what I mean :
Code: Select all
$ ( echo "1000" | ./filt_gauss 2 > stde ) | & ( ./filt_binr 2 >> stde )

The first ‘node’ just emits the string “1000” from its std-out.
The second node uses aplc to generate a Gaussian (normal) distribution of 1000 data points, with a mean of 0 and standard deviation of 10 (uses von Neumann’s method).
The third node uses aplc to run a binning algorithm, and bins the random data into 21 bins between -11 and +11.
Thus from the standard-out we get an approximately normal (Gaussian) distribution :
Code: Select all
-10.47619   0
 -9.428571   1
 -8.380952   4
 -7.333333  10
 -6.285714  13
 -5.238095  33
 -4.190476  50
 -3.142857  90
 -2.095238 113
 -1.047619 135
         0 115
  1.047619 127
  2.095238 103
  3.142857  91
  4.190476  50
  5.238095  42
  6.285714  15
  7.333333   5
  8.380952   3
  9.428571   0
  10.47619   0

And the standard error outputs (with comments like “program started” etc) all end up in file stde.
Now we could run this on the Parallella, but the data would (I think) keep being transferred via the Linux host processor. What we want is a way to join the processes on the Parallella nodes directly to each other. Well a long time ago I did this, adding pipes for general transfer to any of many surrounding processors, and ran a simple version of this on a Transputer system, see :
A Pipe has two ends. Using APL in a multiprocess/multiprocessor environment. A proposal for a flexible but easy to use syntax. J.B. Webber. Apl Quad Quote 20, 1, 1-2, Sept 1989. (also on :
However we now have a problem – the “newlib” libraries on which Epiphany sits do not seem to have “pipe” or “dup”. So the inter-processor communication code as currently written in aplc will not work. But it does seem to have similar tools to allow us to build “first-in-first-out” communication channels between the processors.
So a plea – I will get to work on this if no one else does, but if you have an understanding of these Parallella / newlib communication devices, it would be of great benefit to the community to add a suitable set of Parallella communication channels to the aplc compiler, so that they can be joined together to form on-chip pipelines or networks.
Dr. Beau Webber

Re: Joining arrays of Apl computational nodes.

PostPosted: Mon Jan 27, 2014 5:06 am
by Makkies_9
Nice post!