Niagara Quickstart: Difference between revisions

Jump to navigation Jump to search
Added a bash function to show the queue'd position of a pending job
mNo edit summary
(Added a bash function to show the queue'd position of a pending job)
Line 538: Line 538:
<li><p><code>squeue -j JOBID</code> to get information on a specific job</p>
<li><p><code>squeue -j JOBID</code> to get information on a specific job</p>
<p>(alternatively, <code>scontrol show job JOBID</code>, which is more verbose).</p></li>
<p>(alternatively, <code>scontrol show job JOBID</code>, which is more verbose).</p></li>
<li><p><code>squeue --start -j JOBID</code> to get an estimate for when a job will run; these tend not to be very accurate predictions.</p></li>
<li><p><code>squeue --start -j JOBID</code> to get an estimate for when a job will run; these tend not to be very accurate predictions.</p>
    <p>
    Since this is not very accurate, you might be interested to know how far back in the queue your job is. This can be accomplished with the following bash function:
 
<pre>
function qpos() {
    if [ "$#" -eq 0 ]; then
        squeue -u "$USER" | tail -n-1 | tr -s ' ' | cut -d' ' -f2 | while read jid; do
            squeue | tr -s ' ' | cut -d' ' -f2 | sort -n | cat -n | grep "$jid"
        done | tr -s ' ' | sort -n -t' ' -k1
    fi
    for jid in "$@"; do
        squeue | tr -s ' ' | cut -d' ' -f2 | sort -n | cat -n | grep "$jid"
    done
}
</pre>
 
Usage:
<pre>
qpos
 
</pre>
 
    </p>
</li>
<li><p><code>scancel -i JOBID</code> to cancel the job.</p></li>
<li><p><code>scancel -i JOBID</code> to cancel the job.</p></li>
<li><p><code>sinfo -pcompute</code> to look at available nodes.</p></li>
<li><p><code>sinfo -pcompute</code> to look at available nodes.</p></li>
Line 545: Line 569:
</li>
</li>
</ul>
</ul>
For more information, check out the wiki page devoted to [[Running jobs]].
For more information, check out the wiki page devoted to [[Running jobs]].


1

edit

Navigation menu