OpenMP code generated by the compiler

General OpenMP discussion

OpenMP code generated by the compiler

Postby simone.at » Thu Feb 06, 2014 5:55 pm

Hi all,

I'm new in the forum and in OpenMP. I'm glad to have the possibility to join you, learn and try to give my contribution.

I have a question about compilation of OpenMP code.
In my understanding, in general, an OpenMP code is transformed by the compiler in a normal thread program.
Does exist a way to show how the code is transformed by a compiler like GCC, clang or icc?

Thanks.
Best Regards,
Simone
simone.at
 
Posts: 2
Joined: Thu Feb 06, 2014 5:37 pm

Re: OpenMP code generated by the compiler

Postby MarkB » Tue Feb 11, 2014 5:42 am

Hi Simone,

In general, "commercial" compilers (including gcc) translate OpenMP to standard C (or C++, or Fortran) with calls to an OpenMP runtime library
(e.g. libgomp for gcc) which is in turn implemented on top of standard threading libraries. However, they don't actually generate source code as
an intermediate step: the process is more tightly integrated into the overall compilation process, and there's usually no facility to generate a source code representation of the transformed code. The nearest you can get is to dump an intermediate representation which is C-like, but not C, for example with the gcc flag -fdump-tree-optimized. This will contain calls to libgomp, for which the source code is public. However, from a programmer's point of view, this probably isn't especially useful.

Some research compilers, for example OpenUH http://web.cs.uh.edu/~openuh/ , can actually produce the transformed source code.

Hope that helps,
Mark.
MarkB
 
Posts: 450
Joined: Thu Jan 08, 2009 10:12 am
Location: EPCC, University of Edinburgh


Return to Using OpenMP

Who is online

Users browsing this forum: Yahoo [Bot] and 9 guests