Fractal benchmark

IRIX/Nekoware development, porting and related topics.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
ShadeOfBlue
Moderator
Moderator
Posts: 799
Joined: Tue Nov 25, 2003 12:09 pm
Location: Europe

Re: Fractal benchmark

Unread postby ShadeOfBlue » Thu Jun 25, 2009 4:36 am

The "testrun.sh" consistently uses only one CPU, the time used for that test is about 82 seconds (on a 16P 400MHz O3k, compiled with the defaults [and MIPSpro 7.4.4]: "-DEFAULT:abi=n32:isa=mips4:proc=r12k" and the "-O2" from the Makefile).

The other command uses about 10-12 CPUs and is still running :)

When it finishes, I will try to get the first test to run on all CPUs (will probably require setting the number of threads to 64 or somesuch).

User avatar
Martin Steen
Posts: 159
Joined: Tue Sep 25, 2007 2:00 am
Location: Braunschweig (Germany)
Contact:

Re: Fractal benchmark

Unread postby Martin Steen » Thu Jun 25, 2009 5:05 am

Geoman wrote:Thanks for sharing the sourcecode. It built on MIPSpro 7.4.4m without any error or warning.

Now I'm torturing the Octane with it:

Code: Select all

/fractbatch 8192 8192 1024 32 frects0089.txt


I get 187,8 CPU% right at the beginning.


Ok, then everything seems to work fine! :)

There are two strange warnings I turned off (-woff). They have something to do with
the STL ("A template was detected during header processing"). I don't know what it is
and G++ doesn't show this warning, so I switched it off.

Thanks for testing and best regards,
Martin

User avatar
ShadeOfBlue
Moderator
Moderator
Posts: 799
Joined: Tue Nov 25, 2003 12:09 pm
Location: Europe

Re: Fractal benchmark

Unread postby ShadeOfBlue » Thu Jun 25, 2009 5:10 am

Update:
The long test took 1935 seconds and used 11 CPUs in average.

I re-did the short test with 32 threads: 9.3 seconds, ~9 CPUs.
The program dumps core at 40+ threads :?

Code: Select all

Trace/BPT/RangeErr/DivZero/Ovflow trap (core dumped)

User avatar
Martin Steen
Posts: 159
Joined: Tue Sep 25, 2007 2:00 am
Location: Braunschweig (Germany)
Contact:

Re: Fractal benchmark

Unread postby Martin Steen » Thu Jun 25, 2009 5:33 am

ShadeOfBlue wrote:The "testrun.sh" consistently uses only one CPU, the time used for that test is about 82 seconds (on a 16P 400MHz O3k, compiled with the defaults [and MIPSpro 7.4.4]: "-DEFAULT:abi=n32:isa=mips4:proc=r12k" and the "-O2" from the Makefile).

The other command uses about 10-12 CPUs and is still running :)

When it finishes, I will try to get the first test to run on all CPUs (will probably require setting the number of threads to 64 or somesuch).


Thank you for starting your huge machine for this test!

It looks like IRIX does not start all CPUs when a thread is running to short.

After starting, every worker-thread calculates exactly four lines. The supervisor-thread
waits for all worker threads to stop (*) . Then the supervisor-thread writes the lines to the
TGA-file and starts the threads again to compute the next four lines.

This process makes it possible to render pictures of nearly arbitrary size (without consuming
much RAM).

The program dumps core at 40+ threads


Probably this has something to do with the number of lines. Maybe the picture is to small for
so many threads. I will check the source.

Thank you for your report!

Best regards,
Martin

*) The worker-thread does't really stop, but waits (pthread_cond_wait) for the next start signal

User avatar
ShadeOfBlue
Moderator
Moderator
Posts: 799
Joined: Tue Nov 25, 2003 12:09 pm
Location: Europe

Re: Fractal benchmark

Unread postby ShadeOfBlue » Thu Jun 25, 2009 5:57 am

Martin Steen wrote:It looks like IRIX does not start all CPUs when a thread is running to short.

You could try forcing each thread to its own CPU with pthread_setrunon_np().

User avatar
Martin Steen
Posts: 159
Joined: Tue Sep 25, 2007 2:00 am
Location: Braunschweig (Germany)
Contact:

Re: Fractal benchmark

Unread postby Martin Steen » Thu Jun 25, 2009 5:59 am

