Archive

Archive for December, 2005

Common Mistakes in Using OpenMP 1: Incorrect Directive Format

December 30th, 2005

In C/C++, OpenMP directives are specified by using the #pragma mechanism; and in Fortran, they are specified by using special comments that are identified by unique sentinels.

This design allows users to write OpenMP programs that can be compiled with compilers that do not support OpenMP or compiled with OpenMP compiles with OpenMP support disabled.

However, if you do not follow the directive format, you might get a
program that compiles and runs but gives unexpected results, because
the compiler does not recognize your OpenMP directives and thinks they are non-OpenMP related pragmas (C/C++) or regular comments (Fortran).

Quiz:

How many “me”s does the following code print? Assume a team of 4 threads are executing the parallel region.

foo()
{
    #pragma omp parallel
    {
        #pragma single
        {
            printf("men");
        }
    }
}
Categories: Parallel Programming Tags:

Common Mistakes in Using OpenMP

December 30th, 2005

I will post a list of common mistakes found in parallel programs written using OpenMP.

Although it is always true that users of a language need to spend effort to
understand the language so to avoid mistakes, I wonder what it means to
the language designers if many many users keep making the same set of
mistakes again and again.

Categories: Parallel Programming Tags:

Must Read: ACM Queue Microprocessors issue (9-2005)

December 26th, 2005

The following articles from the ACM Queue Microprocessors issue (vol. 3, no. 7 - September 2005) are must reads.

Multicore CPUs for the Masses
Mache Creeger, Emergent Technology Associates

Software and the Concurrency Revolution
Herb Sutter and James Larus, Microsoft

The Price of Performance
Luiz André Barroso, Google

Extreme Software Scaling
Richard McDougall, Sun Microsystems

The Future of Microprocessors
Kunle Olukotun and Lance Hammond, Stanford University

Categories: Parallel Programming Tags: