tdegeus / GooseSLURM

SLURM command line tools and scripts
https://gooseslurm.rtfd.io
MIT License
10 stars 2 forks source link

(Suggestion) Make the squeue command an input for squeue.read() #73

Open mikejwaters opened 9 months ago

mikejwaters commented 9 months ago

Here's basically what I'm suggesting:

def read(data=None, command='squeue -o "%all"'):
...
    if data is None:
        data = subprocess.check_output(command, shell=True).decode("utf-8")

This would give users more flexibility in setting up work-arounds for edge cases.

For me, being able to set the command='squeue -u $USER -o "%all"' drastically speeds up the query. It takes ~10 seconds to run normally, but only 0.3 seconds when narrowed to my jobs.

BTW, GooseSLURM seems to be pretty perfect for my needs, thanks!

tdegeus commented 9 months ago

Good idea. In addition, Gstat -u USER and Gstat -U could use your command effortlessly then. Would you be willing to submit a PR?

mikejwaters commented 9 months ago

Since everything is in panic mode, I might have time in mid-March. You'll need to remind me then.

tdegeus commented 9 months ago

Don't worry, if I have time before I will do it.