Misc bugfixes#117
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a couple of PETSc backend interface bugs and extends the serial test suite to cover the corrected behaviors.
Changes:
- Fix
Algebra.muladd!forPETScVector × PETScMatrixto use the correct destination vector. - Fix
Algebra.add_entry!(..., ::Nothing, ...)forPETScMatrixto delegate to the mutatingadd_entry!implementation. - Add/extend serial tests to exercise
add_entry!(..., ::Nothing, ...)andmuladd!.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/PETScAssembly.jl | Corrects PETSc assembly API wrappers (muladd! and add_entry! specialization). |
| test/serial/PETScAssemblyTests.jl | Adds coverage for add_entry! with Nothing values. |
| test/serial/PETScArraysTests.jl | Adds a call to muladd! in array/matrix-vector tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| y = C*x | ||
| @test typeof(y) == typeof(x) | ||
| @test y == [2,3,3,3] | ||
| muladd!(y,C,x) |
There was a problem hiding this comment.
muladd! isn’t brought into scope in this test module (it’s defined under Gridap.Algebra and isn’t exported by GridapPETSc). As written, this line is likely to throw UndefVarError: muladd! not defined. Import/qualify it (e.g., using Gridap.Algebra or call Gridap.Algebra.muladd!).
| y = C*x | ||
| @test typeof(y) == typeof(x) | ||
| @test y == [2,3,3,3] | ||
| muladd!(y,C,x) |
There was a problem hiding this comment.
This call isn’t currently asserting anything about the muladd! semantics (i.e., that y is updated as y ← C*x + y). Adding an explicit @test after this call would prevent regressions and ensure the new codepath is actually validated.
| muladd!(y,C,x) | |
| muladd!(y,C,x) | |
| @test y == [4,6,6,6] |
No description provided.