Skip to content

Fix/130#132

Merged
lmseidler merged 4 commits intomainfrom
fix/130
Mar 5, 2026
Merged

Fix/130#132
lmseidler merged 4 commits intomainfrom
fix/130

Conversation

@lmseidler
Copy link
Member

This pull request improves the way ORCA binary versions are extracted and adds comprehensive tests for the new approach. The main change is switching to memory-mapped file access (mmap) for parsing the version directly from the binary, which is more efficient. The code now also gracefully falls back to reading the file if memory-mapping fails, ensuring robustness. Additionally, new unit tests have been added to verify correctness and benchmark the performance of both methods.

ORCA version extraction improvements:

  • Updated get_orca_version in src/censo/config/paths.py to use mmap for parsing the version from the ORCA binary, with a fallback to reading the file if memory-mapping fails. This improves performance and reliability when extracting the version string.
  • Added import mmap to src/censo/config/paths.py to support memory-mapped file access.

Testing and benchmarking:

  • Added new unit tests in test/unit/test_config/test_paths.py to verify that ORCA version parsing using mmap matches the previous method and to benchmark the speedup achieved.

fixes #130

Copilot AI review requested due to automatic review settings March 5, 2026 09:59
Copy link

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 addresses incorrect ORCA version detection (issue #130) by extracting the version from the ORCA binary contents instead of parsing it from the executable path, using mmap with a read fallback for robustness.

Changes:

  • Updated PathsConfig.get_orca_version to search for Program Version X.Y.Z within the ORCA binary via mmap, with a fallback to reading bytes if memory-mapping fails.
  • Added a new unit test file intended to compare mmap-based parsing with the previous full-read approach and print a benchmark.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/censo/config/paths.py Switches ORCA version extraction to binary-content parsing using mmap with a read fallback.
test/unit/test_config/test_paths.py Adds a test/benchmark comparing mmap vs full-read parsing (currently environment-dependent).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lmseidler lmseidler added this to the v3.0.6 milestone Mar 5, 2026
@lmseidler lmseidler merged commit 6520df8 into main Mar 5, 2026
6 checks passed
@lmseidler lmseidler deleted the fix/130 branch March 6, 2026 11:35
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.

Incorrect ORCA version detection in HPC

2 participants