Open
Conversation
There was a problem hiding this comment.
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.
2ef85d3 to
abdbe69
Compare
abdbe69 to
5468dd1
Compare
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.
Builds on #209 for
ohpc_nodegroup_computed.Tested with
gresinopenhpc_nodegroupsand a fakeohpc_node_gpu_gres.