Hoffman Queues

From Center for Cognitive Neuroscience
Jump to navigation Jump to search

Introduction

So now you're on hoffman. And you're running a script. But it's soo freaking slow. or BAM LOST CONNETION! OH NOESSS! Well don't worry! With these commands, you'll be hitting your head why you didn't check out this page earlier.

On Hoffman, when you login, you're logging in through a Login Node [only designed for login, hence login]. But in the dark backrooms, there are many many Computing Nodes [designed for computing!] To access these computing nodes, below are the commands that will let you access this enormous power. It's pretty wordy, I know. Just look at the examples, you should be smart enough to figure it out :D


Hoffman Queues (SGE)

List of SGE Commands:

#qsub Submit a Job
#qstat Determine the Status of a Job
#qdel Cancel a Job
#qhold Place a hold on a queued job to prevent it from running
#qrls Release a job held with qhold

For a more complete description of Commands: SGE Computing


qsub

The qsub command is used to submit jobs to SGE. The syntax of the qsub command is:

qsub [-cwd][-V] [-v SOME_VAR] [-o path] [-e path] [-M mail_address] [-m mail_options] [-l resources] script

Where:

  • -cwd
Directs SGE to run the job in the same directory from which you submitted it.
  • -V
Directs SGE to use the current Profile Environment from which you submitted it.
  • -v SOME_VAR
Passes environment variable SOME_VAR to the job.
  • -o path
Redirects stdout from the SGE script. The default is your home directory. Specify /dev/null to disgard SGE messages.
  • -e path
Redirects stderr from the SGE script. The default is your home directory. Specify /dev/null to disgard SGE error messages.
  • -M mail_address
where mail_address is user's email address. It is always login_id@mail on Hoffman2.
  • -m mail_options
Specifies the circumstances under which mail is to be sent to the job owner defined by -M option.
For example options "bea" mean mail is sent at the begining, end, and at abort time (if it happens) of the job. Option "n" means no mail will be sent.
  • -l resources
Specifies a list of resouces required for your job, for example memory and time per core:
-l h_data=1024M,h_rt=24:00:00 
  • script
Either the SGE command file or the script that starts up your job.


example #1

$ qsub -cwd -V -v 1 2 3 -o path -l h_data=1024M,h_rt=24:00:00 example1.sh

example1.sh

#!/bin/bash

# example1.sh
print $1 $2 $3

file [path] output

1 2 3

example #2

$ qsub example2.sh

example2.sh

#!/bin/bash
# example1.sh
# SGE COMMANDS

#$ -cwd 
#$ -o path 
#$ -V
#$ -l h_data=1024M,h_rt=24:00:00

print $1 $2 $3

file [path] output

1 2 3

qstat

The qstat command displays information about the jobs in the SGE queues, both running and waiting to run. The syntax of the qstat command is:

qstat [-f] [-j job_number] [-U login_id] [-u login_id]

where:

  • (qstat alone with no arguments)
Displays a list of all running and waiting jobs.
  • -f
Displays summary information on each queue as well as the job list.
  • -j job_number
Displays the status of the job whose job number is job_number
  • -U login_id
Displays a list of running and waiting jobs for those queues which login_id can access. Or use the groupjobs script for this information; enter groupjobs -help for usage information.
  • -u login_id
Displays a list of login_id 's running and waiting jobs. Or use the myjobs script for this information for your own login_id.

example

qstat -u username


qdel

The qdel command is used to cancel a job either while it is waiting to execute or while it is running. The syntax of the qdel command is:

qdel job_number

example

# Deletes all jobs from user
qdel -u username
# Deletes one job [11111] (Use qstat to find job ID)
qdel 11111


qhold

Place a hold on a queued job to prevent it from running. The syntax of the qhold command is:

qhold job_number


qrls

Release a job held with qhold. The syntax of the qrls command is:

qrls job_number