Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.

Quad-Core - How are two bottlenecks possible?

gtrdev
Beginner
428 Views
Is it possible to have a process that is CPU bound on a single thread, but still completes more slowly when a second instance is run?

Example 1:
Run process A, takes 14 seconds to complete, CPU is maxed on one core the entire time

Example 2:
Run two instances of process A, takes 23 seconds to complete, CPU is maxed on two cores the entire time.

So how can example 2 take much longer?

If the processes were IO bound, then how can the 2 CPU cores be maxed out the whole time?

I understand there are many things that prevent perfect 2x scaling, but I don't understand how the 2 CPU cores can be maxed if there were something else preventing better scaling.

Any ideas appreciated,
GTRDev
0 Kudos
3 Replies
michaelsuess
Beginner
428 Views
Sure thats possible, depending on your code. Just think of the case when you have locks in your program that both CPUs are competing for. Or maybe your programs bottleneck is really memory bandwith, in which case using two CPUs will not help at all. Or maybe your program has bad locality and your two cores are constantly invalidating each others caches. There are many reasons possible reasons for the behaviour you describe and in all cases your CPUs will appear to be maxed out.
0 Kudos
gtrdev
Beginner
428 Views
Hi Michael,

Thank you for your response it was very helpful.

I now need to look for the proper techniques to measure lock contention, memory bandwidth usage, and other possibilities that are not easy to detect just by using SysInternals utilities.

I have no idea how to check on these yet, but that's what Google is for so I'm going to find out.

Regards,
GTR
0 Kudos
jimdempseyatthecove
Honored Contributor III
428 Views

Try Intel's vTune. They have a trial version.

They also have other utility programs.

By examining where your program is executing you may shed some light on the problem. vTune will detect a fair amount of your problems (once you get the hang of using it).

I do not use vTune myself as I have an AMD based system, for that I use CodeAnalyst which has similar functionality.

Jim Dempsey

0 Kudos
Reply