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
New Section: batchsys (Job Scheduler Info) #705
base: master
Are you sure you want to change the base?
Conversation
Any chance to get this merged? |
Curious to know how helpful is it to know the job id ? |
It's quite important when you work with this type of cluster computers! First off, it shows that you have a batch system allocation at all. In most batch systems you do not know if you have an allocation or not because that's not something the prompt is aware of. You'd need to query the batch system to find that out. Worse, when allocations run out, sometimes they do so silently (or the output is cluttered by other output), so even though you had an allocation, you might not have anymore. When your job number is displayed prominently, you have it handy for checking the status, configuration, and health of your job, or for adding an additional job to the same allocation. I find it incredibly handy and use it all the time. (I'm aware that this functionality is only for a fraction of users out there (but that might be true for any of the pieces of information displayed in the prompt…). I'd be happy to disable it by default, but as far as I see there is no method for that.) |
This is what I was looking for. Until then, I was "why not just display a symbol, what's the need for that id ?" With our next major release we aim to simplify handling of custom sections. So adding new sections to prompt are on hold till that. |
Alright! I'll try to keep up with the changes :). |
Print job id to prompt, getting info from job submission engine via environment variables. Currently supported: Slurm, LSF, PBS.
It appears one needs to add their section here as well as otherwise the section is not available without sourcing the section .zsh explicitly.
f74d63a
to
f34902d
Compare
Description
This pull request adds functionality to show the job ID of a batch submission engine (/job scheduler) to the prompt. The job ID is gathered from environment variables, so there is little to no overhead being generated.
I am running many jobs on large HPC machines and need this information frequently when interacting with the session on the compute nodes. With displaying this information, one also directly sees that there still is an allocation available within which you are currently working – something not all schedulers/prompts show directly.
Since the job ID is displayed, the icon for that is obviously an (emoji) briefcase. It can be changed per user variables. Also changed can be prefix, suffix, and color – via the usual environment variables.
I do not know if
batchsys
needs to be added to the default prompt for every user; but without adding it to$SPACESHIP_PROMPT_ORDER
inspaceship.zsh
thebatchsys.zsh
won't be found. So it appears it must? I don't think it is too much of a problem since the environment variable parsing should be fairly quick.NPM tests pass successfully:
Screenshot