[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - The Apl to C compiler aplc is now ported to the Parallella

The Apl to C compiler aplc is now ported to the Parallella

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

The Apl to C compiler aplc is now ported to the Parallella

Postby Dr.BeauWebber » Tue May 28, 2013 2:14 am

The Apl to C compiler aplc is now ported to the Parallella.
Strictly this belongs on the Software => Parallel Programming section, but as yet there is not a section for the array processing language Apl.

What is still needed is the harness to link different processes on nodes.

The aplc library now running on parallella 1 node simulator :

Parallella epiphany c :
no: sleep microsleep nanosleep pipe dup ttyname
So I hacked dummy donothing replacement functions
- need to be replaced by specific e- functions or possibly occam structures.

$ aplcc helloworld.apl
$ ./e-aplcc aplc_helloworld.c
$ ../../INSTALL/bin/e-run a.out
Hello World from Aplc

In principle the whole compiler is ported, but everything has to be run on the simulator by calling e-run.

Here are some Apl matrix expressions that I have had running on Altera NiosII soft processors on field programmable gate arrays, as well as on the XMOS 4 processors on a chip devices, as well as now on a functional simulator for the 16 processor Parallella chip :

AplX Source code :
Function matrix :

'A:'
A ← ⍳ 5
A
' '
'B:'
B ← ⍳ 9
B
' '
'C: outer product:'
C ← A ∘.× B
C
' '
'T: transpose:'
T ← ⍉ C
T
' '
'O: inner product (matrix multiply):'
O ← C +.× T
O
' '
'S: solve matrix:'
S ← C ⌹ A
S

And here it is running on the NiosII soft-processor :

A:
1 2 3 4 5

B:
1 2 3 4 5 6 7 8 9

C: outer 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

O: inner product (matrix multiply):
285 570 855 1140 1425
570 1140 1710 2280 2850
855 1710 2565 3420 4275
1140 2280 3420 4560 5700
1425 2850 4275 5700 7125

S: solve matrix:
1 2 3 4 5 6 7 8 9

The XMOS chip is integer only, and the extra code for doing the matrix multiply and matrix solve mean that it can only fit the A,B,C,T calculations into one core.

So far I have used the one node Parallella simulator for testing :
aplcc -c matrix.apl
./e-aplcc matrix.c
$ ../../INSTALL/bin/e-run a.out
A:
1 2 3 4 5

B:
1 2 3 4 5 6 7 8 9

C: outer 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

O: inner product (matrix multiply):
285 570 855 1140 1425
570 1140 1710 2280 2850
855 1710 2565 3420 4275
1140 2280 3420 4560 5700
1425 2850 4275 5700 7125

S: solve matrix:
1 2 3 4 5 6 7 8 9

cheers,
Dr. Beau Webber
Director, Lab-Tools Ltd.
User avatar
Dr.BeauWebber
 
Posts: 114
Joined: Mon Dec 17, 2012 4:01 am
Location: England

Re: The Apl to C compiler aplc is now ported to the Parallel

Postby ysapir » Tue May 28, 2013 8:07 am

That's very nice. How does the C program (matrix.c) looks like? What is the size of the executable?

Do you always need standard output for using this language? Does it support low-level operations like memory referencing, etc, so one can use an APL program to read data, calculate and write a result to a shared buffer in memory, or is it bound to data hard-coded into the program? Then, can you share data among cores to support parallel processing?
User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Re: The Apl to C compiler aplc is now ported to the Parallel

Postby Dr.BeauWebber » Tue May 28, 2013 10:15 am

User avatar
Dr.BeauWebber
 
Posts: 114
Joined: Mon Dec 17, 2012 4:01 am
Location: England

Re: The Apl to C compiler aplc is now ported to the Parallel

Postby ysapir » Tue May 28, 2013 11:35 am

The *sleep functions should be implemented by e_ctimer*() function calls. I am surprised as to timeofday()... does it return any meaningful data?
User avatar
ysapir
 
Posts: 393
Joined: Tue Dec 11, 2012 7:05 pm

Re: The Apl to C compiler aplc is now ported to the Parallel

Postby 9600 » Tue May 28, 2013 12:32 pm

Andrew Back
User avatar
9600
 
Posts: 997
Joined: Mon Dec 17, 2012 3:25 am


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 16 guests

cron