Skip to content

Honour the computer's default_mpiprocs_per_machine in HyperQueueJobResource#49

Open
elinscott wants to merge 2 commits into
aiidateam:mainfrom
elinscott:honour-default-mpiprocs
Open

Honour the computer's default_mpiprocs_per_machine in HyperQueueJobResource#49
elinscott wants to merge 2 commits into
aiidateam:mainfrom
elinscott:honour-default-mpiprocs

Conversation

@elinscott

Copy link
Copy Markdown

Problem

HyperQueueJobResource.accepts_default_mpiprocs_per_machine() returns False, so aiida-core's Scheduler.preprocess_resources never injects the computer's default_mpiprocs_per_machine into the resources. The backward-compatibility path then computes num_cpus = num_machines * num_mpiprocs_per_machine with a hard-coded fallback of 1 — so every builder-driven CalcJob (e.g. anything built through aiida-quantumespresso's get_builder_from_protocol, which seeds resources = {'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 returns True, so aiida-core injects the computer's default as num_mpiprocs_per_machine whenever the user did not set it explicitly. The backward-compatibility product picks it up unchanged.

  • When the computer defines no default, aiida-core injects None — the fallback to 1 is kept for that case
  • Explicitly passed resources always win.
  • The modern num_cpus path is untouched.

Testing

New tests in tests/test_scheduler.py

elinscott and others added 2 commits July 8, 2026 17:53
…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>
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.

1 participant