comp.lang.ada
 help / color / mirror / Atom feed
* a multicore XMOS CPU
@ 2010-02-10 19:10 darek
  2010-02-11 11:45 ` Ludovic Brenta
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: darek @ 2010-02-10 19:10 UTC (permalink / raw)


Hi All,
 some time ago I have  discovered  very interesting CPU architecture
developed at Bristol University (some of you still remember
transputers) (http://www.xmos.com/).
The CPU has 4 cores connected via an internal bus and every core can
run up to 8 real-time threads per core
(http://www.xmos.com/technology/silicon-technology). An internal clock
@100MHz gives time resolution of 10ns.

More about the architecture can be found here: http://www.xmos.com/support/documentation
.

Well, I could not resist  and I got this evaluation board (https://
www.xmos.com/products/development-kits/xc-2-ethernet-kit).

The company provides the whole set of development tools (https://
www.xmos.com/technology/design-tools) at no cost, and the tool chain
is GNU based (there is also an extended C compiler that supports
allocation of tasks  at the core level).
I am willing to dedicate some of my free time to   try to port Ada
compiler to this platform.
Some thing, however, are not quite clear to my. For example:
  1. How to distribute  tasks between cores ? It is responsibility of
the Ada run-time or the programmer shall do it explicitly (each core
up to 8 real-time threads) via pragmas (I think, extending the
language definition is not a good idea)?
 2. Is it possible to create from publicly available source GNAT code
a system that does not require any OS support (a bare metal solution)?
3. Last but not least. Is this enterprise worth  any efforts (nice
hobby project but then ...) ?

I hope, that there would be some wise advices  around ....

Cheers,
  Darek

P.S. Imagine an Ada program running on this device:
https://www.xmos.com/products/development-kits/xmp-64








^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: a multicore XMOS CPU
  2010-02-10 19:10 a multicore XMOS CPU darek
@ 2010-02-11 11:45 ` Ludovic Brenta
  2010-02-15 12:45   ` Colin Paul Gloster
  2010-02-12 14:51 ` Lucretia
  2010-02-15 13:10 ` Colin Paul Gloster
  2 siblings, 1 reply; 8+ messages in thread
From: Ludovic Brenta @ 2010-02-11 11:45 UTC (permalink / raw)


darek <darek.maksim...@gmail.com> wrote on comp.lang.ada:
>   1. How to distribute  tasks between cores ? It is responsibility of
> the Ada run-time or the programmer shall do it explicitly (each core
> up to 8 real-time threads) via pragmas (I think, extending the
> language definition is not a good idea)?

I'd think the easiest, as a first step would be to mimic the extended
C they provide and then, maybe, provide for dynamic thread allocation
from within the kernel (see below).

>  2. Is it possible to create from publicly available source GNAT code
> a system that does not require any OS support (a bare metal solution)?

Yes, it is possible. However I think tasking support requires a kernel
such as the OpenRavenscar kernel[1].

[1] http://polaris.dit.upm.es/~ork/

> 3. Last but not least. Is this enterprise worth  any efforts (nice
> hobby project but then ...) ?

I guess that's for you to decide. The experience you gain doing such a
nice hobby project will be very valuable anyway.

--
Ludovic Brenta.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: a multicore XMOS CPU
  2010-02-10 19:10 a multicore XMOS CPU darek
  2010-02-11 11:45 ` Ludovic Brenta
@ 2010-02-12 14:51 ` Lucretia
  2010-02-15 12:46   ` Colin Paul Gloster
  2010-02-15 13:10 ` Colin Paul Gloster
  2 siblings, 1 reply; 8+ messages in thread
From: Lucretia @ 2010-02-12 14:51 UTC (permalink / raw)


http://www.a-eon.com



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: a multicore XMOS CPU
  2010-02-11 11:45 ` Ludovic Brenta
