mirror of
https://github.com/hcartiaux/dotfiles.git
synced 2024-10-18 17:25:23 +02:00
[bash] Slurm : do not call scontrol outside of a job
This commit is contained in:
parent
b7c906dc32
commit
85b1c21e71
1 changed files with 1 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
# Job + Remaining time
|
# Job + Remaining time
|
||||||
|
|
||||||
[[ -z "$SLURM_JOB_WALLTIME_SECONDS" ]] && SLURM_JOB_WALLTIME_SECONDS=$(scontrol show job $SLURM_JOB_ID | grep -Po 'TimeLimit=\K[^ ]*' | awk -F: '/:/ { print ($1 * 3600) + ($2 * 60) + $3 }')
|
[[ -n "$SLURM_JOB_ID" && -z "$SLURM_JOB_WALLTIME_SECONDS" ]] && SLURM_JOB_WALLTIME_SECONDS=$(scontrol show job $SLURM_JOB_ID | grep -Po 'TimeLimit=\K[^ ]*' | awk -F: '/:/ { print ($1 * 3600) + ($2 * 60) + $3 }')
|
||||||
|
|
||||||
__slurm_ps1_remaining_time(){
|
__slurm_ps1_remaining_time(){
|
||||||
if [ -n "$SLURM_JOB_ID" ]; then
|
if [ -n "$SLURM_JOB_ID" ]; then
|
||||||
|
|
Loading…
Reference in a new issue