ShadeOfBlue wrote:
Martin Steen wrote:It looks like IRIX does not start all CPUs when a thread is running to short.

You could try forcing each thread to its own CPU with pthread_setrunon_np().



Good idea. Thank you!

Best regards,
Martin

User avatar
hamei
Posts: 10435
Joined: Tue Feb 24, 2004 4:10 pm
Location: over the rainbow

Re: Fractal benchmark

Unread postby hamei » Thu Jun 25, 2009 9:02 am

ShadeOfBlue wrote:
Martin Steen wrote:It looks like IRIX does not start all CPUs when a thread is running to short.

You could try forcing each thread to its own CPU with pthread_setrunon_np().

But isn't the operating system's scheduler normally better at this than letting every program arbitrarily decide what resources it wants to use ?

User avatar
ShadeOfBlue
Moderator
Moderator
Posts: 799
Joined: Tue Nov 25, 2003 12:09 pm
Location: Europe

Re: Fractal benchmark

Unread postby ShadeOfBlue » Thu Jun 25, 2009 1:59 pm

hamei wrote:But isn't the operating system's scheduler normally better at this than letting every program arbitrarily decide what resources it wants to use ?

Normally yes and it does that here too, but it takes the scheduler too long to figure it out (since this program's threads process work in short bursts), so providing it with a hint could possibly improve the performance.

I usually use OpenMP for threading in such programs and it starts using all available CPUs almost instantly. It's also much simpler than writing your own code to do the threading, but then again, I'm just lazy :)

User avatar
legalize
Posts: 119
Joined: Fri Sep 14, 2007 4:04 pm
Location: Salt Lake City, UT, USA
Contact:

Re: Fractal benchmark

Unread postby legalize » Thu Jun 25, 2009 2:52 pm

How far back does OpenMP support go in IRIX?

User avatar
ShadeOfBlue
Moderator
Moderator
Posts: 799
Joined: Tue Nov 25, 2003 12:09 pm
Location: Europe

Re: Fractal benchmark

Unread postby ShadeOfBlue » Fri Jun 26, 2009 5:05 am

legalize wrote:How far back does OpenMP support go in IRIX?

It had OpenMP from at least MIPSpro 7.2 onwards, with support for OMP 2.0 added in 7.4, but even before that, SGI's compilers had special #pragma's for parallelization and the OpenMP spec was partially based on those, IIRC :)

User avatar
bigD
Posts: 466
Joined: Tue Jun 17, 2008 8:38 pm
Location: Philadelphia

Re: Fractal benchmark

Unread postby bigD » Fri Jun 26, 2009 10:53 pm

Code: Select all

OCTANE2 44% ./run1.sh
Fractal benchmark / by Martin Steen
Size   =256x256
Iter   =16384
Threads=4
Render 1 of 3: fract_0088_2.tga
InitThreads OK
....................................................
Render 2 of 3: fract_0088_8.tga
InitThreads OK
....................................................
Render 3 of 3: fract_0088_9.tga
InitThreads OK
....................................................

real    1m59.30s
user    3m30.14s
sys     0m0.29s
converting file fract_0088_2.tga
converting file fract_0088_8.tga
converting file fract_0088_9.tga


This was done on my Octane2 2x300MHz. Render 1 only used one CPU, but the second CPU decided to get off its butt and help out for Render 2 and Render 3. :)

Like Geoman said, running

Code: Select all

/fractbatch 8192 8192 1024 32 frects0089.txt
fires up both processors immediately. It's still pounding away on the Octane now.

Thanks for sharing this! Very cool.
:Onyx2: :Indigo2: :O3x0:

User avatar
Oskar45
Posts: 2258
Joined: Mon Dec 05, 2005 2:35 am
Location: Vienna, Austria

Re: Fractal benchmark

Unread postby Oskar45 » Fri Jul 10, 2009 1:18 am

Servus Martin,

am a bit late to the party. I compiled the source but when I run <./testrun.sh> [with threads = 1], although the tga files are generated ok, I don't see any benchmarking information displayed.

Anyway, for fun I did a <time ./testrun.sh> [with the default sizes/iterations] and get on my Fuel 700Mhz:

Code: Select all

real    0m58.05s
user    0m46.82s
sys     0m0.19s
Everyone loves a lover. Romeo loves Juliet. Therefore, Trump loves Putin.

