[email protected] wrote:
Hi Deephan -

(note: I'm cc'ing the corepy-devel list.. that's the best place to get
support)

The easiest way to do parallel operations on an array is to use the
stream_buffer and parallel iterators along with ParallelInstructionStream.
 examples/spu_basics.py:DoubleBufferExample() demonstrates this.

ParallelInstructionStream sets up the InstructionStream to execute on 1 or
more SPUs.  Additional information such as rank and world size are passed
as parameters to the instruction stream.

The parallel iterator uses the rank/size information to partition an array
across the spus by dividing up the array into equal sized chunks.  The
code synthesized inside the iterator block is executed on the chunk of
data assigned to the SPU.

The stream_buffer manages the DMA operations to move data between main
memory and local store.

In the example, lines 200-203 demonstrate how to load data into registers
and perform a simple operation on them.

This should get you started...

Thanks for trying out CorePy!

-Chris

Hello Chris,

I kindly request to help me figure out this small issue. I am sure it
wont take more than 10 minutes of your time.

I am trying to get a simple Cell BE program to execute in parallel on
multiple SPUs. The example given for parallel execution on Cell in the
COREPY homepage doesnt given me enough cues on how to deal with my
problem.

My problem is very simple (although it is far more complex, i would
like to give a simple headstart)

All i want to do is
      i) create an extarray of any range                  (Ex: an
extarray of range 10000 [0,1,2.... 10000]

      ii) partition the array among n spus               (Ex: n_spus =
4, spu 1: [0,1,..2500] spu 2: [2501,...5000] spu 3: [5001,... 7500]
spu 4: [7501...9999]

      iii) perform some computation on each chunk in parallel (Ex:
increment by 1, spu 1: [1,2,... 2501]

Ive written the serial code for this problem with the maximum data
size (2048). I was looking into the corepy package for further
parallel examples, but i couldn't get a clue as to how to solve this
problem. I kindly request you to look into my source file attached
herewith this mail.

It would be great if you could help me solve this simple problem.

Thank you very much.

Regards,
Deephan.

P.S: COREPY is truly an eye-opener for amateur Cell BE programmers like
me.




Hi,

spu_basics gives a double buffering example. In this example, only one stream is used for creating buffers. How can i work with multiple streams?

For instance, i would like to parallelize (buffering) two arrays and perform operations across both buffers.

One possible way to achieve this is using vectors. Does corepy support instructions for Vector operations?


_______________________________________________
Corepy-devel mailing list
[email protected]
http://www.osl.iu.edu/mailman/listinfo.cgi/corepy-devel

Reply via email to