@ 2010-02-15 12:45   ` Colin Paul Gloster
  0 siblings, 0 replies; 8+ messages in thread
From: Colin Paul Gloster @ 2010-02-15 12:45 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 2528 bytes --]

On Thu, 11 Feb 2010, Ludovic Brenta wrote:

|------------------------------------------------------------------------|
|"darek <darek.maksim...@gmail.com> wrote on comp.lang.ada:              |
|>   1. How to distribute  tasks between cores ? It is responsibility of |
|> the Ada run-time or the programmer shall do it explicitly (each core  |
|> up to 8 real-time threads) via pragmas (I think, extending the        |
|> language definition is not a good idea)?"                             |
|------------------------------------------------------------------------|

If you can accomplish a compiler which will automatically take up all
of the cores, then congratulations. However, it is not unreasonable
for the end users to be required to determine this scheduling. For
example, I often need to run many programs and I have many cores for
them. It often does not matter whether I run them all at onece, one
per core, or one after the other, taking up many cores each time. It
is trivial to efficiently put each on one core each.

|------------------------------------------------------------------------|
|"I'd think the easiest, as a first step would be to mimic the extended  |
|C they provide and then, maybe, provide for dynamic thread allocation   |
|from within the kernel (see below).                                     |
|                                                                        |
|>  2. Is it possible to create from publicly available source GNAT code |
|> a system that does not require any OS support (a bare metal solution)?|
|                                                                        |
|Yes, it is possible. However I think tasking support requires a kernel  |
|such as the OpenRavenscar kernel[1].                                    |
|                                                                        |
|[1] http://polaris.dit.upm.es/~ork/                                     |
|                                                                        |
|[..]"                                                                   |
|------------------------------------------------------------------------|

Beware of ORK. It had a bug in it which had been fixed in GNAT seven
years earlier. Not to mention the excessive overhead of ORK (as
opposed to RAVENSCAR) for a virtually null program taking up nearly
half of the memory you have (per core or overall, it was not clear
from the product brief what the memory was being quoted for).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: a multicore XMOS CPU
  2010-02-12 14:51 ` Lucretia
@ 2010-02-15 12:46   ` Colin Paul Gloster
  0 siblings, 0 replies; 8+ messages in thread
From: Colin Paul Gloster @ 2010-02-15 12:46 UTC (permalink / raw)


On Fri, 12 Feb 2010, Lucretia wrote:

|----------------------|
|"http://www.a-eon.com"|
|----------------------|

Luke,

I found simply an uninformative webpage. Please elaborate.

Thanks,
Colin Paul Gloster



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: a multicore XMOS CPU
  2010-02-10 19:10 a multicore XMOS CPU darek
  2010-02-11 11:45 ` Ludovic Brenta
  2010-02-12 14:51 ` Lucretia
@ 2010-02-15 13:10 ` Colin Paul Gloster
  2010-02-15 13:55   ` KarlNyberg
  2 siblings, 1 reply; 8+ messages in thread
From: Colin Paul Gloster @ 2010-02-15 13:10 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 1613 bytes --]

On Wed, 10 Feb 2010, Darek Maksimiuk sent:

|------------------------------------------------------------------|
|"[..]                                                             |
|                                                                  |
|[..]                                                              |
|I am willing to dedicate some of my free time to   try to port Ada|
|compiler to this platform.                                        |
|[..]                                                              |
|                                                                  |
|[..]                                                              |
|                                                                  |
|P.S. Imagine an Ada program running on this device:               |
|https://www.xmos.com/products/development-kits/xmp-64"            |
|------------------------------------------------------------------|

Dear Darek Maksimiuk,

Well, if you show me the C++ program which I showed in
news:alpine.LNX.2.00.1002151055530.17315@Bluewhite64.example.net
running on your XMOS development kit at a speed which when scaled up
for an XMP-64 would be faster than an Intel quadcore machine, then I
would be able to get an Ada compiler for it, if I could convince a
funding agency to pay for an XMP-64.

Please let me know what happens.

Yours sincerely,
Colin Paul Gloster,
Grupo de Instrumentação Atómica e Nuclear,
Departamento de Física,
Universidade de Coimbra,
Rua Larga,
3004-516 Coimbra,
Portugal.
Telephone: +351 239 410663
Fax: +351 239 829158

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: a multicore XMOS CPU
  2010-02-15 13:10 ` Colin Paul Gloster
@ 2010-02-15 13:55   ` KarlNyberg
  2010-02-15 15:31     ` Colin Paul Gloster
  0 siblings, 1 reply; 8+ messages in thread
