Is there a way I can compile code with OpenMP to C code (With OpenMP part translated to plain C), so that I can know what kind of code is being generated by OpenMP. I am using gcc 4.4 compiler.
Like the other commenters pointed out gcc doesn't translate OpenMP directives to plain C.
But if you want to get an idea of what gcc does with your directives you can compile with the
-fdump-tree-optimized
option. This will generate the intermediate representation of the program which is at least C-like.
There are several stages that can be dumped (check the man page for gcc), at the optimized stage the OpenMP directives have been replaced with calls to the GOMP runtime library. Looking at that representation might give you some insights into what's happening.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With