Dear list,

I'm writing an X10 application which is suitable to parallelise. I work on
an Intel Quad Core CPU and want to use 4 Threads. I changed X10_NTHREADS
accordingly. The results are ok, I got almost a linear speedup at the
calculations. But there is one problem. I also have to read a big imagefile
at the beginning and this takes a lot more time, when I use more Threads.

$ x10c++ -STATIC_CALLS -O -NO_CHECKS  -o x10app Code.x10

$ export X10_NTHREADS=1
$ ./x10app
read image data: 2336 ms
calculation: 8290 ms

$ export X10_NTHREADS=4
$ ./x10app
read image data: 6129 ms
calculation: 2330 ms

Here is a code snippet of reading the image:

comp1 = new Array[Int]((0..(height-1))*(0..(width-1)));
comp2 = new Array[Int]((0..(height-1))*(0..(width-1)));
comp3 = new Array[Int]((0..(height-1))*(0..(width-1)));

for([i,j] in comp1) {
  comp1(i,j) = filereader.readByte() & 0xFF;
  comp2(i,j) = filereader.readByte() & 0xFF;
  comp3(i,j) = filereader.readByte() & 0xFF;
}

I don't understand, maybe someone can help me?

Sascha
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to