Skip to content

Adopt upstream sizing logic from ComputeManager - #3

Open
dotsdl wants to merge 4 commits into
mainfrom
adopt-upstream-sizing
Open

Adopt upstream sizing logic from ComputeManager#3
dotsdl wants to merge 4 commits into
mainfrom
adopt-upstream-sizing

Conversation

@dotsdl

@dotsdl dotsdl commented May 4, 2026

Copy link
Copy Markdown
Member

Draft until OpenFreeEnergy/alchemiscale#502 merges. This PR depends on the new _compute_jobs_to_create method and max_submit_per_cycle field added there.

Note

Targeting the slurm-manager branch (PR #2). Will rebase to main once #2 lands and #502 merges.

Summary

Drops the local sizing logic from ScriptTemplateHPCManager in favor of the upstream version on alchemiscale.compute.manager.ComputeManager. Same formula (min(num_tasks, max_submit_per_cycle, remaining_capacity) // claim_limit with floor-to-1), now centralized.

Changes

ScriptTemplateHPCManager.create_compute_services signature: (data) -> int(data, target) -> int. The body shrinks substantially — the sizing computation is gone, only the backend-specific health checks (check_job_health, verify_running_jobs, clear_successful_jobs) and the jobs_pending() gate remain.

Drop ScriptTemplateHPCManager._compute_jobs_to_create. The base class on the upstream now provides this concrete method.

Drop HPCManagerSettings.max_submit_per_cycle. Now inherited from upstream ComputeManagerSettings, which adds the field with the same default of 1. Existing user configs continue to work unchanged.

Tests

  • Drop the eight test_sizing_* unit tests; the equivalent suite lives upstream in alchemiscale/tests/unit/compute/test_manager.py.
  • Replace test_create_compute_services_respects_sizing with the simpler test_create_compute_services_honors_target, which confirms only that given target=N we submit exactly N scripts. Arithmetic is upstream's responsibility now.
  • Adapt remaining create_compute_services tests to the new signature (passing target= explicitly).

Test count: 54 → 46 (matching the work that's now done upstream); all pass against the alchemiscale#502 branch.

Test plan

🤖 Generated with Claude Code

Drops the local _compute_jobs_to_create method and the inline sizing
logic in ScriptTemplateHPCManager.create_compute_services in favor of
the upstream version on alchemiscale.compute.manager.ComputeManager
added in OpenFreeEnergy/alchemiscale#502. Same formula
(min(num_tasks, max_submit_per_cycle, remaining_capacity) // claim_limit
with floor-to-1), one source of truth.

Changes
-------

* ScriptTemplateHPCManager.create_compute_services signature now
  (data, target) -> int. The body shrinks substantially: the sizing
  computation is gone, only the backend-specific health checks
  (check_job_health, verify_running_jobs, clear_successful_jobs) and
  the jobs_pending() gate remain.

* Drop ScriptTemplateHPCManager._compute_jobs_to_create. The base class
  on the upstream now provides this concrete method.

* Drop HPCManagerSettings.max_submit_per_cycle. Now inherited from
  upstream ComputeManagerSettings, which adds the field with the same
  default of 1.

Tests
-----

* Drop the eight test_sizing_* unit tests; the equivalent suite lives
  upstream in alchemiscale/tests/unit/compute/test_manager.py.

* Replace test_create_compute_services_respects_sizing with the simpler
  test_create_compute_services_honors_target, which confirms only that
  given target=N we submit exactly N scripts. The arithmetic is upstream's
  responsibility now.

* Adapt remaining create_compute_services tests to the new signature
  (passing target= explicitly).

Test count: 54 -> 46 (matching the work that's now done upstream); all
pass against the alchemiscale#502 branch.

Depends on
----------

* OpenFreeEnergy/alchemiscale#502 (must merge first; this PR will not
  pass tests until the upstream changes are available).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Base automatically changed from slurm-manager to main May 4, 2026 15:12
@dotsdl
dotsdl marked this pull request as ready for review June 8, 2026 21:16
dotsdl and others added 3 commits June 8, 2026 15:26
Adds a conda test env and a CI workflow: builds the env, overlays
alchemiscale from git main (until #502 is on a conda-forge release),
installs the package, and runs the test suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
List alchemiscale's runtime deps explicitly in the test env, and restrict
setuptools find to alchemiscale_hpc* so the new devtools/ dir doesn't trip
flat-layout auto-discovery.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the hand-listed deps with the full OpenFreeEnergy/alchemiscale
devtools/conda-envs/test.yml (main), plus pyyaml.

Co-Authored-By: Claude Opus 4.8 (1M context) <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