Skip to content

Compute AccountingStorageTRES#210

Open
elelaysh wants to merge 2 commits intomasterfrom
feat/AccountingStorageTRES
Open

Compute AccountingStorageTRES#210
elelaysh wants to merge 2 commits intomasterfrom
feat/AccountingStorageTRES

Conversation

@elelaysh
Copy link
Contributor

Builds on #209 for ohpc_nodegroup_computed.
Tested with gres in openhpc_nodegroups and a fake ohpc_node_gpu_gres.

@elelaysh elelaysh requested a review from a team as a code owner February 25, 2026 11:27
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces automatic computation for Slurm's AccountingStorageTRES and DefMemPerCPU parameters, and refactors node-specific computations into a new ohpc_nodegroup_computed variable. The changes improve configuration by making it more dynamic and centralize logic from templates into variables, which is a good practice. However, I've found a couple of areas in vars/main.yml that could be improved for robustness and correctness: one is a potential bug in the ohpc_accounting_storage_tres computation that can lead to duplicated values, and the other is an opportunity to make the creation of ohpc_nodegroup_computed more robust by building a dictionary directly instead of a string.

Also create the ohpc_nodegroups_computed variable,
to share computed values per nodegroup between multiple
places of the role.
If a nodegroup is in ohpc_nodegroups_computed it has
at least one host. It stores
 - first_host: name of the first host in the nodegroup;
   use `hostvars[computed.first_host]` to access its hostvars
 - inventory_group_name: name of the inventory group for this
   nodegroup; use `groups[computed.inventory_group_name]` to access
   the host list
 - ram_mb: memory per node in the nodegroup
 - def_mem_per_cpu: computed DefMemPerCPU for this nodegroup
   as the RAM/vCPU ratio.
@elelaysh elelaysh force-pushed the feat/AccountingStorageTRES branch from 2ef85d3 to abdbe69 Compare March 2, 2026 12:53
@elelaysh elelaysh requested a review from sjpb March 2, 2026 12:55
@elelaysh elelaysh force-pushed the feat/AccountingStorageTRES branch from abdbe69 to 5468dd1 Compare March 2, 2026 13:45
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