charm AT lists.siebelschool.illinois.edu
Subject: Charm++ parallel programming system
List archive
- From: "Mikida, Eric P" <mikida2 AT illinois.edu>
- To: Robert Steinke <rsteinke AT uwyo.edu>
- Cc: Charm Mailing List <charm AT cs.illinois.edu>
- Subject: Re: [charm] [ppl] complex if conditions in SDAG code
- Date: Wed, 2 Mar 2016 18:50:58 +0000
- Accept-language: en-US
Hi Bob,
I’ve run into this a few times myself, and what you’ve proposed does seem
like a reasonable solution. I’ll bring it up for discussion at our weekly
core meeting tomorrow where we can give it a more detailed discussion, and
assign it to someone to work on.
Thanks
Eric
> On Mar 1, 2016, at 2:06 PM, Robert Steinke
> <rsteinke AT uwyo.edu>
> wrote:
>
> In the user's guide it says:
>
> The syntax of SDAG if statements matches that of C and C++. However, if one
> encounters a syntax error on correct-looking code in a loop or conditional
> statement, try assigning the condition expression to a boolean variable in
> a serial block preceding the statement and then testing that boolean's
> value. This can be necessary because of the complexity of parsing C++ code.
>
> So inside of my SDAG code I sometimes have to do this:
>
> serial
> {
> sdagCondition = (some complex boolean expression);
> }
>
> if (sdagCondition)
> {
> ...
>
>
> The boolean variable sdagCondition can't be declared as a local in the
> serial block because it also needs to be visible inside the if. So I wind
> up adding it to my class as a member variable. Could you automatically add
> a member variable for this purpose as part of the SDAG_CODE macro so that
> it doesn't clutter up my class definition? Maybe you could add the member
> variable and when parsing the .ci file always treat "if(X)" as if it were
> written:
>
> serial
> {
> sdagCondition = X;
> }
>
> if (sdagCondition)
>
> Maybe that would allow it to correctly parse the C++ in more cases.
>
> Bob Steinke
>
- [charm] complex if conditions in SDAG code, Robert Steinke, 03/01/2016
- Re: [charm] [ppl] complex if conditions in SDAG code, Mikida, Eric P, 03/02/2016
Archive powered by MHonArc 2.6.16.