Skip to content

Relax ucobounds preconditions and fix ucobound defects#297

Merged
bonachea merged 7 commits intoBerkeleyLab:mainfrom
bonachea:ucobounds-on-main
Feb 26, 2026
Merged

Relax ucobounds preconditions and fix ucobound defects#297
bonachea merged 7 commits intoBerkeleyLab:mainfrom
bonachea:ucobounds-on-main

Conversation

@bonachea
Copy link
Member

This PR reworks Caffeine's handling of ucobounds, fixing it to comply with F23 UCOBOUND and deploying the ucobound relaxation on coarray descriptor creation proposed for PRIF 0.8.

Fixes #296

Implements prif#154

See commit messages for details.

@bonachea bonachea added this to the Caffeine 0.7.2 milestone Feb 22, 2026
@bonachea bonachea requested a review from ktras February 22, 2026 21:54
@bonachea bonachea added bug Something isn't working enhancement New feature or request priority=high image queries PRIF image query subroutines coarray queries PRIF coarray query subroutines labels Feb 22, 2026
* Accept ucobounds of size (corank - 1) when creating coarray descriptors

If provided, the trailing ucobounds must still meet the specified invariants

* Add coshape_epp to the coarray descriptor

  This new field holds the precomputed exclusive prefix product of
  the coshape.

* Fix prif_ucobound to recompute the trailing ucobound based on current team size

* Fix prif_coshape to properly account for the trailing ucobound

* Use coshape_epp to accelerate prif_image_index and prif_initial_team_index
* Simplify the logic for the common case of corank == 1
* Remove some redundant arithmetic and branchs for the general case
* Add a safety check for coshape overflow
New expected trailing ucobound values, and exercise optional trailing ucobound
Copy link
Collaborator

@ktras ktras left a comment

Choose a reason for hiding this comment

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

LGTM

@bonachea
Copy link
Member Author

CC @JDPailleux

@bonachea bonachea merged commit eb6d50f into BerkeleyLab:main Feb 26, 2026
36 checks passed
@bonachea bonachea deleted the ucobounds-on-main branch February 26, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working coarray queries PRIF coarray query subroutines enhancement New feature or request image queries PRIF image query subroutines priority=high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prif_ucobound and prif_coshape report/use non-conforming trailing ucobound

2 participants