[Rose-public] Trouble extracting OpenMP bits from AST

Chunhua "Leo" Liao liao6 at llnl.gov
Wed Sep 4 16:05:13 PDT 2013


For a corrected version:

int main(int arc,char **argv)
{

#pragma omp threadprivate(a)
   int a;
   int i;
#pragma omp parallel for
   for (i = 0; i < 100; ++i) {
     a += 1;
   }
   return 0;
}

I was able to generate a dot graph (./dotGenerator -rose:openmp:ast_only ttt.c) with correct OpenMP AST nodes (SgOmpThreadprivateStatement,SgOmpParallelStatement, SgOmpForStatement, etc).
See attached for the dot graph (png format).

In general, you should manipulate OpenMP AST nodes, instead of tweaking the temporary AstAttribute (OmpAttribute) generated from the parser.

Leo

On 09/04/2013 03:54 PM, Chunhua "Leo" Liao wrote:
> Phil,
> I think your input code does not contain legal OpenMP pragmas.
> -------------------------
> int main(int arc,char **argv)
> {
>
> #pragma openmp threadprivate(a)
> int a;
> int i;
> #pragma openmp parallel for
> for (i = 0; i < 100; ++i) {
> a += 1;
> }
> return 0;
> }
> -------------------------
>
>
> The pragma keyword for OpenMP is "omp" instead of "openmp".
> That's why ROSE fails to recognize it.
>
> Leo
> On 09/02/2013 03:24 PM, Phil Miller wrote:
>> On Mon, Sep 2, 2013 at 2:55 PM, Daniel J. Quinlan<dquinlan at llnl.gov> wrote:
>>> Are you using the option: "-rose:openmp:ast_only"
>>> to get the OpenMP directives to be unparsed to
>>> AST IR nodes. If this does not work then I think that
>>> Liao will have to respond with a better answer for you.
>>
>> Yeah, I'm trying both that and -rose:openmp:parse_only with no
>> success. I'll look for an answer from Liao.
>> _______________________________________________
>> rose-public mailing list
>> rose-public at nersc.gov
>
> _______________________________________________
> rose-public mailing list
> rose-public at nersc.gov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ttt.c.dot.png
Type: image/png
Size: 84516 bytes
Desc: not available
URL: <http://mailman.nersc.gov/pipermail/rose-public/attachments/20130904/5d90df73/attachment.png>


More information about the rose-public mailing list