Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

back to basics for macos users when detecting number of cores #1183

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

VGPReys
Copy link
Contributor

@VGPReys VGPReys commented Dec 13, 2024

Summary of the Pull Request

Try to solve the problem related to core detection on MacOS.
The implemented solution is to go back to the original function os.cpu_count().
While this may not be fully accurate, it allows to at least return the number of cores available on MacOS machines.
On Linux systems, the os.sched_getaffinity(0) function is used, returning the number of cores allocated to the process, which is a better solution for HPC and SLURM executions.

Related Issue

Closes #1182

@VGPReys VGPReys self-assigned this Dec 13, 2024
@VGPReys VGPReys added bug Something isn't working execution Related to execution modes, such as GRID, HPC, local, etc. labels Dec 13, 2024
@VGPReys VGPReys requested a review from amjjbonvin December 13, 2024 15:29
Copy link
Member

@amjjbonvin amjjbonvin left a comment

Choose a reason for hiding this comment

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

Works perfectly

@VGPReys VGPReys merged commit d7ade37 into main Dec 16, 2024
7 checks passed
@VGPReys VGPReys deleted the fix-ncores-count-os-issues branch December 16, 2024 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working execution Related to execution modes, such as GRID, HPC, local, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The last pull request #1172 about core detection broke the execution on OSX
2 participants