Skip to content

Fix MPI-Checker false positive in MPIRequest::wait()#37901

Open
Copilot wants to merge 4 commits intomainfrom
copilot/fix-nonblocking-call-issue
Open

Fix MPI-Checker false positive in MPIRequest::wait()#37901
Copilot wants to merge 4 commits intomainfrom
copilot/fix-nonblocking-call-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

Ticket

N/A

Problem description

Clang Static Analyzer's optin.mpi.MPI-Checker warns at line 128: "Request has no matching nonblocking call". This is a false positive—the analyzer cannot track MPI_Request objects through class members. The request is properly initialized via MPI_Isend/MPI_Irecv in factory methods before being passed to MPIRequest constructor.

What's changed

Suppression: Added NOLINT(clang-analyzer-optin.mpi.MPI-Checker) to MPI_Wait and MPI_Test calls.

Defensive checks: Added if (done_) guards in wait() and test() to prevent double-wait/test. After MPI_Wait completes, req_ is set to MPI_REQUEST_NULL by MPI; subsequent calls return sentinel values.

Documentation:

  • Explained analyzer limitation and why warning is false positive
  • Documented constructor precondition (requires valid MPI_Request from nonblocking call)
  • Clarified sentinel return values (MPI_ANY_SOURCE/MPI_ANY_TAG indicate no-op, not wildcards)
  • Noted callers should use active() before calling wait()

Impact: 18 lines added (mostly comments), 2 NOLINT suppressions. No functional changes to correct usage.

Checklist

  • All post-commit tests
  • Blackhole Post commit
  • cpp-unit-tests
  • New/Existing tests provide coverage for changes

Model tests

If your changes cover model-related code, you should run tests corresponding to affected models and platforms (Single card, T3K, Galaxy). "Choose your pipeline" workflows facilitate running multiple kinds of tests in a single run. Each offers models-mandatory and models-extended presets.
The former includes a minimal set of tests, to be run always. The latter extends that with additional ones - use your best judgement in deciding which is the most appropriate for your PR.

Original prompt

Fix this Clang Static Analyzer issue:

  • optin.mpi.MPI-Checker in tt_metal/distributed/multihost/mpi_distributed_context.cpp:128 — Request has no matching nonblocking call.

Verify it's a real issue, apply minimal fix, follow coding standards.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@blozano-tt blozano-tt added the copilot-autofix PRs automatically created by Copilot to fix ClangSA issues label Feb 14, 2026
@blozano-tt blozano-tt marked this pull request as ready for review February 14, 2026 08:13
Copilot AI review requested due to automatic review settings February 14, 2026 08:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

…nsive checks

Co-authored-by: blozano-tt <181790211+blozano-tt@users.noreply.github.com>
Copilot AI and others added 2 commits February 14, 2026 08:18
Co-authored-by: blozano-tt <181790211+blozano-tt@users.noreply.github.com>
…values

Co-authored-by: blozano-tt <181790211+blozano-tt@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix nonblocking call issue in MPI distributed context Fix MPI-Checker false positive in MPIRequest::wait() Feb 14, 2026
Copilot AI requested a review from blozano-tt February 14, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot-autofix PRs automatically created by Copilot to fix ClangSA issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants