Linked by Eugenia Loli on Wed 16th May 2007 19:18 UTC, submitted by diegocg
General Development GCC 4.2 has been released. The biggest feature in this release is OpenMP support in C, C++ and Fortran. See the changes page for more details.
Order by: Score:
Ah damn
by Ben Jao Ming on Wed 16th May 2007 19:28 UTC
Ben Jao Ming
Member since:
2005-07-26

Now I have to recompile my Gentoo

Reply Score: 5

RE: Ah damn
by baadger on Wed 16th May 2007 20:12 UTC in reply to "Ah damn"
baadger Member since:
2006-08-29

Not really, doesn't 4.2 produce C++ code that is ABI compatible with 4.1.x? Just recompile your kernel and glibc (to make yourself feel better) and let the rest phase in.

Reply Score: 5

RE[2]: Ah damn
by Isolationist on Wed 16th May 2007 22:27 UTC in reply to "RE: Ah damn"
Isolationist Member since:
2006-05-28

Does the same apply for an LFS user who is using gcc-4.0.3?

Reply Score: 1

Awesome!
by Hank on Wed 16th May 2007 19:33 UTC
Hank
Member since:
2006-02-19

Anyone know what the turn around time for the windows GCC distributions to get this out? I'm dying to try OpenMP outside of the MS and Intel compiler...

Reply Score: 1

Joe Buck
by JoeBuck on Wed 16th May 2007 20:14 UTC
JoeBuck
Member since:
2006-01-11

Hank: you can download the source and build it if you don't want to wait.

baadger: the C++ code is ABI compatible with 4.1.x. You don't need to recompile your kernel or glibc to use 4.2 for your apps.

Reply Score: 1

RE: Joe Buck
by baadger on Wed 16th May 2007 20:18 UTC in reply to "Joe Buck"
baadger Member since:
2006-08-29

Re-read what I wrote :-P

Reply Score: 1

RE: Joe Buck
by sbergman27 on Wed 16th May 2007 20:51 UTC in reply to "Joe Buck"
sbergman27 Member since:
2005-07-24

Where do we download all this code for the Windows(tm) kernel and Windows(tm) glibc? ;-)

Edited 2007-05-16 20:52

Reply Score: 2

RE[2]: Joe Buck
by dimosd on Wed 16th May 2007 21:01 UTC in reply to "RE: Joe Buck"
dimosd Member since:
2006-02-10

deleted

Edited 2007-05-16 21:01

Reply Score: 1

RE[3]: Joe Buck
by sbergman27 on Wed 16th May 2007 21:17 UTC in reply to "RE[2]: Joe Buck"
sbergman27 Member since:
2005-07-24

"""
deleted
"""

Slightly confusing thread, isn't it, dimosd? ;-)

Edited 2007-05-16 21:17

Reply Score: 1

RE[4]: Joe Buck
by dimosd on Wed 16th May 2007 21:53 UTC in reply to "RE[3]: Joe Buck"
dimosd Member since:
2006-02-10

>Slightly confusing thread, isn't it

Sleep or more coffee, that is the question :-)

Reply Score: 1

RE: Joe Buck
by sbergman27 on Wed 16th May 2007 20:52 UTC in reply to "Joe Buck"
sbergman27 Member since:
2005-07-24

Silly duplicate post. Sorry.

Edited 2007-05-16 20:53

Reply Score: 0

RE: Joe Buck
by Hank on Wed 16th May 2007 21:08 UTC in reply to "Joe Buck"
Hank Member since:
2006-02-19

I don't mind waiting if it is on the order of a few weeks, I'm just curious what the normal gap time is. If it is more than that then I'll take the build it on my own route.

Reply Score: 1

Benefits to uni-processor systems?
by flav2000 on Wed 16th May 2007 20:58 UTC
flav2000
Member since:
2006-02-08

OpenMP is all great - but does it benefit to uniprocessors? (non-dual-core, non-quad-core, non-hyperthreading CPUs)

