Skip to content

Conversation

ritvikrao
Copy link
Collaborator

Implements inter-process communication (IPC) with the use of POSIX shared memory and XPMEM (when available). It is not enabled by default, and you have to provide a build command to enable it.

@ritvikrao ritvikrao marked this pull request as ready for review September 22, 2025 17:48
@ritvikrao ritvikrao requested a review from Copilot September 24, 2025 21:20
Copy link
Contributor

@Copilot 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.

Pull Request Overview

This PR implements POSIX shared memory for inter-process communication (IPC) to enable faster message passing between processes on the same physical node. The implementation supports both standard POSIX shared memory and XPMEM when available, with configuration options to control pool sizes and message cutoffs.

  • Adds POSIX shared memory IPC infrastructure with fallback to XPMEM
  • Integrates IPC block processing into the scheduler loop
  • Updates assertion and error handling macros for better debugging

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/threads.cpp Adds CthIsSuspendable function to check thread suspend capability
src/scheduler.cpp Integrates IPC block processing into main scheduler loop
src/converse_config.h.in Adds CMK_USE_SHMEM configuration option
src/convcore.cpp Adds IPC manager initialization and memory management integration
src/conv-topology.cpp Removes deprecated communication thread synchronization code
src/cmixpmem.cpp Implements XPMEM-based shared memory for high-performance IPC
src/cmishmem.cpp Main IPC implementation with block allocation and message handling
src/cmishm.cpp POSIX shared memory implementation with process coordination
src/cmi-shmem-common.h Common definitions and utilities for shared memory IPC
src/cldb.rand.cpp Fixes handler index access to use proper CpvAccess macro
src/cldb.h Changes CldHandlerIndex from thread_local to CpvExtern
src/cldb.cpp Updates CldHandlerIndex declaration
src/CMakeLists.txt Adds cmishmem.cpp to build sources
include/converse.h Adds IPC API declarations and improved assertion macros
CMakeLists.txt Adds CMK_USE_SHMEM build option

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ritvikrao ritvikrao requested a review from adityapb September 29, 2025 17:06
@ritvikrao ritvikrao assigned JiakunYan and unassigned JiakunYan Sep 29, 2025
@ritvikrao ritvikrao requested a review from JiakunYan September 29, 2025 17:06
@JiakunYan
Copy link
Collaborator

Could you fix or dismiss the copilot comments?

@ritvikrao
Copy link
Collaborator Author

Resolved all the comments

Comment on lines +312 to +313
int CthIsSuspendable(CthThread t) { return B(t)->suspendable; }

Copy link

Choose a reason for hiding this comment

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

It seems like this logic is no longer used?

Suggested change
int CthIsSuspendable(CthThread t) { return B(t)->suspendable; }

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's used in charm's init.C. I also think it's good to support this generally in our threads library

Comment on lines +423 to +424
auto* manager = CsvAccess(coreIpcManager_);
if (msg && (ipc = CmiIsIpcBlock(manager, BLKSTART(msg), CmiMyNode()))) {
Copy link

Choose a reason for hiding this comment

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

who's creating the manager here? i don't see a call to CmiMakeIpcManager.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The initialization happens in Charm++ (init.C:1713)

ritvikrao and others added 2 commits October 1, 2025 08:03
Co-authored-by: Justin Szaday <wingpad@gmail.com>
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