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

New Section: batchsys (Job Scheduler Info) #705

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AndiH
Copy link

@AndiH AndiH commented Jul 18, 2019

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 in spaceship.zsh the batchsys.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:

--------------------------------------------------------------------------------
Tests are passing!
--------------------------------------------------------------------------------

Screenshot

Bildschirmfoto 2019-07-18 um 09 13 20

@AndiH
Copy link
Author

AndiH commented Aug 26, 2019

Any chance to get this merged?

@salmanulfarzy
Copy link
Member

Curious to know how helpful is it to know the job id ?

@salmanulfarzy salmanulfarzy added new-feature A PR that implement feature (section, specific behavior, etc). under-discussion labels Aug 26, 2019
@AndiH
Copy link
Author

AndiH commented Aug 27, 2019

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.)

@salmanulfarzy
Copy link
Member

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.

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.

@AndiH
Copy link
Author

AndiH commented Aug 27, 2019

Alright! I'll try to keep up with the changes :).

@salmanulfarzy salmanulfarzy added the frozen Progress is temporarily frozen until resolving the specific issue. label Sep 20, 2019
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frozen Progress is temporarily frozen until resolving the specific issue. new-feature A PR that implement feature (section, specific behavior, etc).
Development

Successfully merging this pull request may close these issues.

None yet

3 participants