From: KarlNyberg @ 2010-02-15 13:55 UTC (permalink / raw)


On Feb 15, 8:10 am, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org>
wrote:
> On Wed, 10 Feb 2010, Darek Maksimiuk sent:
>
> |------------------------------------------------------------------|
> |"[..]                                                             |
> |                                                                  |
> |[..]                                                              |
> |I am willing to dedicate some of my free time to   try to port Ada|
> |compiler to this platform.                                        |
> |[..]                                                              |
> |                                                                  |
> |[..]                                                              |
> |                                                                  |
> |P.S. Imagine an Ada program running on this device:               |
> |https://www.xmos.com/products/development-kits/xmp-64"            |
> |------------------------------------------------------------------|
>
> Dear Darek Maksimiuk,
>
> Well, if you show me the C++ program which I showed innews:alpine.LNX.2.00.1002151055530.17315@Bluewhite64.example.net
> running on your XMOS development kit at a speed which when scaled up
> for an XMP-64 would be faster than an Intel quadcore machine, then I
> would be able to get an Ada compiler for it, if I could convince a
> funding agency to pay for an XMP-64.
>
> Please let me know what happens.
>
> Yours sincerely,
> Colin Paul Gloster,
> Grupo de Instrumentação Atómica e Nuclear,
> Departamento de Física,
> Universidade de Coimbra,
> Rua Larga,
> 3004-516 Coimbra,
> Portugal.
> Telephone: +351 239 410663
> Fax: +351 239 829158

That link didn't resolve to anything interesting for me.  Can you
forward me what you might have - it might be interesting to try it on
my 8-core x 4 thread SunFire T1000.

-- Karl --



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: a multicore XMOS CPU
  2010-02-15 13:55   ` KarlNyberg
@ 2010-02-15 15:31     ` Colin Paul Gloster
  0 siblings, 0 replies; 8+ messages in thread
From: Colin Paul Gloster @ 2010-02-15 15:31 UTC (permalink / raw)


