(Cloning the revision for the ASan issue since the old one is closed and can't be re-opened)
This patch adds a static analysis checker to verify the correct usage of the MPI API in C and C++.
3 path-sensitive checks are included:
- Double nonblocking: Double request usage by nonblocking calls without intermediate wait
- Missing wait: Nonblocking call without matching wait.
- Unmatched wait: Waiting for a request that was never used by a nonblocking call
Examples of how to use the checker can be found on: GitHub https://github.com/0ax1/MPI-Checker
This is not safe because the lifetime of the BugReporter is shorter than the lifetime of the checker.
Instead, I would recommend creating a new instance of MPIBugReporter when reporting a bug. Since MPIBugReporter is only ever used when reporting bugs the cost of creating it each time (rather than caching it in an in instance variable) should not be an problem.