Skip to content

eq constraints porting to RAJA#45

Closed
kswirydo wants to merge 3 commits intoolcf-hackathon-2026-devfrom
ks-eq_constraints_porting
Closed

eq constraints porting to RAJA#45
kswirydo wants to merge 3 commits intoolcf-hackathon-2026-devfrom
ks-eq_constraints_porting

Conversation

@kswirydo
Copy link
Copy Markdown
Collaborator

Merge request type

  • Porting to GPU/removing PETSc dependence

Relates to

  • OPFLOW

This MR updates

  • Header files
  • Source code
  • CMake build system
  • Tests

Summary
Ported equality constraints from PETSc to RAJA. Supporting infractructure (i.e. new variables, code for counting number of elements etcetc) added too.

Replace the PETSc-based equality constraint Jacobian computation in the
PBPOLRAJAHIOPSPARSE model with direct GPU kernels using RAJA, eliminating
the D2H-compute-H2D round trip. The sparsity pattern is now computed on
the host during setup and the values are computed entirely on device.

Key changes:
- Add ComputeEqJacValuesGPU_PBPOLRAJAHIOPSPARSE in new gpu.cpp/hpp files
- Add device arrays for flat-array indices (bus eqjacsp_selfidx, line
  eqjacsp_idx/eqjacsp_diag_idx/isdcline, gen xpdevidx/xpsetidx)
- Fix nnz counting bugs (missing gen/load entries, off-by-one in line
  loop) and populate flat-array indices during model setup
- Replace PETSc MatGetRow extraction in sparsity and values phases
- Handle parallel lines by sharing off-diagonal positions with atomicAdd
- Use pre-computed nnz in get_sparse_blocks_info instead of PETSc query
- Add correctness test (test_eqjac_compare) and performance benchmark
  (test_eqjac_perf)

Made-with: Cursor
@kswirydo kswirydo requested review from nkoukpaizan and pelesh April 23, 2026 16:39
@kswirydo kswirydo changed the title eq constraints portingj eq constraints porting to RAJA Apr 23, 2026
Copy link
Copy Markdown
Collaborator

@pelesh pelesh left a comment

Choose a reason for hiding this comment

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

Needs rebasing.

@pelesh
Copy link
Copy Markdown
Collaborator

pelesh commented Apr 23, 2026

Closing in favor of #48

@pelesh pelesh closed this Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants