Compiler quality: g++-4.2 on MacOS? Or am I confused?

General OpenMP discussion

Compiler quality: g++-4.2 on MacOS? Or am I confused?

Postby bimargulies » Mon Sep 29, 2008 10:31 am

I've got a numerically intensive program on MacOS 10.5, and I am trying to apply some OpenMP to speed it up.

I think that I know something of what I'm doing in terms of the underlying MP universe: I was part of the design team for a shared-memory multi-'super'-computer years ago. Not that I couldn't be rusty or confused.

Anyway, I identified a region of code that I believe to be completely safe for parallelization. It is four 'for' loops. Each loop writes a distinct part of a matrix by reading from a wide variety of other shared data. The loops are coded one-after-another, so I put a 'sections' construct around the group of 4, and a section around each. I did not parallelize the loops themselves. Since I have only two cores to work with, it seemed as good as anything to take advantage of the natural division of labor.

I run this, and my program exhibits some rather bizarre failures. Some numbers that aren't ever written inside of the parallel section turn up with impossible values.

I am currently running various very long-running experiments to try to isolate this, as it might turn on OpenMP versus not-open-MP, or it might turn on -O2 versus -O3.

My question for the esteemed readers of this form is the following: various websites I read seem to assume that serious OpenMP-ery will take place with gcc 4.3 or gcc 4.4. Here I am with gcc 4.2. Is it generally thought to be stable for this purpose, particularly on Mac OS?
bimargulies
 
Posts: 7
Joined: Sun Sep 28, 2008 10:30 am

Re: Compiler quality: g++-4.2 on MacOS? Or am I confused?

Postby ejd » Mon Sep 29, 2008 11:28 am

I will ask one of the gcc developers that has worked on OpenMP to respond to this query. Meanwhile, the most common problem that I have seen with the type of thing you are describing, is that people forget and reuse the same variable for the loop index in each section without making it private.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am

Re: Compiler quality: g++-4.2 on MacOS? Or am I confused?

Postby bimargulies » Mon Sep 29, 2008 12:30 pm

Well, I'm an inveterate coder of

for(int x = 0; ...) { ... }


so that cannot be my particular dumb mistake. I have to have found some other one.
bimargulies
 
Posts: 7
Joined: Sun Sep 28, 2008 10:30 am


Return to Using OpenMP

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 7 guests

cron