Skip to content

Address review comments from PR #2539 - LU_SGS Preconditioner#2751

Open
digvijay-y wants to merge 28 commits intosu2code:developfrom
digvijay-y:gpu-lusgs
Open

Address review comments from PR #2539 - LU_SGS Preconditioner#2751
digvijay-y wants to merge 28 commits intosu2code:developfrom
digvijay-y:gpu-lusgs

Conversation

@digvijay-y
Copy link

@digvijay-y digvijay-y commented Mar 8, 2026

Proposed Changes

Give a brief overview of your contribution here in a few sentences.

Changes request by @pcarruscag in PR #2539 made by @areenraj .

Related Work

Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.
#2539

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson).
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • I used the pre-commit hook to prevent dirty commits and used pre-commit run --all to format old commits.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary.

void Reorder(vector<ScalarType>& pointList, vector<ScalarType>& inversePointList, vector<ScalarType> levelOffsets) {
void Reorder(const vector<ScalarType>& pointList, const vector<ScalarType>& levelOffsets,
vector<ScalarType>& reorderedPointList) {
auto levelOffsetsCursor = levelOffsets;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reason for using a buffer variable? (Interesting variable name btw)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the moving variable, reorder increments per-level write positions, but original level offsets are kept unchanged for downstream

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will have to re-read my code because I dont remember what I wrote a year ago. But won't this affect the calculations down the line? Did you find any difference in the values while comparing it to the CPU implementation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Did you test this once with the flag on or off, just to make sure?

Copy link
Contributor

@areenraj areenraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mention whether the code compiled and ran as it should have. And also produced the same results compared to the CPU code.

Mention the nomenclature and other minor changes you added in the PR message itself.

@areenraj areenraj added GSoC Google Summer of Code and removed GSoC Google Summer of Code labels Mar 8, 2026
void Partition(vector<ScalarType>& pointList, vector<ScalarType>& levelOffsets, vector<ScalarType>& chainPtr,
unsigned short rowsPerBlock) override {
vector<ScalarType> inversePointList;
inversePointList.reserve(nPointDomain);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might cause issues although I'm not sure. Did the code run properly?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't run it completely! I'm on it.

Comment on lines +709 to +717
switch (KindAlgorithm) {
case ENUM_GRAPH_PART_ALGORITHM::LEVEL_SCHEDULING:
auto levelSchedule = CLevelScheduling<ScalarType>(nPointDomain, nodes);
levelSchedule.Partition(pointList, partitionOffsets, chainPtr,
LinearAlgebraUtils::ComputeRowsPerCudaBlock(config->GetCuda_Block_Size()));
nColor = levelSchedule.nLevels;
maxPartitionSize = levelSchedule.maxLevelWidth;
break;
}

Check notice

Code scanning / CodeQL

No trivial switch statements Note

This switch statement should either handle more cases, or be rewritten as an if statement.
@digvijay-y digvijay-y force-pushed the gpu-lusgs branch 2 times, most recently from 29c9482 to c3b8062 Compare March 8, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants