Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of --batchless option #182

Open
lars-t-hansen opened this issue Aug 27, 2024 · 1 comment
Open

Get rid of --batchless option #182

lars-t-hansen opened this issue Aug 27, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@lars-t-hansen
Copy link
Collaborator

On slurm systems, it will sometimes happen that a node is taken out of the slurm pool and turned into an interactive node, this seems to happen with some regularity on Fox. The admins are unlikely to remember to change the options to sonar in this case, or to change them back when the node goes back into the pool: non-slurm nodes need the --batchless option, slurm nodes run with --rollup. This turns into a mess on the backend where we have inappropriate job IDs for all the jobs from an interactive node sonar'd without --batchless (NAICNO/Jobanalyzer#534)

Probably we should try to get rid of --batchless and just infer it.

On a slurm system, we will be able to find the slurm job ID in /proc/pid/cgroup (we should be a little more fastidious about what we match when we search that file). If the node is interactive, those data should not be there, and in that case, we should be able to fall back on using the process group, as we do for non-slurm systems.

One real complication is that a lot of processes on a slurm system will not have a slurm ID, because they are not slurm jobs, just normal processes. In that case, we currently use 0 for the job ID, as we must; no PID will be safe against confusion with the slurm job ID. This is unlike on batchless systems where we always use the pgrp except in corner cases (where we use 0). On a given system we will therefore need to compute slurm and pgrp job IDs for all the processes, and if we find a nonzero slurm ID for any process then we use the slurm IDs (and zeroes), and otherwise we use the pgrp IDs.

There will be a bit of surgery required for this, the "jobmanager" abstraction will probably disappear, and the data structures and printing will be embellished. We should be sure to leave copious comments.

Now about --rollup. If present, it should only have effect if we have Slurm job IDs (or other batch system IDs I guess). This would require a bit more surgery still.

@lars-t-hansen lars-t-hansen added the enhancement New feature or request label Aug 27, 2024
@lars-t-hansen lars-t-hansen self-assigned this Aug 27, 2024
@lars-t-hansen
Copy link
Collaborator Author

lars-t-hansen commented Sep 4, 2024

Another couple of complications.

First, on a node on a slurm system that sometimes runs slurm, and sometimes not, the slurm IDs will usually not be reused (by policy), but the non-slurm IDs will, and the non-slurm IDs may sometimes match valid slurm IDs from the same node at a different point in time - so it will be as if the IDs were reused after all.

Second, and worse, a non-slurm node using the pgrp for the job ID may accidentally match the slurm job ID from a slurm node at a time when both jobs are running. This isn't really a problem on the node side but it could be a problem on the back-end, which will almost certainly see the two jobs as part of the same job.

None of these problems are new if we infer --batchless from context, we already have them. In particular, I think the problem of two non-slurm nodes using the same pgrp ID for two unconnected jobs at the same time has been noted before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant