<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://oldwiki.scinet.utoronto.ca/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ashwin</id>
	<title>oldwiki.scinet.utoronto.ca - User contributions [en-gb]</title>
	<link rel="self" type="application/atom+xml" href="https://oldwiki.scinet.utoronto.ca/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ashwin"/>
	<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php/Special:Contributions/Ashwin"/>
	<updated>2026-06-19T22:14:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.12</generator>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9151</id>
		<title>User Remote</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9151"/>
		<updated>2018-02-12T14:51:22Z</updated>

		<summary type="html">&lt;p&gt;Ashwin: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Step 0: Some SSH Aliases to Make Life Easier==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function p7() {&lt;br /&gt;
    ssh p7n01-ib0 &amp;quot;$@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function gpc() {&lt;br /&gt;
    ssh gpc01 &amp;quot;$@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Submitting jobs==&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;qsub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llsubmit&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function submit() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Can't submit from a login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC &lt;br /&gt;
        submitter=qsub&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        submitter=llsubmit&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    for fpath in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $submitter &amp;quot;$fpath&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.sh job2.sh job3.sh&lt;br /&gt;
&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ submit job*.sh&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.ll job2.ll job3.ll&lt;br /&gt;
&lt;br /&gt;
ashwin@ashwin@p7n01 $ submit job*.ll&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Canceling jobs==&lt;br /&gt;
&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;canceljob&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llcancel&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function cancel() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    &lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Cannot cancel from Login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC&lt;br /&gt;
        canceler=canceljob&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        canceler=llcancel&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for jid in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $canceler &amp;quot;$jid&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remote/Batch query running jobs==&lt;br /&gt;
The GPC and P7 queues may be queried for job status (respectively, with &amp;lt;tt&amp;gt;showq&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llq&amp;lt;/tt&amp;gt;). However, this shows only the job ID and not much else. The following bash functions list the running and queued jobs in much more detail&lt;br /&gt;
&lt;br /&gt;
===Querying multiple queues===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function que() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        p7 que&lt;br /&gt;
        echo &amp;quot;========================================&amp;quot;&lt;br /&gt;
        gpc que&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        showq -u &amp;quot;$USER&amp;quot;&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        llq -u &amp;quot;$USER&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting detailed job information from queues===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function columnize() {&lt;br /&gt;
    array=$1&lt;br /&gt;
    (for lineno in `seq 0 ${#lines[@]}`; do&lt;br /&gt;
        line=${lines[lineno]}&lt;br /&gt;
        echo &amp;quot;$line&amp;quot;&lt;br /&gt;
    done) | column -t&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function clearLines() {&lt;br /&gt;
    for _ in `seq 1 $1`; do&lt;br /&gt;
        echo -ne &amp;quot;\e[1A&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function whatare() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        echo &amp;quot;============ P7 ============&amp;quot;&lt;br /&gt;
        p7 whatare&lt;br /&gt;
        echo ''&lt;br /&gt;
        echo ''&lt;br /&gt;
        echo &amp;quot;============GPC ============&amp;quot;&lt;br /&gt;
        gpc whatare&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    lines=()&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        echo &amp;quot;-----------RUNNING-----------&amp;quot;&lt;br /&gt;
        for jobid in `showq -r -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2 | tr -d '\n'`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot; | tr -d '\n'`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;-----------WAITING-----------&amp;quot;&lt;br /&gt;
        len=${#lines[@]}&lt;br /&gt;
        appendlen=$((len + 1))&lt;br /&gt;
        lines[$appendlen]=&amp;quot;-----------WAITING-----------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        for jobid in `showq -i -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;-----------BLOCKED-----------&amp;quot;&lt;br /&gt;
        len=${#lines[@]}&lt;br /&gt;
        appendlen=$((len + 1))&lt;br /&gt;
        lines[$appendlen]=&amp;quot;-----------BLOCKED-----------&amp;quot;&lt;br /&gt;
        for jobid in `showq -b -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid  $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;=============================&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        joblines=`que | tail -n +3 | head -n -2 | sort -t'.' -k2 -n`&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;---------- RUNNING ----------&amp;quot;&lt;br /&gt;
        echo &amp;quot;$joblines&amp;quot; | while read jobline; do&lt;br /&gt;
            status=`echo &amp;quot;$jobline&amp;quot; | awk '$1=$1' | cut -d' ' -f5`&lt;br /&gt;
&lt;br /&gt;
            if [[ $status != R ]] ; then&lt;br /&gt;
                continue&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            job=`echo $jobline | cut -d' ' -f1 | cut -d'.' -f2`&lt;br /&gt;
            echo -n `whatis &amp;quot;$job&amp;quot; | grep &amp;quot;Job Name&amp;quot;` &amp;amp;&amp;amp; echo&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;---------- WAITING ----------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;$joblines&amp;quot; | while read jobline; do&lt;br /&gt;
            status=`echo &amp;quot;$jobline&amp;quot; | awk '$1=$1' | cut -d' ' -f5`&lt;br /&gt;
&lt;br /&gt;
            if [[ $status != I ]] ; then&lt;br /&gt;
                continue&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            job=`echo $jobline | cut -d' ' -f1 | cut -d'.' -f2`&lt;br /&gt;
            echo -n `whatis &amp;quot;$job&amp;quot; | grep &amp;quot;Job Name&amp;quot;` &amp;amp;&amp;amp; echo&lt;br /&gt;
        done&lt;br /&gt;
        echo &amp;quot;=============================&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function whatis() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        echo &amp;quot;Cannot check from a login node&amp;quot;&lt;br /&gt;
        #return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        checker=checkjob&lt;br /&gt;
        label=AName&lt;br /&gt;
&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        checker=&amp;quot;llq -l&amp;quot;&lt;br /&gt;
        label=&amp;quot;Job Name&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for j in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        echo -n &amp;quot;$j &amp;quot; &amp;amp;&amp;amp; $checker &amp;quot;$j&amp;quot; | grep &amp;quot;$label&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ whatare&lt;br /&gt;
============ P7 ============&lt;br /&gt;
---------- RUNNING ----------&lt;br /&gt;
# job information about running jobs&lt;br /&gt;
---------- WAITING ----------&lt;br /&gt;
# job information about waiting jobs&lt;br /&gt;
=============================&lt;br /&gt;
&lt;br /&gt;
-----------RUNNING-----------&lt;br /&gt;
# job information about running jobs&lt;br /&gt;
-----------WAITING-----------&lt;br /&gt;
# job information about waiting jobs&lt;br /&gt;
-----------BLOCKED-----------&lt;br /&gt;
# job information about blocked jobs&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ whatare&lt;br /&gt;
-----------RUNNING-----------&lt;br /&gt;
# job information about running jobs&lt;br /&gt;
-----------WAITING-----------&lt;br /&gt;
# job information about waiting jobs&lt;br /&gt;
-----------BLOCKED-----------&lt;br /&gt;
# job information about blocked jobs&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ashwin</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9149</id>
		<title>User Remote</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9149"/>
		<updated>2018-02-09T15:34:00Z</updated>

		<summary type="html">&lt;p&gt;Ashwin: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Step 0: Some SSH Aliases to Make Life Easier==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function p7() {&lt;br /&gt;
    ssh p7n01-ib0 &amp;quot;$@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function gpc() {&lt;br /&gt;
    ssh gpc01 &amp;quot;$@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Submitting jobs==&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;qsub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llsubmit&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function submit() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Can't submit from a login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC &lt;br /&gt;
        submitter=qsub&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        submitter=llsubmit&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    for fpath in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $submitter &amp;quot;$fpath&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.sh job2.sh job3.sh&lt;br /&gt;
&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ submit job*.sh&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.ll job2.ll job3.ll&lt;br /&gt;
&lt;br /&gt;
ashwin@ashwin@p7n01 $ submit job*.ll&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Canceling jobs==&lt;br /&gt;
&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;canceljob&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llcancel&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function cancel() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    &lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Cannot cancel from Login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC&lt;br /&gt;
        canceler=canceljob&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        canceler=llcancel&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for jid in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $canceler &amp;quot;$jid&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remote/Batch query running jobs==&lt;br /&gt;
The GPC and P7 queues may be queried for job status (respectively, with &amp;lt;tt&amp;gt;showq&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llq&amp;lt;/tt&amp;gt;). However, this shows only the job ID and not much else. The following bash functions list the running and queued jobs in much more detail&lt;br /&gt;
&lt;br /&gt;
===Querying multiple queues===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function que() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        p7 que&lt;br /&gt;
        echo &amp;quot;========================================&amp;quot;&lt;br /&gt;
        gpc que&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        showq -u &amp;quot;$USER&amp;quot;&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        llq -u &amp;quot;$USER&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting detailed job information from queues===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function columnize() {&lt;br /&gt;
    array=$1&lt;br /&gt;
    (for lineno in `seq 0 ${#lines[@]}`; do&lt;br /&gt;
        line=${lines[lineno]}&lt;br /&gt;
        echo &amp;quot;$line&amp;quot;&lt;br /&gt;
    done) | column -t&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function clearLines() {&lt;br /&gt;
    for _ in `seq 1 $1`; do&lt;br /&gt;
        echo -ne &amp;quot;\e[1A&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function whatare() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        echo &amp;quot;============ P7 ============&amp;quot;&lt;br /&gt;
        p7 whatare&lt;br /&gt;
        echo ''&lt;br /&gt;
        echo ''&lt;br /&gt;
        echo &amp;quot;============GPC ============&amp;quot;&lt;br /&gt;
        gpc whatare&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    lines=()&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        echo &amp;quot;-----------RUNNING-----------&amp;quot;&lt;br /&gt;
        for jobid in `showq -r -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2 | tr -d '\n'`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot; | tr -d '\n'`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;-----------WAITING-----------&amp;quot;&lt;br /&gt;
        len=${#lines[@]}&lt;br /&gt;
        appendlen=$((len + 1))&lt;br /&gt;
        lines[$appendlen]=&amp;quot;-----------WAITING-----------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        for jobid in `showq -i -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;-----------BLOCKED-----------&amp;quot;&lt;br /&gt;
        len=${#lines[@]}&lt;br /&gt;
        appendlen=$((len + 1))&lt;br /&gt;
        lines[$appendlen]=&amp;quot;-----------BLOCKED-----------&amp;quot;&lt;br /&gt;
        for jobid in `showq -b -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid  $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;=============================&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        joblines=`que | tail -n +3 | head -n -2 | sort -t'.' -k2 -n`&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;---------- RUNNING ----------&amp;quot;&lt;br /&gt;
        echo &amp;quot;$joblines&amp;quot; | while read jobline; do&lt;br /&gt;
            status=`echo &amp;quot;$jobline&amp;quot; | awk '$1=$1' | cut -d' ' -f5`&lt;br /&gt;
&lt;br /&gt;
            if [[ $status != R ]] ; then&lt;br /&gt;
                continue&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            job=`echo $jobline | cut -d' ' -f1 | cut -d'.' -f2`&lt;br /&gt;
            echo -n `whatis &amp;quot;$job&amp;quot; | grep &amp;quot;Job Name&amp;quot;` &amp;amp;&amp;amp; echo&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;---------- WAITING ----------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;$joblines&amp;quot; | while read jobline; do&lt;br /&gt;
            status=`echo &amp;quot;$jobline&amp;quot; | awk '$1=$1' | cut -d' ' -f5`&lt;br /&gt;
&lt;br /&gt;
            if [[ $status != I ]] ; then&lt;br /&gt;
                continue&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            job=`echo $jobline | cut -d' ' -f1 | cut -d'.' -f2`&lt;br /&gt;
            echo -n `whatis &amp;quot;$job&amp;quot; | grep &amp;quot;Job Name&amp;quot;` &amp;amp;&amp;amp; echo&lt;br /&gt;
        done&lt;br /&gt;
        echo &amp;quot;=============================&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function whatis() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        echo &amp;quot;Cannot check from a login node&amp;quot;&lt;br /&gt;
        #return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        checker=checkjob&lt;br /&gt;
        label=AName&lt;br /&gt;
&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        checker=&amp;quot;llq -l&amp;quot;&lt;br /&gt;
        label=&amp;quot;Job Name&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for j in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        echo -n &amp;quot;$j &amp;quot; &amp;amp;&amp;amp; $checker &amp;quot;$j&amp;quot; | grep &amp;quot;$label&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ whatare&lt;br /&gt;
-----------RUNNING-----------&lt;br /&gt;
# job information about running jobs&lt;br /&gt;
-----------WAITING-----------&lt;br /&gt;
# job information about waiting jobs&lt;br /&gt;
-----------BLOCKED-----------&lt;br /&gt;
# job information about blocked jobs&lt;br /&gt;
=============================&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ashwin</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9148</id>
		<title>User Remote</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9148"/>
		<updated>2018-02-09T15:33:42Z</updated>

		<summary type="html">&lt;p&gt;Ashwin: /* Getting detailed job information from queues */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Step 0: Some SSH Aliases to Make Life Easier==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function p7() {&lt;br /&gt;
    ssh p7n01-ib0 &amp;quot;$@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function gpc() {&lt;br /&gt;
    ssh gpc01 &amp;quot;$@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Submitting jobs==&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;qsub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llsubmit&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function submit() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Can't submit from a login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC &lt;br /&gt;
        submitter=qsub&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        submitter=llsubmit&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    for fpath in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $submitter &amp;quot;$fpath&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.sh job2.sh job3.sh&lt;br /&gt;
&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ submit job*.sh&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.ll job2.ll job3.ll&lt;br /&gt;
&lt;br /&gt;
ashwin@ashwin@p7n01 $ submit job*.ll&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Canceling jobs==&lt;br /&gt;
&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;canceljob&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llcancel&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function cancel() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    &lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Cannot cancel from Login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC&lt;br /&gt;
        canceler=canceljob&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        canceler=llcancel&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for jid in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $canceler &amp;quot;$jid&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remote/Batch query running jobs==&lt;br /&gt;
The GPC and P7 queues may be queried for job status (respectively, with &amp;lt;tt&amp;gt;showq&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llq&amp;lt;/tt&amp;gt;). However, this shows only the job ID and not much else. The following bash functions list the running and queued jobs in much more detail&lt;br /&gt;
&lt;br /&gt;
===Querying multiple queues===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function que() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        p7 que&lt;br /&gt;
        echo &amp;quot;========================================&amp;quot;&lt;br /&gt;
        gpc que&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        showq -u &amp;quot;$USER&amp;quot;&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        llq -u &amp;quot;$USER&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting detailed job information from queues===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function columnize() {&lt;br /&gt;
    array=$1&lt;br /&gt;
    (for lineno in `seq 0 ${#lines[@]}`; do&lt;br /&gt;
        line=${lines[lineno]}&lt;br /&gt;
        echo &amp;quot;$line&amp;quot;&lt;br /&gt;
    done) | column -t&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function clearLines() {&lt;br /&gt;
    for _ in `seq 1 $1`; do&lt;br /&gt;
        echo -ne &amp;quot;\e[1A&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function whatare() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        echo &amp;quot;============ P7 ============&amp;quot;&lt;br /&gt;
        p7 whatare&lt;br /&gt;
        echo ''&lt;br /&gt;
        echo ''&lt;br /&gt;
        echo &amp;quot;============GPC ============&amp;quot;&lt;br /&gt;
        gpc whatare&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    lines=()&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        echo &amp;quot;-----------RUNNING-----------&amp;quot;&lt;br /&gt;
        for jobid in `showq -r -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2 | tr -d '\n'`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot; | tr -d '\n'`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;-----------WAITING-----------&amp;quot;&lt;br /&gt;
        len=${#lines[@]}&lt;br /&gt;
        appendlen=$((len + 1))&lt;br /&gt;
        lines[$appendlen]=&amp;quot;-----------WAITING-----------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        for jobid in `showq -i -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;-----------BLOCKED-----------&amp;quot;&lt;br /&gt;
        len=${#lines[@]}&lt;br /&gt;
        appendlen=$((len + 1))&lt;br /&gt;
        lines[$appendlen]=&amp;quot;-----------BLOCKED-----------&amp;quot;&lt;br /&gt;
        for jobid in `showq -b -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid  $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;=============================&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        joblines=`que | tail -n +3 | head -n -2 | sort -t'.' -k2 -n`&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;---------- RUNNING ----------&amp;quot;&lt;br /&gt;
        echo &amp;quot;$joblines&amp;quot; | while read jobline; do&lt;br /&gt;
            status=`echo &amp;quot;$jobline&amp;quot; | awk '$1=$1' | cut -d' ' -f5`&lt;br /&gt;
&lt;br /&gt;
            if [[ $status != R ]] ; then&lt;br /&gt;
                continue&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            job=`echo $jobline | cut -d' ' -f1 | cut -d'.' -f2`&lt;br /&gt;
            echo -n `whatis &amp;quot;$job&amp;quot; | grep &amp;quot;Job Name&amp;quot;` &amp;amp;&amp;amp; echo&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;---------- WAITING ----------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;$joblines&amp;quot; | while read jobline; do&lt;br /&gt;
            status=`echo &amp;quot;$jobline&amp;quot; | awk '$1=$1' | cut -d' ' -f5`&lt;br /&gt;
&lt;br /&gt;
            if [[ $status != I ]] ; then&lt;br /&gt;
                continue&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            job=`echo $jobline | cut -d' ' -f1 | cut -d'.' -f2`&lt;br /&gt;
            echo -n `whatis &amp;quot;$job&amp;quot; | grep &amp;quot;Job Name&amp;quot;` &amp;amp;&amp;amp; echo&lt;br /&gt;
        done&lt;br /&gt;
        echo &amp;quot;=============================&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function whatis() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        echo &amp;quot;Cannot check from a login node&amp;quot;&lt;br /&gt;
        #return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        checker=checkjob&lt;br /&gt;
        label=AName&lt;br /&gt;
&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        checker=&amp;quot;llq -l&amp;quot;&lt;br /&gt;
        label=&amp;quot;Job Name&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for j in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        echo -n &amp;quot;$j &amp;quot; &amp;amp;&amp;amp; $checker &amp;quot;$j&amp;quot; | grep &amp;quot;$label&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ whatare&lt;br /&gt;
-----------RUNNING-----------&lt;br /&gt;
# job information about running jobs&lt;br /&gt;
-----------WAITING-----------&lt;br /&gt;
# job information about waiting jobs&lt;br /&gt;
-----------BLOCKED-----------&lt;br /&gt;
# job information about blocked jobs&lt;br /&gt;
=============================&lt;/div&gt;</summary>
		<author><name>Ashwin</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9147</id>
		<title>User Remote</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9147"/>
		<updated>2018-02-09T15:32:07Z</updated>

		<summary type="html">&lt;p&gt;Ashwin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Step 0: Some SSH Aliases to Make Life Easier==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function p7() {&lt;br /&gt;
    ssh p7n01-ib0 &amp;quot;$@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function gpc() {&lt;br /&gt;
    ssh gpc01 &amp;quot;$@&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Submitting jobs==&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;qsub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llsubmit&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function submit() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Can't submit from a login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC &lt;br /&gt;
        submitter=qsub&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        submitter=llsubmit&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    for fpath in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $submitter &amp;quot;$fpath&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.sh job2.sh job3.sh&lt;br /&gt;
&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ submit job*.sh&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.ll job2.ll job3.ll&lt;br /&gt;
&lt;br /&gt;
ashwin@ashwin@p7n01 $ submit job*.ll&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Canceling jobs==&lt;br /&gt;
&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;canceljob&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llcancel&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function cancel() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    &lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Cannot cancel from Login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC&lt;br /&gt;
        canceler=canceljob&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        canceler=llcancel&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for jid in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $canceler &amp;quot;$jid&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remote/Batch query running jobs==&lt;br /&gt;
The GPC and P7 queues may be queried for job status (respectively, with &amp;lt;tt&amp;gt;showq&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llq&amp;lt;/tt&amp;gt;). However, this shows only the job ID and not much else. The following bash functions list the running and queued jobs in much more detail&lt;br /&gt;
&lt;br /&gt;
===Querying multiple queues===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function que() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        p7 que&lt;br /&gt;
        echo &amp;quot;========================================&amp;quot;&lt;br /&gt;
        gpc que&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        showq -u &amp;quot;$USER&amp;quot;&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        llq -u &amp;quot;$USER&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Getting detailed job information from queues===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function columnize() {&lt;br /&gt;
    array=$1&lt;br /&gt;
    (for lineno in `seq 0 ${#lines[@]}`; do&lt;br /&gt;
        line=${lines[lineno]}&lt;br /&gt;
        echo &amp;quot;$line&amp;quot;&lt;br /&gt;
    done) | column -t&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function clearLines() {&lt;br /&gt;
    for _ in `seq 1 $1`; do&lt;br /&gt;
        echo -ne &amp;quot;\e[1A&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function whatare() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        echo &amp;quot;============ P7 ============&amp;quot;&lt;br /&gt;
        p7 whatare&lt;br /&gt;
        echo ''&lt;br /&gt;
        echo ''&lt;br /&gt;
        echo &amp;quot;============GPC ============&amp;quot;&lt;br /&gt;
        gpc whatare&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    lines=()&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        echo &amp;quot;-----------RUNNING-----------&amp;quot;&lt;br /&gt;
        for jobid in `showq -r -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2 | tr -d '\n'`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot; | tr -d '\n'`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;-----------WAITING-----------&amp;quot;&lt;br /&gt;
        len=${#lines[@]}&lt;br /&gt;
        appendlen=$((len + 1))&lt;br /&gt;
        lines[$appendlen]=&amp;quot;-----------WAITING-----------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        for jobid in `showq -i -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;-----------BLOCKED-----------&amp;quot;&lt;br /&gt;
        len=${#lines[@]}&lt;br /&gt;
        appendlen=$((len + 1))&lt;br /&gt;
        lines[$appendlen]=&amp;quot;-----------BLOCKED-----------&amp;quot;&lt;br /&gt;
        for jobid in `showq -b -u $USER | grep $USER | cut -d' ' -f1 | sort -n`; do&lt;br /&gt;
            name=`whatis &amp;quot;$jobid&amp;quot; | grep AName | cut -d&amp;quot;:&amp;quot; -f2`&lt;br /&gt;
            wtime=`checkjob &amp;quot;$jobid&amp;quot; | head | grep &amp;quot;WallTime&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
            len=${#lines[@]}&lt;br /&gt;
            clearLines $len&lt;br /&gt;
&lt;br /&gt;
            appendlen=$((len + 1))&lt;br /&gt;
            line=&amp;quot;$jobid  $name $wtime&amp;quot;&lt;br /&gt;
            lines[$appendlen]=&amp;quot;$line&amp;quot;&lt;br /&gt;
            columnize $lines&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;=============================&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        joblines=`que | tail -n +3 | head -n -2 | sort -t'.' -k2 -n`&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;---------- RUNNING ----------&amp;quot;&lt;br /&gt;
        echo &amp;quot;$joblines&amp;quot; | while read jobline; do&lt;br /&gt;
            status=`echo &amp;quot;$jobline&amp;quot; | awk '$1=$1' | cut -d' ' -f5`&lt;br /&gt;
&lt;br /&gt;
            if [[ $status != R ]] ; then&lt;br /&gt;
                continue&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            job=`echo $jobline | cut -d' ' -f1 | cut -d'.' -f2`&lt;br /&gt;
            echo -n `whatis &amp;quot;$job&amp;quot; | grep &amp;quot;Job Name&amp;quot;` &amp;amp;&amp;amp; echo&lt;br /&gt;
        done&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;---------- WAITING ----------&amp;quot;&lt;br /&gt;
&lt;br /&gt;
        echo &amp;quot;$joblines&amp;quot; | while read jobline; do&lt;br /&gt;
            status=`echo &amp;quot;$jobline&amp;quot; | awk '$1=$1' | cut -d' ' -f5`&lt;br /&gt;
&lt;br /&gt;
            if [[ $status != I ]] ; then&lt;br /&gt;
                continue&lt;br /&gt;
            fi&lt;br /&gt;
&lt;br /&gt;
            job=`echo $jobline | cut -d' ' -f1 | cut -d'.' -f2`&lt;br /&gt;
            echo -n `whatis &amp;quot;$job&amp;quot; | grep &amp;quot;Job Name&amp;quot;` &amp;amp;&amp;amp; echo&lt;br /&gt;
        done&lt;br /&gt;
        echo &amp;quot;=============================&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function whatis() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    if [ $host -eq 0 ]; then&lt;br /&gt;
        echo &amp;quot;Cannot check from a login node&amp;quot;&lt;br /&gt;
        #return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  #GPC&lt;br /&gt;
        checker=checkjob&lt;br /&gt;
        label=AName&lt;br /&gt;
&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        checker=&amp;quot;llq -l&amp;quot;&lt;br /&gt;
        label=&amp;quot;Job Name&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for j in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        echo -n &amp;quot;$j &amp;quot; &amp;amp;&amp;amp; $checker &amp;quot;$j&amp;quot; | grep &amp;quot;$label&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ashwin</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9146</id>
		<title>User Remote</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9146"/>
		<updated>2018-02-09T15:25:16Z</updated>

		<summary type="html">&lt;p&gt;Ashwin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Submitting jobs==&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;qsub&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llsubmit&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function submit() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Can't submit from a login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC &lt;br /&gt;
        submitter=qsub&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        submitter=llsubmit&lt;br /&gt;
    fi  &lt;br /&gt;
&lt;br /&gt;
    for fpath in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $submitter &amp;quot;$fpath&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.sh job2.sh job3.sh&lt;br /&gt;
&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ submit job*.sh&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ashwin@gpc-f101n084-ib0 $ ls&lt;br /&gt;
job1.ll job2.ll job3.ll&lt;br /&gt;
&lt;br /&gt;
ashwin@ashwin@p7n01 $ submit job*.ll&lt;br /&gt;
# submits all three job files using qsub&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Canceling jobs==&lt;br /&gt;
&lt;br /&gt;
The GPC and P7 job submission commands (&amp;lt;tt&amp;gt;canceljob&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;llcancel&amp;lt;/tt&amp;gt;, respectively) do not allow for the submission of multiple job files, leaving the user to have to for-loop through multiple files when batch submission is required. The below bash function automates such looping and can be added to the shell environment&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function cancel() {&lt;br /&gt;
    host=`hostname | awk '/^scinet/ {print 0} /^gpc/ {print 1} /^p7/ {print 2}'`&lt;br /&gt;
    &lt;br /&gt;
    if [ $host -eq 0 ]; then  # Login node&lt;br /&gt;
        echo &amp;quot;Cannot cancel from Login node&amp;quot;&lt;br /&gt;
        return&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    if [ $host -eq 1 ]; then  # GPC&lt;br /&gt;
        canceler=canceljob&lt;br /&gt;
    elif [ $host -eq 2 ]; then  # P7&lt;br /&gt;
        canceler=llcancel&lt;br /&gt;
    fi&lt;br /&gt;
&lt;br /&gt;
    for jid in &amp;quot;$@&amp;quot;; do&lt;br /&gt;
        $canceler &amp;quot;$jid&amp;quot;&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remote/Batch query running jobs==&lt;/div&gt;</summary>
		<author><name>Ashwin</name></author>
	</entry>
	<entry>
		<id>https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9144</id>
		<title>User Remote</title>
		<link rel="alternate" type="text/html" href="https://oldwiki.scinet.utoronto.ca/index.php?title=User_Remote&amp;diff=9144"/>
		<updated>2018-02-09T14:43:38Z</updated>

		<summary type="html">&lt;p&gt;Ashwin: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__FORCETOC__&lt;br /&gt;
&lt;br /&gt;
==Remote submitting jobs==&lt;br /&gt;
&lt;br /&gt;
==Remote cancel jobs==&lt;br /&gt;
&lt;br /&gt;
==Remote query running jobs==&lt;br /&gt;
&lt;br /&gt;
Lorem Ipsum&lt;/div&gt;</summary>
		<author><name>Ashwin</name></author>
	</entry>
</feed>