Skip to content

Add PWR087: Declare array dummy arguments as assumed-shape arrays to favor compiler optimizations#135

Merged
alvrogd merged 3 commits intomainfrom
feature/AddPWR087
Feb 26, 2026
Merged

Add PWR087: Declare array dummy arguments as assumed-shape arrays to favor compiler optimizations#135
alvrogd merged 3 commits intomainfrom
feature/AddPWR087

Conversation

@alvrogd
Copy link
Collaborator

@alvrogd alvrogd commented Feb 25, 2026

Add entry for a new check that results from the optimization aspects of PWR070.

My benchmark results:

$ lscpu
  Model name:             13th Gen Intel(R) Core(TM) i7-13700H

$ gcc --version                            
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0

$ gfortran --version                                                 
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0

$ python3 run-benchmarks.py --check {PWR070,PWR087}
------------------------------------------------------------------
Benchmark                        Time             CPU   Iterations
------------------------------------------------------------------
PWR070 Fortran Example         568 us          567 us         1140
PWR070 Fortran Improved        587 us          587 us         1218
PWR087 Fortran Example         894 us          894 us          756
PWR087 Fortran Improved        306 us          306 us         2331

@alvrogd alvrogd self-assigned this Feb 25, 2026
@alvrogd alvrogd requested review from a team, d-alonso and igarcia0 and removed request for a team February 25, 2026 15:48
@alvrogd alvrogd marked this pull request as ready for review February 25, 2026 15:48
In a subsequent commit, PWR070 will be split into two recommendations:

- PWR070: Discussing the relevance of assumed-shape arrays for code
  quality.
- PWR087: A new recommendation focused solely on the optimization
  aspects.

The original PWR070 benchmark illustated a scenario (strided array
accesses) where assumed-shape arrays could also improve performance.
That benchmark is now moved to the upcoming PWR087.

PWR070 is left with a more "typical" benchmark, with a kernel operating
over an entire array. While this new benchmark shows no performance
improvement, PWR070 targets the code quality benefits of assumed-shape
arrays. Therefore, it is sufficient that performance does not degrade.
This recommendation stems from the optimization aspects of PWR070.
Copy link
Contributor

@d-alonso d-alonso left a comment

Choose a reason for hiding this comment

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

Looks good

@alvrogd alvrogd merged commit 6e749cc into main Feb 26, 2026
7 checks passed
@alvrogd alvrogd deleted the feature/AddPWR087 branch February 26, 2026 09:03
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.

3 participants