Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pragma deletion logic bug with omp pragmas. #577

Open
calewis opened this issue Sep 22, 2020 · 0 comments
Open

Pragma deletion logic bug with omp pragmas. #577

calewis opened this issue Sep 22, 2020 · 0 comments
Assignees
Labels

Comments

@calewis
Copy link
Contributor

calewis commented Sep 22, 2020

Follow function:

void foo(){
#pragma sst memory 3
#pragma omp parallel for
for(auto i = 0; i < 10; ++i){}
}

Skeletonizes too:

void foo() {

#pragma omp parallel for
  {
    uint64_t flops = 0;
    uint64_t readBytes = 0;
    uint64_t writeBytes = 0;
    uint64_t intops = 0;
    { uint64_t tripCount0 = (((10) - (0))); }
    readBytes = 3;
    sstmac_compute_detailed(flops, intops, readBytes);
  }
}

which happens to work if you don't compile with -fopenmp because the omp pragma is ignored but the behavior still needs fixing.
The issue can be seen here:

void
PragmaActivateGuard::deletePragmaText(SSTPragma *prg)
{
  //eliminate the pragma text
  if (prg->depth == 0){
    SourceRange rng(prg->pragmaDirectiveLoc, prg->endPragmaLoc);
    ::replace(rng, "");
  }
}

Even though the second pragma might ask to be deleted, if it is isn't the first pragma it won't be deleted. The conflict with OpenMP pragmas can probably be worked around by avoiding activating the openmp compiler flag, but we should probably still fix this because their could be other issues with not properly deleting pragma text.

@calewis calewis added the bug label Sep 22, 2020
jjwilke pushed a commit to jjwilke/sst-macro that referenced this issue Sep 25, 2020
jjwilke added a commit that referenced this issue Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants