OCUK Xmas Programming Challenge

Soldato
Joined
20 Jun 2010
Posts
3,251
How are you calculating using the GPU, via CUDA or something else? (also wouldn't that be classed as an external lib? :p)

This is something i wanted to ask. It makes sense to optimise using the GPU, but to do so requires a dependency.

ps3 cell?

Or how about some en-mass distributed processing, winnings shared? :p Bot net?
 
Soldato
OP
Joined
7 Apr 2004
Posts
4,212
Just to be perfectly clear: the code we produce has to carry out the whole computation every time it runs? That is, we're not allowed to store answers from the previous stage? Because some of the times people are getting are insane.

That's correct :)

This is something i wanted to ask. It makes sense to optimise using the GPU, but to do so requires a dependency.

Or how about some en-mass distributed processing, winnings shared? :p Bot net?

Yer the external library rule is really just to make it easier for me to mark them so there's no hassle of locating, downloading and installing extra stuff to get it compiled. If it's really easy and tied up nicely in your submission, I won't complain too much...

A botnet would also be awesome :p

Submitted my entry.

Thanks, received and working :) OMG @ running in 0.045s with threading!!
 
Soldato
Joined
13 Jan 2003
Posts
23,673
How are you calculating using the GPU, via CUDA or something else? (also wouldn't that be classed as an external lib? :p)

Indeed. Given the speeds that people have this running at, it's unlikely to be faster (GPU needs far more maths to make it viable). It's the sheer stupidity of how parallel you can make it.

For example, you can kick start the prime number processing whilst doing other stages in parallel. It also allows the numbers to be built up and then summed for the later stage. Then each of the N stream processors calculates a prime number (note this is completely sub-optimal as the GPUs stream processors are joined at the group's program counter so looping etc is not good but I have just thought of another way todo it with ping-ponging that may go faster).
(note there was no rule about timings only being per stage originally - scope creep!)

Yes it wouldn't be eligible for submission as it's OpenCL but I've given up on submitting something within the rules.. just something for the doing something different because you can :D

Oh.. it makes the machine freeze completely until it's finished :cool:

I could use, if I had apple servers, grid net too with the mac mini and the mbp running.. but at least OpenCL is available on linux.
 
Last edited:
Associate
Joined
30 Jun 2009
Posts
405
Ooh you all have much nicer timings than me, mine take a few seconds(2-3? not bothered with time stamping it) on my laptop without any multithreading in C. Will see if i have time to clean it up and submit it. But then as i won't win for sheer speed by the looks of it :(
 
Associate
Joined
15 Oct 2009
Posts
579
Some of these times are crazy. I've gone for sheer simplicity rather than speed, but it'll be interesting to see how some of these speeds have been achieved.
 
Associate
Joined
17 Oct 2002
Posts
562
Location
Cambridge
0.045s is rather fast :( I've just multi-threaded my stage one and the program is still taking a total of ~100ms...

It's not really a fair comparison if you don't do it on the same machine. I don't get anything like that fast on my machine. It's more like 200ms on my machine, so I wouldn't rule out yours yet.
 
Soldato
Joined
18 Oct 2002
Posts
3,926
Location
SW London
Mine's at around 300ms on my desktop now. On my core i5 laptop I've had it at 160ms.
Half tempted to go for a bit more parallelisation now I've seen some the times you guys are getting :p
 
Soldato
OP
Joined
7 Apr 2004
Posts
4,212
Entry submitted - takes about 15 seconds to run on a (virtualised) Q6700. As expected, PHP isn't exactly the best suited language for this sort of task :).

Thanks, got it working - clocks in at 7.680 seconds :) But as you say I guess it's expected that PHP would be slower. I will try and devise some kind of way to combine language overhead with execution time for judging.

Yeah can we have all the solutions uploaded to Google code after the deadline? Would be really interested to see some of this code (especially the one that's running at 0.045s ffs! :p)

Yep don't worry I'll upload + organise all submissions in a web based code viewer with syntax highlighting etc.
 
Associate
Joined
15 Oct 2009
Posts
579
After seeing all of these fast time's I've decided that the simple way sucks, so I'm trying to optimize mine to get it's time down. I've managed to get it down to 1370ms so far, but it's still not enough, i need moar!!! :D
 
Associate
Joined
24 Nov 2006
Posts
183
Location
Hartlepool
Ah better than I had hoped then!
Will still try and work on a few bits and tidy the whole thing up.
This should be a more regular thing, I'm not that bothered about the prize, its just the challenge.
Can always do with things like this to keep the brain ticking over! :)
 
Associate
Joined
7 Sep 2003
Posts
1,897
Location
Bo'ness
I have given up trying to make it any faster just can't think how to do it. Just interested to see how you guys have made it so quick!
 
Back
Top Bottom