Reply Score: 1

diegocg Member since:
2005-07-08

Dunno, but it's important? Uniprocessors are clearly disappearing from the compuer market.

Reply Score: 3

flav2000 Member since:
2006-02-08

There are still a lot of people with single uniprocessor systems. I agree they're disappearing fast.

For myself though - I'm wondering if I should jump on the GCC 4.2 boat earlier or later since my Linux boxes are running older hardware.

Reply Score: 3

bosco_bearbank Member since:
2005-10-12

There are still a lot of people with single uniprocessor systems. I agree they're disappearing fast.

I'm not planning to disappear (or upgrade to a multi-core processor) in the near future ;)

Reply Score: 4

flav2000 Member since:
2006-02-08

My bad - I meant that uniprocessor systems are probably disappearing over time. These systems won't go away completely - they're probably going to be in the minority rather than the majority.

Reply Score: 1

cyclops Member since:
2006-03-12

"they're probably going to be in the minority rather than the majority."

Lifespan of a PC 5-6 years

Reply Score: 2

h3rman Member since:
2006-08-09

Uniprocessors are clearly disappearing from the compuer market.


I'm not sure about that. Efficient single cores are perfect for nice tiny little low budget laptops. And that market is still growing.

Reply Score: 3

kaiwai Member since:
2005-07-06

I'm not sure about that. Efficient single cores are perfect for nice tiny little low budget laptops. And that market is still growing.


Years ago that might have been the case, but given how much the die has shrunk, the difference between a single and dual core within the next couple of years will be a matter of a few cents - sacrifice a few cents resulting in ultra crap performance? I doubt OEMs will make that sor tof sacrifice given the dog-eat-dog performance orientated market which exists.

Reply Score: 2

meianoite Member since:
2006-04-05

OpenMP is all great - but does it benefit to uniprocessors? (non-dual-core, non-quad-core, non-hyperthreading CPUs)


Well, I can't see why not. Because of the nature of your question, I kind of sense you don't know what OpenMP is about.

It's a standardized set of extensions to selected programming languages implemented as compiler pragmas. In theory, your code should be programmed in such a way that compilers that understand those pragmas will generate parallel code automatically, and those who don't will simply ignore such pragmas and generate serial code as usual. You place such pragmas on strategic points on your code and OpenMP will "automagically" emit parallel code to handle those strategic code paths. Things unfortunately aren't so simple, but they usually work pretty well when the data set is easily processed in parallel, for example many classes of graphic and signal processing algorithms, and some classes of physics simulation algos too. And plenty of brute-force algorithms when not implemented naively, but that's almost an oxymoron =P

OpenMP lets you transfer the job of dividing your program into parallel to the compiler, instead of doing it on your own. Some pragmas imply constructs that one might forget to use, like barriers. Which also implies that sometimes those constructs aren't really necessary and OpenMP will produce sub-optimal code compared to hand-tuned threaded code, but that's not what OpenMP is about anyway.

OpenMP is supposed to handle parallelizable data-sets with a somewhat large grain; it seldom does a good job on code that would benefit most of finely-grained parallel tasks.

In a sense, OpenMP babysits the parallel code creation. It really won't do you much good depending on your data set characteristics, and hand-tuned threaded code is probably faster anyway, but for long-term number-crunching on appropriate data sets OpenMP really shines.

For the casual uses, the GCC version of OpenMP will probably use pthreads, and I couldn't really find whether one can use MPI/PVM implementations (which is the one found on many clusters and NUMA boxes), but I find it great already that many programmers will be exposed to OpenMP "APIs" (if they can really be called that); it should at least help those "lazy programmers" writing code they know is parallelizable but don't think it's worth the trouble to re-model their algorithms around threads.


