Open Catalog of Code Guidelines for Correctness, Modernization, and Optimization
About
This Open Catalog is a collaborative effort to consolidate expert knowledge on code guidelines for the correctness, modernization, and optimization of code written in C, C++, and Fortran programming languages. The Catalog consists of a comprehensive set of checks (rules) that describe specific issues in the source code and provide guidance on corrective actions, along with extensive documentation, example codes and references to additional reading resources.
Benchmarks
The Open Catalog includes a suite of microbenchmarks designed to demonstrate:
- No performance degradation when implementing the correctness and modernization recommendations.
- Potential performance enhancements achievable through the optimization recommendations.
Checks
ID | Title | C | Fortran | C++ | AutoFix |
---|---|---|---|---|---|
PWR001 | Declare global variables as function parameters | ✓ | ✓ | ✓ | |
PWR002 | Declare scalar variables in the smallest possible scope | ✓ | ✓ | ||
PWR003 | Explicitly declare pure functions | ✓ | ✓ | ✓ | |
PWR004 | Declare OpenMP scoping for all variables | ✓ | ✓ | ✓ | |
PWR005 | Disable default OpenMP scoping | ✓ | ✓ | ✓ | |
PWR006 | Avoid privatization of read-only variables | ✓ | ✓ | ✓ | |
PWR007 | Disable implicit declaration of variables | ✓ | ✓1 | ||
PWR008 | Declare the intent for each procedure parameter | ✓ | ✓1 | ||
PWR009 | Use OpenMP teams to offload work to GPU | ✓ | ✓ | ✓ | |
PWR010 | Avoid column-major array access in C/C++ | ✓ | ✓ | ||
PWR012 | Pass only required fields from derived type as parameters | ✓ | ✓ | ✓ | |
PWR013 | Avoid copying unused variables to or from the GPU | ✓ | ✓ | ✓ | |
PWR014 | Out-of-dimension-bounds matrix access | ✓ |