Skip to content

check memory requirement in contactmap #1500

Open
rvhonorato wants to merge 10 commits intomainfrom
contmap
Open

check memory requirement in contactmap #1500
rvhonorato wants to merge 10 commits intomainfrom
contmap

Conversation

@rvhonorato
Copy link
Copy Markdown
Member

@rvhonorato rvhonorato commented Apr 7, 2026

You are about to submit a new Pull Request. Before continuing make sure you read the contributing guidelines.

Checklist

  • Tests added for the new code
  • Documentation added for the code changes
  • Modifications / enhancements are reflected on the haddock3 user-manual
  • CHANGELOG.md is updated to incorporate new changes
  • Does not break licensing
  • Does not add any dependencies, if it does please add a thorough explanation

Summary of the Pull Request

This PR adds a logic to check if the host machine has the necessary memory requirements to run contactmap and if it does not it skips the execution of the module.

⚠️ IMPORTANT ⚠️

To get the available memory of the system we are now using psutil, this means this is now a dependency of the project! https://pypi.org/project/psutil/ is a very stable and mature package and is the best way for us to get the available memory in different systems.

Related Issue

#1499

Additional Info

for prosperity: I tried to bypass calculating the matrix and adding a generation with on-the-fly calculation of the contacts, as this would avoid keeping things in memory. However changing this also needs a significant refactoring - basically a whole re-write of this module.

@rvhonorato rvhonorato changed the title optimize memory in contactmap check memory requirement in contactmap Apr 7, 2026
@rvhonorato rvhonorato requested review from VGPReys and amjjbonvin April 7, 2026 14:55
@rvhonorato rvhonorato self-assigned this Apr 7, 2026
@rvhonorato rvhonorato marked this pull request as ready for review April 7, 2026 14:55
@rvhonorato rvhonorato enabled auto-merge April 7, 2026 14:55
@rvhonorato rvhonorato requested a review from VGPReys April 8, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants