[Openmp-dev] #pragma directives expansion

Cownie, James H james.h.cownie at intel.com
Thu Sep 18 02:03:23 PDT 2014


You need to be clear, though, that the expansions are conceptual and for educational purposes. They’re showing what the transformations would look like if they were done in source code. However that doesn’t meant that is how they are done, in reality they’re transformations on the compiler’s intermediate representation. When compiling there is never a file that contains the transformed source code.

They’re shown in the document as if they were source code transformations because that’s easy to read and understand, not because that’s what really exists.
(If we showed the real internal transformation you would need to understand the compiler IR, which isn’t the point of the discussion.)

If you want an OpenMP implementation that does operate source to source, you might look at Rose. http://rosecompiler.org/ (Disclaimer, I haven’t looked at it in detail, but it seems to claim to have an OpenMP implementation). I doubt that it targets this runtime, though…

-- Jim

James Cownie <james.h.cownie at intel.com>
SSG/DPD/TCAR (Technical Computing, Analyzers and Runtimes)
Tel: +44 117 9071438

From: openmp-dev-bounces at cs.uiuc.edu [mailto:openmp-dev-bounces at cs.uiuc.edu] On Behalf Of Alexander Musman
Sent: Thursday, September 18, 2014 4:07 AM
To: daniel tian
Cc: openmp-dev at dcs-maillist2.engr.illinois.edu; HPCTools Group
Subject: Re: [Openmp-dev] #pragma directives expansion

You can also have a look at http://openmp.llvm.org/Reference.pdf - it contains several examples of how different OpenMP directives are expanded.

2014-09-17 22:47 GMT+04:00 daniel tian <xtian2 at uh.edu<mailto:xtian2 at uh.edu>>:
The parallel region will be outlined as a function. This function will be run by each threads. You can take a look at our group's Wikipedia page regarding the OpenMP implementation in OpenUH.

Also you can take a look at Liao's paper: OpenUH: An optimizing, portable OpenMP compiler<http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.190.7005>

On Wed, Sep 17, 2014 at 1:15 PM, Millad Ghane <millad.mg at gmail.com<mailto:millad.mg at gmail.com>> wrote:
Hello everyone,

I know that an OpenMP #pragma directive is expanded into some lines of codes (or maybe I am wrong). I was hoping if someone could tell me where should I look for it?

For example, considering this piece of code:
#pragma omp parallel
{
  printf("Hello world! %d", omp_get_thread_num());
}

will be converted to something like this:
f1();
{
  printf("Hello world! %d", omp_get_thread_num());
}
f2();


If I am wrong tell me.And if you know where should I look for in the code, let me know about it.


Best Regards,
Millad





--
Best Regards,
Xiaonan (Daniel) Tian

_______________________________________________
Openmp-dev mailing list
Openmp-dev at dcs-maillist2.engr.illinois.edu<mailto:Openmp-dev at dcs-maillist2.engr.illinois.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/openmp-dev/attachments/20140918/1af45644/attachment.html>


More information about the Openmp-dev mailing list