1
0
Fork 0
mirror of https://github.com/hcartiaux/dotfiles.git synced 2024-10-18 17:25:23 +02:00

[bash] bash_slurm, shfmt run

This commit is contained in:
Hyacinthe Cartiaux 2018-02-25 13:04:07 +01:00
parent 49f4838ba7
commit 31415b2b30

View file

@ -1,6 +1,6 @@
# Job + Remaining time
[[ -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 }')
[[ -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() {
if [ -n "$SLURM_JOB_ID" ]; then
@ -11,7 +11,7 @@ __slurm_ps1_remaining_time(){
fi
}
[[ -n "$INTERACTIVE" && -n "$SLURM_PTY_PORT" ]] && (
[[ -n $INTERACTIVE && -n $SLURM_PTY_PORT ]] && (
echo "[SLURM] SLURM_JOB_ID=$SLURM_JOB_ID"
echo "[SLURM] Your nodes are:"
srun bash -c 'echo " $(hostname)*$SLURM_CPUS_ON_NODE"' | sort -u
@ -43,5 +43,3 @@ irisstat(){
printf "%11s %s\n" $p "$usagedata"
done
}