Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch4/ipc: refactor IPC and add CMA module #6579

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Conversation

hzhou
Copy link
Contributor

@hzhou hzhou commented Jul 3, 2023

Pull Request Description

This is a temporary PR for reference. It will be rebased and possibly split into separate PRs.

[skip warnings]

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

hzhou added 7 commits July 3, 2023 09:56
The _get_ipc_attr functions should check the threshold and set ipc_type
to MPIDI_IPCI_TYPE__NONE if it doesn't meet threshold. Thus, there is no
need to return the threshold to the caller.

Not exposing threshold allows more sophiscated threshold checking if needed.

Slight refactor to streamline the do_ipc check.
We no longer use the status and the ipc fields. Remove.
Check MPIR_CVAR_CH4_IPC_GPU_HANDLE_CACHE at the caller place rather than
inside ipc_handle_cache_search and MPIDI_GPU_ipc_handle_cache_insert.
This keeps the search and insert utility functions simple, and avoids
the extra insert_successful check.

Also, move MPIDI_GPU_ipc_handle_cache_insert into the branch to avoid
extra checking and setting handle_status.
Store MPL_gpu_ipc_mem_handle_t directly rather than
MPIDI_IPCI_ipc_handle_t. Add separate utilities to avoid mixing
different requirement of caching local ipc handles versus caching remote
mapped addresses.
Refactor and move the code into MPIDI_GPU_copy_data. The gpu related
code belongs in gpu_post.c.
@hzhou hzhou force-pushed the 2306_cma branch 2 times, most recently from b7d2568 to d7cb5ea Compare July 6, 2023 19:07
hzhou added 4 commits July 6, 2023 14:40
Make ipc attr query and ipc handle preparation orthogonal and use
separate data structure to avoid complication. In attr query, we focus
on whether we should enable IPC, and only cache necessary information
locally that is sufficient for preparing the handle. All the actual
handle preparation logic moved to the separate function later.

Different IPC features have different logic. Move most of the special
data structure and logic inside the feature code to avoid changes in one
feature affecting the code in other features.

ch4/ipc: refactor fixup
The xpmem functions are now always guarded by #ifdef
MPIDI_CH4_SHM_ENABLE_XPMEM.
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.

None yet

1 participant