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

linalg.py failing with PGI openacc #1528

Open
georgebisbas opened this issue Dec 1, 2020 · 5 comments
Open

linalg.py failing with PGI openacc #1528

georgebisbas opened this issue Dec 1, 2020 · 5 comments
Assignees
Labels
bug-C bug in the generated code GPU

Comments

@georgebisbas
Copy link
Contributor

georgebisbas commented Dec 1, 2020

Failing on the reduction clause
to reproduce:
pgi+openacc

export DEVITO_LANGUAGE=openacc
export DEVITO_PLATFORM=nvidiaX
export DEVITO_ARCH=pgcc
export DEVITO_LOGGING=DEBUG #optional

python3 misc/linalg.py mat-vec

Some discussion: https://devitocodes.slack.com/archives/CQ0AT90R0/p1607003860367600

@FabioLuporini
Copy link
Contributor

@Leitevmd have you guys ever encountered this issue? this could potentially be relevant to you

@georgebisbas
Copy link
Contributor Author

After merging
#2226
the generated code for the above MFE is:

  #pragma acc parallel loop present(A,b,x)
  for (int i = i_m; i <= i_M; i += 1)
  {
    for (int j = j_m; j <= j_M; j += 1)
    {
      b[i] += x[j]*A[i][j];
    }
  }

instead of

  START_TIMER(section0)
  #pragma acc parallel loop collapse(2) reduction(+:b[0:b_vec->size[0]]) present(A,b,x)
  for (int i = i_m; i <= i_M; i += 1)
  {
    for (int j = j_m; j <= j_M; j += 1)
    {
      b[i] += x[j]*A[i][j];
    }
  }
  STOP_TIMER(section0,timers)

@georgebisbas
Copy link
Contributor Author

The above generated code is working but probably not optimal.
Should we close this issue or rename it so as to improve with a
reduction sub-pass?

@georgebisbas
Copy link
Contributor Author

This can be probably closed now, as reduction is avoided, in purpose as I understand from #2226

@FabioLuporini
Copy link
Contributor

have u tested it recently?

but regardless, probably it can indeed be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-C bug in the generated code GPU
Projects
None yet
Development

No branches or pull requests

3 participants