locked
Command line scheduler listing RRS feed

  • General discussion

  • This isn't a question, i'm just posting it out here at the suggestion of one of the HPC managers who thought it might be helpful.

    I was looking for a command line job lister that ran in real-time, much like Top for *nix.  Runs in a console session, lets me see jobs as they change, and I don't need to rerun the command (job list /state:running,queued....) over and over again.  So I wrote a script in powershell that's kind of a hack but does the trick.  Here's the code, just paste it into a .ps1 file and run it from a powershell command.  You'll need to turn on remotesigning to run it.

    $int = 1
    do {
    clear
    write-host 
    get-date
    write-host
    write-host Cluster1:
    invoke-expression "job list /user:* /state:'running,queued' /scheduler:<cluster1headnode>"
    write-host "*********"
    write-host
    write-host Cluster2:
    invoke-expression "job list /user:* /state:'running,queued' /scheduler:<cluster2headnode>"
    write-host 
    write-host Ctrl+C to break.
    start-sleep -s 5
    }
    while ($int -ne "0")

    I have two head nodes running two clusters, so I use the app to see what's running on both.  If you've only got 1, cut this part out:

    write-host Cluster2:
    invoke-expression "job list /user:* /state:'running,queued' /scheduler:cluster2headnode"
    write-host

    You can also increase the refresh time by changing the sleep timer, but any less than 5 seconds is probably a bit rough on the scheduler, and not all that necessary.

    Hope it's helpful.  Cheers.

    Tuesday, December 21, 2010 9:54 PM