Now, regarding the uniprocessor case: some classes of algorithms can surely benefit from being run "pseudo-parallel", as in many threads being scheduled to run on a given time. For example, branch-and-bound algorithms could be run multithreaded and an eventual bound could be found by a thread earlier than others because it followed a different path; then it broadcasts such information so every thread restart working from that point on. Same thing with other algorithms based on backtracking, depending on the implementation and the goal.

Anyway, parallel code on uniprocessors usually don't hurt, unless shit begin to happen, like cache trashing and consistently following a code path that finishes faster serially than trying to separate cases into threads that execute in some scheduled order. But it's up to the programmer's discretion NOT to attempt parallelization on such cases.

Remember: no magic bullets. No compiler features can make up for sheer lack of competence on the programmer's side. =P


Edit: grammar, and I realized I made lots of assumptions that someone completely unfamiliar with OpenMP won't really understand. So I added a couple sentences to clarify some points, but I'm probably missing stuff, still. Let me know if there are still points you'd like me to clarify even further.

Edit 2: grammar, still =P


Edited 2007-05-16 21:51

Reply Score: 5

flav2000 Member since:
2006-02-08

I was thinking about that - you and butters are right. OpenMP will probably benefit uniprocessors a bit - especially on I/O limited programs. If OpenMP is smart enough to divide up the threads at the right places, it could improve performance quite a bit.

Reply Score: 1

renox Member since:
2005-07-06

>OpenMP is all great - but does it benefit to uniprocessors?

Obviously not.

Reply Score: 4

butters Member since:
2005-07-08

does it benefit to uniprocessors?

Yes. At a high level, a thread is a mixture of computation and I/O. A thread can sprint through a section of math, load/store, and branching operations quite happily. But when it hits a page fault during a memory operation or requests I/O, the thread comes to a screeching halt. It can no longer do anything useful on the CPU, so it goes to sleep, and some other thread is scheduled. On a lightly-loaded interactive system (i.e. a desktop), this is likely be the idle task.

If the process were multithreaded, then the scheduler would have the opportunity to schedule another thread in the process that might be ready to run on the CPU. On most systems--especially on desktops--there's likely to be more threads waiting on I/O than there are threads waiting for CPU time. Multithreading gives the scheduler the best shot at being able to use CPU time effectively, regardless of whether you have one CPU or 1024 CPUs.

Of course, this is a generic argument for multithreading, and OpenMP is just one way of writing multithreaded software. It's mostly a consequence of how Fortran, C, and C++ developed and evolved. For example, the D programming language has mutual exclusion and synchronization primitives built right into the language. Modern interpreted languages have their own multithreading techniques.

In the quest for increased performance and capability, computer systems have evolved to allow workloads to be divided at various levels. The ancient timesharing systems allowed multiple processes to run on the same computer. Multithreading allows multiple threads to run in the same process address space. Virtualization allows multiple virtual computers to share the same physical computer and/or multiple virtual operating systems to share the same operating system image. Every refinement in the granularity of workload management allows us to do more with less and to utilize more powerful computers effectively.

Edited 2007-05-16 23:31

Reply Score: 5

Great news!
by chmeee on Thu 17th May 2007 04:12 UTC
chmeee
Member since:
2006-01-10

For those with PPC systems, this is excellent news. GCC 4.x has been a major improvement for PPC code generation, and 4.2 looks to be even better, with better stability. Exactly what I've been looking for.

Reply Score: 4

Always good news
by ishmal on Thu 17th May 2007 13:21 UTC
ishmal
Member since:
2005-11-11

Since GCC is the fuel that powers 99% of the open source world, any update of it is good news.

Reply Score: 4

aliasing issues?
by smitty on Fri 18th May 2007 04:16 UTC
smitty
Member since:
2005-10-13

A couple months ago there was a big discussion about a fix for an aliasing bug they had discovered. Fixing it lowered performance by 10-20%, and some people were advocating leaving the bug in since it was extremely rare and already present in 4.0 and 4.1. Does anyone know what happened with that? Anyone checked out the performance of it?

Reply Score: 2