User avatar
bjornl
Posts: 342
Joined: Tue May 09, 2006 11:55 am
Location: Sweden

Re: Fractal benchmark

Unread postby bjornl » Tue Aug 11, 2009 12:50 pm

I have done some testing on Octane 2xR10000@195MHz with the original program and got the following.

./run1.sh only runs one cpu for Render 1 but two cpus for Render 2 and 3

Code: Select all

real 2m54.19s
user 5m8.01s
sys  0m0.52s

Changing threads => 11 makes both cpus go from start.
./run1.sh with threads = 16

Code: Select all

real 2m37.05s
user 5m8.12s
sys  0m0.50s

Changing threads =>21 coredumps.

Code: Select all

./run1.sh[18]: 1924 Trace/BPT trap(coredump)

./run2.sh runs on two cpus for Render 1,2 and 3, but it take a little while while before both go on for Render 1. It takes about half the render before it happens (20 dots on the meter).

The coredump don't happen with run2.sh, but I only tested up to 64 threads. I guess it has to do with the number of lines in the image as you say.

User avatar
bjornl
Posts: 342
Joined: Tue May 09, 2006 11:55 am
Location: Sweden

Re: Fractal benchmark

Unread postby bjornl » Tue Aug 11, 2009 1:03 pm

Did some more tests on the Origin 32cpu viewtopic.php?f=14&t=16720995 , watching the cpu meters on the MMSC display.

Code: Select all

gigantix 49# ./run1.sh

Fractal benchmark / by Martin Steen
Size   =256x256
Iter   =16384
Threads=4
Render 1 of 3: fract_0088_2.tga
InitThreads OK
....................................................
Render 2 of 3: fract_0088_8.tga
InitThreads OK
....................................................
Render 3 of 3: fract_0088_9.tga
InitThreads OK
....................................................

real    4m1.19s
user    3m59.92s
sys     0m0.13s
converting file fract_0088_2.tga
converting file fract_0088_8.tga
converting file fract_0088_9.tga
For some reason, only 1 cpu worked during Render 1.

Code: Select all

gigantix 50# ./run1.sh

Fractal benchmark / by Martin Steen
Size   =256x256
Iter   =16384
Threads=16
Render 1 of 3: fract_0088_2.tga
InitThreads OK
................................................................
Render 2 of 3: fract_0088_8.tga
InitThreads OK
................................................................
Render 3 of 3: fract_0088_9.tga
InitThreads OK
................................................................

real    0m34.05s
user    4m0.38s
sys     0m0.28s
converting file fract_0088_2.tga
converting file fract_0088_8.tga
converting file fract_0088_9.tga
That's more like it. This time 16 cpus got working directly.

Code: Select all


gigantix 52# time ./fractbatch 256 256 16384 32 frects0088.txt

Render 1 of 3: fract_0088_2.tga
InitThreads OK
Trace/BPT/RangeErr/DivZero/Ovflow trap (core dumped)
Coredumped with 32 threads. Imagesize to small for 32 threads?

Code: Select all

gigantix 56# ./run2.sh

Fractal benchmark / by Martin Steen
Size   =2048x2048
Iter   =16384
Threads=64
Render 1 of 3: fract_0088_2.tga
InitThreads OK
................................................................
Render 2 of 3: fract_0088_8.tga
InitThreads OK
................................................................
Render 3 of 3: fract_0088_9.tga
InitThreads OK
................................................................

real    9m10.86s
user    4h16m1.75s
sys     0m10.56s
converting file fract_0088_2.tga
converting file fract_0088_8.tga
converting file fract_0088_9.tga
Large image size and 64 threads. All cpus working. 4 hours of work ni 9 minutes. That's a supercomputer :-)

User avatar
tesla
Posts: 270
Joined: Fri Feb 29, 2008 4:17 am
Location: Scania, Sweden

Re: Fractal benchmark

Unread postby tesla » Wed Aug 12, 2009 1:18 am

bjornl wrote:Large image size and 64 threads. All cpus working. 4 hours of work ni 9 minutes. That's a supercomputer :-)


Cool stuff.

Is that the system in your fathers shop? Laptop and serial console? I imagine that you haven't brought this beast home? You know, considering the space available. :D

/Matt
If I can't fix it I can fix it so it can't be fixed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Retired from SGI collection, but still a fan. :D


Return to “SGI: Development”

Who is online

Users browsing this forum: No registered users and 2 guests