Author Topic: Multicore stuff  (Read 4978 times)

0 Members and 1 Guest are viewing this topic.

Offline Mika

  • 28
For anyone interested, here is a good collection of all kinds of programming tips for C++ and ASM:
http://www.agner.org/optimize/

I find the dependency chain checks to be the most difficult to fathom. I really need to check the machine code of Visual Studio to check if it can really optimize the throughput for processor while looping certain algorithms.

There is some interesting stuff on that page regarding the standard library speed comparisons. For example, they mention their version of memcpy is four to five times faster when it is hand written in Assembly.

Mika
Relaxed movement is always more effective than forced movement.

 

Offline kode

  • The Swedish Chef
  • 28
  • The Swede
    • http://theswe.de
Pray, v. To ask that the laws of the universe be annulled in behalf of a single petitioner confessedly unworthy.
- Ambrose Bierce
<Redfang> You're almost like Stryke 9 or an0n
"Facts do not cease to exist because they are ignored."
- Aldous Huxley
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH

 

Offline Mika

  • 28
Unfortunately, I have came to a conclusion that current multicore programming is not what it is supposed to be for my purposes. There seems to be something fundamentally wrong with the current PC processor technology to take full advantage of the cores. From what I have gathered, the culprit is the memory that is shared between several processors that is making things more difficult. Though I don't really claim to be expert with this issue, but I have seen lots of benchmarks showing little improvement of performance for quadcores or dualcores, and then again some of them do show that.

However, I find out that the CUDA is actually quite interesting from parallel computing point of view, and my current understanding is that this GPU implementation works around the memory issue by having different memory spaces reserved for each processor. And they seem to have quite good track record of scientifically shown increases in performance. Right now I'm actually considering buying one. But given as I'm running with Athlon XP I guess it would mean total system revamp, and I don't think this computer has served it's time wholly yet.

Mika
Relaxed movement is always more effective than forced movement.

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
In my own multithreading experience, I've found that shared memory is a really annoying problem.

 

Offline kode

  • The Swedish Chef
  • 28
  • The Swede
    • http://theswe.de
Yes, the real simple solution is to not share memory. message passing can actually be made to work well.
Pray, v. To ask that the laws of the universe be annulled in behalf of a single petitioner confessedly unworthy.
- Ambrose Bierce
<Redfang> You're almost like Stryke 9 or an0n
"Facts do not cease to exist because they are ignored."
- Aldous Huxley
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH

 

Offline Mika

  • 28
Quote
Yes, the real simple solution is to not share memory. message passing can actually be made to work well.

My only question about not sharing memory would then be that in which kind of applications this is actually possible? And in this case I specially mean dual and quadcore processors.

Mika
Relaxed movement is always more effective than forced movement.

 

Offline blackhole

  • Still not over the rainbow
  • 29
  • Destiny can suck it
    • Black Sphere Studios
It's possible if you can completely and utterly isolate a calculation, minus the return value.

 

Offline kode

  • The Swedish Chef
  • 28
  • The Swede
    • http://theswe.de
Quote
Yes, the real simple solution is to not share memory. message passing can actually be made to work well.

My only question about not sharing memory would then be that in which kind of applications this is actually possible? And in this case I specially mean dual and quadcore processors.

Mika

Just about any you can think of.

Also, you don't have to sign your every post. We know it's you from the name in the left part of the post.
Pray, v. To ask that the laws of the universe be annulled in behalf of a single petitioner confessedly unworthy.
- Ambrose Bierce
<Redfang> You're almost like Stryke 9 or an0n
"Facts do not cease to exist because they are ignored."
- Aldous Huxley
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH

 

Offline Mika

  • 28
Quote
Just about any you can think of.

Also, you don't have to sign your every post. We know it's you from the name in the left part of the post.

I can only figure out a few examples where it could be possible, one of being random number generation with four cores that doesn't need to be stored anywhere. While definately possible, this has little benefit for real computing applications. The summation for current multicore CPUs that I have gathered is that while speed-ups are theoretically within limits, I think that in practise it can be pretty difficult to achieve large speed-ups for heavy computing with current architecture.

One of the most interesting things is that in software that has supported multiple CPU's for tens of years (ray tracing), local optimizations are still done using only single CPU. When going for all-around optimization, multiple cores are used then.

The reason I leave my name visible is partly because of past internet forum habits, another reason is that when replying to my (sometimes overtly long) posts, people don't need to check from the start who wrote what.

Mika
Relaxed movement is always more effective than forced movement.

 

Offline kode

  • The Swedish Chef
  • 28
  • The Swede
    • http://theswe.de
Did you really look up message passing?
Pray, v. To ask that the laws of the universe be annulled in behalf of a single petitioner confessedly unworthy.
- Ambrose Bierce
<Redfang> You're almost like Stryke 9 or an0n
"Facts do not cease to exist because they are ignored."
- Aldous Huxley
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH