Skip to content

Conversation

@ekouts
Copy link
Contributor

@ekouts ekouts commented Oct 16, 2025

Add MAINTENANCE to the available states for nodes that belong in a reservation with the MAINT flag, when the user explicitly requests for this reservation.

Fixes #3572 .

@ekouts ekouts requested review from teojgo and vkarak October 16, 2025 11:36
@ekouts ekouts self-assigned this Oct 16, 2025
@ekouts ekouts changed the title Improve slurm handling of maintenance reservations Add MAINTENANCE to the available states for nodes that belong in a Slurm reservation with the MAINT flag. Oct 16, 2025
@ekouts ekouts changed the title Add MAINTENANCE to the available states for nodes that belong in a Slurm reservation with the MAINT flag. Improve slurm handling of maintenance reservations Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.26%. Comparing base (2546434) to head (d93555c).

Files with missing lines Patch % Lines
reframe/core/schedulers/slurm.py 45.45% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3573      +/-   ##
===========================================
- Coverage    91.28%   91.26%   -0.03%     
===========================================
  Files           62       62              
  Lines        13583    13582       -1     
===========================================
- Hits         12399    12395       -4     
- Misses        1184     1187       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ekouts ekouts changed the title Improve slurm handling of maintenance reservations Improve handling of maintenance reservations in Slurm Oct 16, 2025
@ekouts ekouts marked this pull request as ready for review October 22, 2025 15:05
@vkarak vkarak changed the title Improve handling of maintenance reservations in Slurm [feat] Improve handling of maintenance reservations in Slurm Nov 7, 2025
@vkarak vkarak added this to the ReFrame 4.9 milestone Nov 7, 2025
Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

I agree with the overall fix; I have just some suggestions on the implementation.

@github-project-automation github-project-automation bot moved this from Todo to In Progress in ReFrame Backlog Nov 7, 2025
@vkarak
Copy link
Contributor

vkarak commented Nov 7, 2025

We would also need a unit test.

@vkarak vkarak modified the milestones: ReFrame 4.9, ReFrame 4.10 Nov 12, 2025
Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

The implementation looks good to me. I have some minor suggestions. As for the unit tests we can still test these changes by creating a fake reservation output that includes some of the nodes here. Ideally, we should change how we get the reservation nodes and retrieve them from a fixture. I could try adding something along these lines.



def filter_nodes_by_state(nodelist, state):
def filter_nodes_by_state(nodelist, state, scheduler):
Copy link
Contributor

Choose a reason for hiding this comment

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

What if made this a scheduler's method?

self._sched_access_in_submit = self.get_option(
'sched_access_in_submit'
)
self.node_available_states = {
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this needs to be public:

Suggested change
self.node_available_states = {
self._available_states = {

Comment on lines +450 to +452
else:
self.log(f"could not extract the reservation flags for "
f"reservation '{reservation}'")
Copy link
Contributor

Choose a reason for hiding this comment

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

What if instead of logging only the else here, we logged the full completed.stdout once we get it?

self.log(f'reservation info\n{completed.stdout}')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Improve slurm handling of maintenance reservations

2 participants