[-- Attachment #1: Type: TEXT/PLAIN, Size: 7036 bytes --]

[Note I use a news server which forbids attachments so the attachments
mentioned below were emailed to Karl Nyberg.]


On Mon, 15 Feb 2010, Karl Nyberg sent:

|----------------------------------------------------------------------|
|"On Feb 15, 8:10 am, Colin Paul Gloster <Colin_Paul_Glos...@ACM.org>  |
|wrote:                                                                |
|> On Wed, 10 Feb 2010, Darek Maksimiuk sent:                          |
|>                                                                     |
|> |------------------------------------------------------------------||
|> |"[..]                                                             ||
|> |                                                                  ||
|> |[..]                                                              ||
|> |I am willing to dedicate some of my free time to   try to port Ada||
|> |compiler to this platform.                                        ||
|> |[..]                                                              ||
|> |                                                                  ||
|> |[..]                                                              ||
|> |                                                                  ||
|> |P.S. Imagine an Ada program running on this device:               ||
|> |https://www.xmos.com/products/development-kits/xmp-64"            ||
|> |------------------------------------------------------------------||
|>                                                                     |
|> Dear Darek Maksimiuk,                                               |
|>                                                                     |
|> Well, if you show me the C++ program which I showed in
news:alpine.LNX.2.00.1002151055530.17315@Bluewhite64.example.net
|> running on your XMOS development kit at a speed which when scaled up|
|> for an XMP-64 would be faster than an Intel quadcore machine, then I|
|> would be able to get an Ada compiler for it, if I could convince a  |
|> funding agency to pay for an XMP-64.                                |
|>                                                                     |
|> Please let me know what happens.                                    |
|>                                                                     |
|> Yours sincerely,                                                    |
|> Colin Paul Gloster,                                                 |
|> Grupo de Instrumentação Atómica e Nuclear,                          |
|> Departamento de Física,                                             |
|> Universidade de Coimbra,                                            |
|> Rua Larga,                                                          |
|> 3004-516 Coimbra,                                                   |
|> Portugal.                                                           |
|> Telephone: +351 239 410663                                          |
|> Fax: +351 239 829158                                                |
|                                                                      |
|That link didn't resolve to anything interesting for me.  Can you     |
|forward me what you might have - it might be interesting to try it on |
|my 8-core x 4 thread SunFire T1000.                                   |
|                                                                      |
|-- Karl --"                                                           |
|----------------------------------------------------------------------|


Dear Mr. Nyberg,

Please find attached in  Logarithmic_Work_In_Ada.adb  and
logarithmic_work_in_CPlusPlus.cc  and  body_in_CPlusPlus.cc  the
timing programs which I presented in another thread on
news:comp.lang.ada  in the post
news:alpine.LNX.2.00.1002151055530.17315@Bluewhite64.example.net

They represent just a few per cent at most of real simulations which I
work on such as in the attached files
Cosima_activation_for_gamma_source__Step1.source  and
Gamma-Ray_Imager_includable_Cosima_commands_for_Steps_1_and_3.source
and
Gamma-Ray_Imager_includable_Cosima_commands_for_three_steps.source
and  geometry.geo.setup  which are input files for MEGAlib (which can
be downloaded from
WWW.MPE.MPG.De/MEGA/megalib.html#downloads
and which also needs you to download Geant and CLHEP (as explained in
the MEGAlib installation manual)). Those *source and *setup files can
be used (after you have installed MEGAlib) by copying them into a
directory with about 800 megabytes free space and running
date ; time cosima -s 1234 Cosima_activation_for_gamma_source__Step1.source >> Step1_with_seed_1234.stdout.txt 2>> Step1_with_seed_1234.stderr.txt ; date

Note that the installation scripts supplied with MEGAlib and Geant and
CLHEP do not use compiler optimization flags (not even when you use
the scripts' options supposedly for optimization) so set these
yourself or  cosima  would take more than twenty times longer to run
if you compile with GCC.

So, for compiling CLHEP, set the environment variable CXXFLAGS to a
suitable value, for example in the case of GCC with BASH:
export CXXFLAGS='-findirect-inlining -ftree-switch-conversion -O3 -ffast-math'

If compiling on GNU/Linux with GCC then modifying the file
geant4.9.2.b01/config/sys/Linux-g++.gmk
to contain
#Gloster wants optimization...
  CXXFLAGS += -O3 -findirect-inlining -ftree-switch-conversion -ffast-math
#Gloster wants symbolic debugging...
  CXXFLAGS += -g
would be a good idea. For Sun Studio on Solaris, it might be
worthwhile checking whether
geant4.9.2.b01/config/sys/SUN-CC.gmk
lacks optimization flags.

Similarly for MEGAlib, create the file
MEGAlib/config/Makefile.user
and in the case of GCC put something like
#Gloster wants optimization...
OPT += -O3 -findirect-inlining -ftree-switch-conversion -ffast-math
#Gloster wants symbolic debugging...
OPT += -g


These libraries are not published in Ada, but I have made significant
improvements in Ada which are not yet published. I would be interested
in making a considerable amount of this work available to you in the
near future. In the meantime I would be interested in timings which
you could give me for  Logarithmic_Work_In_Ada.adb  and
logarithmic_work_in_CPlusPlus.cc  and
Cosima_activation_for_gamma_source__Step1.source  . I would be happy
to collaborate with you on a paper.

I have been tasked with considering whether it is worthwhile making a
proposal to use a supercluster (
WWW.LCA.UC.Pt/welcome-to-milipeias-portal?set_language=en
). Perhaps your hardware could be used instead or also.

Yours sincerely,
Colin Paul Gloster

P.S. Thank you for the annotated copy of the Ada83 standard which you
gave me many years ago. Unfortunately it and other Ada hardcopy
documents were damaged in a flood last month, but I have left it in
sunlight and the worst of the damage seems to have cleared up
quickly.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-02-15 15:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-10 19:10 a multicore XMOS CPU darek
2010-02-11 11:45 ` Ludovic Brenta
2010-02-15 12:45   ` Colin Paul Gloster
2010-02-12 14:51 ` Lucretia
2010-02-15 12:46   ` Colin Paul Gloster
2010-02-15 13:10 ` Colin Paul Gloster
2010-02-15 13:55   ` KarlNyberg
2010-02-15 15:31     ` Colin Paul Gloster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox