Honour the computer's default_mpiprocs_per_machine in HyperQueueJobResource#49
Open
elinscott wants to merge 2 commits into
Open
Honour the computer's default_mpiprocs_per_machine in HyperQueueJobResource#49elinscott wants to merge 2 commits into
default_mpiprocs_per_machine in HyperQueueJobResource#49elinscott wants to merge 2 commits into
Conversation
…source accepts_default_mpiprocs_per_machine() returned False, so aiida-core's Scheduler.preprocess_resources never injected the computer's default_mpiprocs_per_machine, and the backward-compatibility path num_machines * num_mpiprocs_per_machine fell back to a hard-coded 1: every builder-driven CalcJob on a HyperQueue computer silently ran on a single CPU regardless of the computer's configured default. Return True and handle the None that aiida-core injects when the computer defines no default (falling back to 1 as before). Also join the two halves of the deprecation warning, the second of which was a dead string statement that never reached the message. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
HyperQueueJobResource.accepts_default_mpiprocs_per_machine()returnsFalse, soaiida-core'sScheduler.preprocess_resourcesnever injects the computer'sdefault_mpiprocs_per_machineinto the resources. The backward-compatibility path then computesnum_cpus = num_machines * num_mpiprocs_per_machinewith a hard-coded fallback of 1 — so every builder-drivenCalcJob(e.g. anything built throughaiida-quantumespresso'sget_builder_from_protocol, which seedsresources = {'num_machines': 1}) silently runs on a single CPU, regardless of the "Default #procs/machine" configured on the computer.See the existing TODO comment in
validate_resources, which already describes this hole.Change
accepts_default_mpiprocs_per_machine()now returnsTrue, so aiida-core injects the computer's default asnum_mpiprocs_per_machinewhenever the user did not set it explicitly. The backward-compatibility product picks it up unchanged.None— the fallback to 1 is kept for that casenum_cpuspath is untouched.Testing
New tests in
tests/test_scheduler.py