Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

OpenMP in practice

Name: Anonymous 2012-01-05 14:53

Is OpenMP actually usable? I had a very simply parallelizable problem written in C that executed fast enough (under 2 minutes), but I thought it would make a nice benchmark. Basically, it had n (roughly equally sized, n being < 200) sections that could be executed totally independently, and only needed a join at the end.

I installed the latest gcc with the OpenMP `task' support to test it, and the execution got only around five seconds faster compared to the non-MP version with the same compiler. Moreover, only one of the two CPUs was active during the #ompd part. This stuff is supposed to be simple. What gives?

Name: Anonymous 2012-01-05 16:04

>>7
Try this next time.

#pragma omp parallel sections
{
#pragma omp section
 {
  do something;
 }

#pragma omp section
 {
  do something else;
 }
}


Try to set CPU affinity if the kernel decides to run it on a single core.

And yes, I did expect more, of course my assumption is that you're not retarded. What you did was ask "what's wrong with what I did" without actually posting what you did, we're not magicians so how are we supposed to tell?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List