FairRootGroup / FairMQ

C++ Message Queuing Library and Framework
GNU Lesser General Public License v3.0
86 stars 34 forks source link

Shm UR ref count segment: fallback to old behaviour when segment size is set to 0 #493

Closed rbx closed 12 months ago

rbx commented 12 months ago

Describe your proposal.

Mention any issue this PR resolves or is related to.


Checklist:

coderabbitai[bot] commented 12 months ago
Walkthrough ## Walkthrough The changes across various files indicate a significant update to the shared memory management, particularly in handling reference counting for unmanaged regions. A new configuration parameter `rcSegmentSize` has been introduced, which is set to 0 to denote unmanaged regions. The logic for reference counting in messages has been updated to accommodate this new parameter, affecting how memory is allocated, copied, and released. The `RegionInfo` structure and related constructors have been simplified by removing default segment size constants and parameters. ## Changes | File Path | Change Summary | |-----------|----------------| | `examples/.../CMakeLists.txt` | Modified `add_example` function to include 'region-advanced-external' argument. | | `examples/.../fairmq-start-ex-region-advanced.sh.in` | Added `--rc-segment-size 0` flag to `SAMPLER` configuration. | | `examples/.../keep-alive.cxx` | Altered `ShmManager` logic to set `cfg.rcSegmentSize` to 0 and pass `cfg` to `UnmanagedRegion` constructor. | | `fairmq/shmem/Common.h` | Removed `DefaultRcSegmentSize` constant and related constructors from `RegionInfo`. | | `fairmq/shmem/Message.h` | Updated `GetRefCount()`, `Copy()`, and `Release()` methods to handle new `rcSegmentSize` logic. | | `fairmq/shmem/UnmanagedRegion.h` | Added `fRcSegmentSize` field and adjusted initialization logic for reference counting. | | `test/message/_message.cxx` | Updated `ZeroCopyFromUnmanaged()` to handle new `rcSegmentSize` parameter and added related test cases. |

Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`