Skip to Content.
Sympa Menu

charm - [charm] complex if conditions in SDAG code

charm AT lists.cs.illinois.edu

Subject: Charm++ parallel programming system

List archive

[charm] complex if conditions in SDAG code


Chronological Thread 
  • From: Robert Steinke <rsteinke AT uwyo.edu>
  • To: Charm Mailing List <charm AT cs.illinois.edu>
  • Subject: [charm] complex if conditions in SDAG code
  • Date: Tue, 1 Mar 2016 13:06:20 -0700
  • Authentication-results: cs.illinois.edu; dkim=none (message not signed) header.d=none;cs.illinois.edu; dmarc=none action=none header.from=uwyo.edu;
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:23

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




Archive powered by MHonArc 2.6.16.

Top of Page