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

LA: add a fast path for updating matrix values #364

Merged
merged 7 commits into from
Nov 21, 2022

Conversation

andrea-iob
Copy link
Member

The fast path will use the PETSc function MatSetValuesRow to update all the values of a row at once (without the need to get the row pattern).

Fast update can be performed if:

  • the matrix has already been assembled;
  • the assembler is providing all the values of the row;
  • values provided by the assembler are sorted by ascending column.

@andrea-iob andrea-iob self-assigned this Nov 13, 2022
@andrea-iob andrea-iob force-pushed the LA.optimize.matrix.set.values branch 4 times, most recently from 3c2aaed to 3c7bbdd Compare November 14, 2022 13:19
Copy link
Contributor

@lucask81 lucask81 left a comment

Choose a reason for hiding this comment

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

I tested these changes with Immerflow. The changes reduce the overall simulation time.

The fast path will use the PETSc function MatSetValuesRow to update
all the values of a row at once (without the need to get the row
pattern).

Fast update can be performed if:
 - the matrix has already been assembled;
 - the assembler is providing all the values of the row;
 - values provided by the assembler are sorted by ascending column.
@andrea-iob andrea-iob merged commit 8dfad35 into master Nov 21, 2022
@andrea-iob andrea-iob deleted the LA.optimize.matrix.set.values branch November 21, 2022 11:20
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