Re: numerically intensive app doesn't benifit from multi threading
- From: JC <JC@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 5 Dec 2006 07:04:01 -0800
It's definitely not dual core, since the recent dual core Dell machine my
company purchased has the dual core logo on it. This one doesn't have the
dual core logo. And it's about 1 year old, and I think that dual core came
later than that.
If it indeed has 2 CPU (not the hyperthreading 1 CPU), I guess that it
should have 2 separate CPU inside the machine, so opening up and look inside
should help. Right?
Thanks.
"m" wrote:
Based on this info i would guess yes. (you can go to the intel website to.
verify this, but most chips ~ 3.0 GHz would not be dual core)
Assuming that you have a HT CPU, then the lack of speed improvment is only
to be expected since there are two logical CPUs but only 1 set of
computation resources physically in the silicocn.
"JC" <JC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:1E3D3A27-835B-44EB-B9D1-94175C126F00@xxxxxxxxxxxxxxxx
Please also note that there is no hyper threading related logo on the PC.
"JC" wrote:
Here is the info from Dell:
PROCESSOR, 80547, PENTIUM 4 PRESCOTT DT, Pentium 4 Prescott DT, 3.0GHZ, 1
MEGB, 800FSB, SOCKET T, E0, MALE
Can you tell if it's hyberthreading?
Thx.
"JC" wrote:
How can you tell?
"m" wrote:
Are your 2 CPUs a singe hyperthreaded CPU?
"JC" <JC@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0E9C29A6-F054-4E39-98E3-2FB506F27827@xxxxxxxxxxxxxxxx
This may be related to my another post in this group here "program
runs
almost twice as slow on 2 CPU machine when 1 CPU is used".
When I run single thread version of the program on 2 CPU
concurently, it's
almost twice as slow as when I run one instance only. When I run
multi
thread version of the program with 2 thread on 2 CPU, it's same as
running
single thread on 1 CPU.
"JC" wrote:
I have an numerically intensive app where there is a large loop.
I want
to
use multithreading to parallelize the loop. Say we have two
threads, the
1st
one will do 1st half the loop, the 2nd thread will do the other
half.
The
multithreaded loop look like:
for (i = indexBeginForThread; i < indexEndForThread; i++) {
do_numerical_stuff;
update_common_data;
}
The 1st part 'do_numerical_stuff', taking most of the time, and
requires
no
mutex to synchronize access to data. The 2nd part
'update_common_data'
takes
little time, and requires mutex to synchronize access to data.
You would
expect such a program will have a speed up of 40-50% when running
on 2
CPU.
But there is no speend up at all.
I am not sure what is causing no speed up at all.
I inserted 'clock()' function to time the time spend on
'do_numerical_stuff'
and 'update_common_data' in both threads. (I am not sure whether
this
works
as I don't know whether clock() is multithread safe). I found
that in
both
thead, the total time spent on 'do_numerical_stuff' is the same as
when
the
program is run in single thread mode. The total time spent on
'update_common_data' is tiny. So there shouldn't be a problem of
waiting
on
the mutex when doing 'update_common_data'.
Theoretically ''do_numerical_stuff' in both thread should use half
the
time
as in single thread mode.
The whole loop takes 2 seconds in a test run, and it should
benifit from
multi-threading.
Any insights?
Thanks a lot.
- Follow-Ups:
- References:
- Re: numerically intensive app doesn't benifit from multi threading at
- From: m
- Re: numerically intensive app doesn't benifit from multi threading
- From: JC
- Re: numerically intensive app doesn't benifit from multi threading
- From: JC
- Re: numerically intensive app doesn't benifit from multi threading
- From: JC
- Re: numerically intensive app doesn't benifit from multi threading
- From: m
- Re: numerically intensive app doesn't benifit from multi threading at
- Prev by Date: Re: Calling kernel-mode functions from win32 app.
- Next by Date: Re: FileCopy overwrites the existing file
- Previous by thread: Re: numerically intensive app doesn't benifit from multi threading
- Next by thread: Re: numerically intensive app doesn't benifit from multi threading
- Index(es):
Relevant Pages
|
Loading