FairRootGroup / FairMQ

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

Fix reference count region initialization #492

Closed rbx closed 1 year ago

rbx commented 1 year ago

Fix a bug where the externally created region's rc segment settings would be ignored by the region user. The changes make sure that the registered size value is honored in case:

Other additions:

coderabbitai[bot] commented 1 year ago
Walkthrough ## Walkthrough The changes across various scripts and source files are primarily focused on configuration and initialization improvements in a messaging system setup. Bash scripts have been updated to handle environment variables, command-line arguments, and default values more efficiently. CMake configuration now uses the `@ONLY` option to prevent variable expansion. In the C++ source files, there have been adjustments to the shared memory management, including the removal of redundant variables and the addition of initialization steps for reference counting segments. ## Changes | File | Summary | | ---- | ------- | | `examples/.../fairmq-start-ex-region-advanced-external.sh.in` | Updated to set `FAIRMQ_PATH`, adjust transport type and message size based on user input, and configure processes with specific shared memory and channel parameters. | | `examples/.../fairmq-start-ex-region-advanced.sh.in` | Changed to assign `msgSize` using the second input parameter and simplified by using default value assignments for `transport` and `msgSize`. | | `examples/.../fairmq-start-ex-region.sh.in` | Modified to assign `msgSize` using the second input parameter and introduced parameter expansion for default values. | | `examples/CMakeLists.txt` | Added `@ONLY` option to `configure_file` function calls to prevent CMake variable processing. | | `fairmq/shmem/Manager.h` | Removed `rcSegmentSize` variable, added checks and settings for `rcSegmentSize` in `cfg` based on shared memory regions. | | `fairmq/shmem/Monitor.cxx` | Enhanced `Monitor::PrintShm` function to include free memory output of `rcCountSegment`. | | `fairmq/shmem/UnmanagedRegion.h` | Added `InitializeRefCountSegment` call after zeroing free memory in the initialization process. |

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`