Multi-processing using the array processing language Apl.

XCore Project reviews, ideas, videos and proposals.
User avatar
BeauWebber
Member++
Posts: 17
Joined: Thu Sep 27, 2012 11:41 pm

Multi-processing using the array processing language Apl.

Post by BeauWebber »

I am keen to use the array processing language Apl as nodes in a multi-processing network.
I first worked on this in the 1980s/1990s, with the Transputer, on a Helios computer.

In the 80s I was hand-translating Apl to Basic and 6800 assembler, in the 90s to LabVIEW, and at the moment I am having to do it to VHDL. The aim is to make use of Tim Budd's aplc Apl to c translator, which in the 1990s I ported to SGIs and the Dec Alpha, as well as the lowly Atari TT. This has the advantage that in the 19980s/1990s I also added a minimum set of multi-tasking / multi-processor facilities (Julian Timestamp, pipe, spawn, and detailed I/O control) which I believe give it some of the capacity to form multiprocessing nodes :
http://home.earthlink.net/~swsirlin/aplcc.html
http://www.lab-tools.com/instrumentatio ... dod22.html
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. http://doi.acm.org/10.1145/379199.379200 (The proposal and implementation of a software mechanism now used by IBM.)

Now I have had some trouble in compiling the aplc run time library for the XMOS devices, I seem to keep picking up more than one library definition for some functions. I regret to say that to get this library to compile I have had to turn off all the multi-tasking facilities, but for the moment simple code does run. I will have to dig and see what the problem is, because when I look at the library files, it all seems to be there.

Anyway, for a very short test, of summing a vector :
Apl running in MicroApl's AplX :

Code: Select all

      V ← ⍳ 9
      ⎕ ← V
1 2 3 4 5 6 7 8 9
      S ← +/V
      ⎕ ← S
45
XMOS :
Translated to c and compiled and running on a single core of the XC-1A module :

Code: Select all

 1 2 3 4 5 6 7 8 9
 45
So now I need to try and get the link communications working again. Lots of reading manuals I guess, and looking at the library functions.

If anyone else would like to look at this library problem, that would be great.
The aplc source code is freely down-loadable, see above
cheers,
Beau


User avatar
BeauWebber
Member++
Posts: 17
Joined: Thu Sep 27, 2012 11:41 pm

Post by BeauWebber »

Here is a slightly longer example of aplc compiled Apl running on an XMOS device :

matrix_tny2 :

AplX Source :

Code: Select all

'A:'
A ← ⍳ 5
A
' '
'B:'
B ← ⍳ 9
B
' '
'C: inner product:'
C ← A ∘.× B
C
' '
'T: transpose:'
T ← ⍉ C
T
XMOS : running on an XC-1A :

Code: Select all

A:
 1 2 3 4 5
 
B:
 1 2 3 4 5 6 7 8 9
 
C: inner product:
 1  2  3  4  5  6  7  8  9
 2  4  6  8 10 12 14 16 18
 3  6  9 12 15 18 21 24 27
 4  8 12 16 20 24 28 32 36
 5 10 15 20 25 30 35 40 45

T: transpose:
 1  2  3  4  5
 2  4  6  8 10
 3  6  9 12 15
 4  8 12 16 20
 5 10 15 20 25
 6 12 18 24 30
 7 14 21 28 35
 8 16 24 32 40
 9 18 27 36 45
cheers,
Beau