public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: burlen <bloring@unh.edu>
To: gcc-help@gcc.gnu.org
Subject: Gnu C++ & Open MP
Date: Wed, 09 Jan 2008 01:40:00 -0000	[thread overview]
Message-ID: <478393DD.6030800@unh.edu> (raw)

Hi,
I notice some strange result when I use Gnu OpenMP, I have an existing 
C++ serial code which has some time consuming for loops where some 
calculations are made on a large arrays of doubles,(12 arrays of length 
1E6 for example) and also some of these arrays are copied to create a 
vector field(also an array of doubles). This particular for loop is 
where the code takes 90% of its time and typically can take 1 or 2 
minutes here.  What I notice is that when I run open MP its actually 
slower than the serial code! Not by much but still slower. Here I use 
the command 'time' to compare. Also I notice by watching top, that in 
both cases only 1 core is taxed, while in the OpenMP build memory usage 
doubles(actually a second core goes up from 0% to about 10%). I have a 
quad core system(dual cpu dual core, and 4G of ram), so this result is 
totally unexpected. In my code I explicitly set the number of threads to 
4. I was expecting to see all 4 cores running at 80-90%. I have verified 
that 4 threads are being launched by runing the OpenMP build in GDB. 
What is going on here? how can I figure what the problem is?
Thanks Burlen



             reply	other threads:[~2008-01-08 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09  1:40 burlen [this message]
2008-01-09  2:58 ` Tom St Denis
2008-01-09  9:29   ` burlen
2008-01-09  1:58 burlen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478393DD.6030800@unh.edu \
    --to=bloring@unh.edu \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).