# 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 }') __slurm_ps1_remaining_time() { if [ -n "$SLURM_JOB_ID" ]; then DATE_NOW=$(date +%s) DATE_JOB_START=$(stat -c %Y "/sys/fs/cgroup/cpu/slurm/uid_${UID}/job_${SLURM_JOB_ID}") ((DATE_TMP = (SLURM_JOB_WALLTIME_SECONDS - DATE_NOW + DATE_JOB_START) / 60)) echo -n "[SLURM$SLURM_JOB_ID->$DATE_TMP]" fi } [[ -n $INTERACTIVE && -n $SLURM_PTY_PORT ]] && ( echo "[SLURM] SLURM_JOB_ID=${SLURM_JOB_ID}" echo "[SLURM] Your nodes are:" [[ $(echo "$SLURM_JOB_CPUS_PER_NODE" | grep '(x') ]] && nbcpu=$(echo "$SLURM_JOB_CPUS_PER_NODE" | grep -o '^[^(]*' ) for node in $(scontrol show hostname "$SLURM_JOB_NODELIST") ; do i=$((i+1)) echo " ${node}*${nbcpu:-$(echo "$SLURM_JOB_CPUS_PER_NODE" | cut -d, -f$i)}" done ) || true alias sql=' squeue -la' alias sqlu='squeue -la -u $USER' alias sd=' sinfo -d' alias i=' srun -p interactive --qos qos-interactive --time=5:0 --pty bash -i' alias ix=' srun -p interactive --qos qos-interactive --time=5:0 --x11 --pty bash -i' scol() { sinfo -o "%E|%T|%N" -p all $* | grep -e '\(drain\|down\|boot\|inval\)' | column -t -s'|' | sort }