Using the Queue

This page will describe how to set up a queue in Genesis II, and then how to use it. This tutorial assumes that you already have a bootstrapped Genesis II system. All commands are to be run from within the grid's shell.

Setting up the Queue

Creating the resource

Because we may want to setup multiple queues, it is a good idea to create a directory to house all of them:

 >mkdir /queues

Now we can actually create a queue resource:

 >cd /queues
      /containers/BootstrapContainer/Services/QueuePortType MyGreatQueue

From now on, we assume that we are in the /queues directory. You may avoid that constraint by using /queues/MyGreatQueue instead of just MyGreatQueue.

Add nodes to the Queue

Next we can link in all of the hosts into the queue. Any BES container can be used as a node for the queue. Adding them is in the form of:

 >ln /bes-containers/{BES Container Name} 
     {Path to Queue}/resources/{Name of the Node}

Let's add three of our BES containers to our queue:

 >ln /bes-containers/BootstrapContainer 
 >ln /bes-containers/ 
 >ln /bes-containers/MyLocalContainer 

Configure the Queue

You may choose to allow multiple jobs to run on a given node. By default, each node only runs one job at a time. Let's allow the queue to send 2 jobs at a time to MyLocalNode:

 >qconfigure MyGreatQueue MyLocalNode 2

Now your queue should be set up properly and is ready to run jobs.

Using the Queue

Submitting a Job

You may submit a job to the queue using the qsub tool. Here's an example:

 >qsub MyGreatQueue /home/daw9f/example-jsdl.xml

Note: The queue cannot currently accept deployments as jobs. They will submit but will sit in the queue and will never run.

Listing what is in the Queue

To see a list of what is running or queued, use:

 >qlist MyGreatQueue

Getting information about a specific Job

After performing a qlist, you will get a ticket for each job. After getting that ticket, we may find out information about a specific job using qstat:

 >qstat MyGreatQueue {TICKET}

Getting rid of finished Jobs

qlist will continue to list every submitted job until you use qcomplete. qcomplete will remove any finished jobs from the queue using the all flag, or you can remove specific finished jobs using their tickets:

 >qcomplete MyGreatQueue --all


 >qcomplete MyGreatQueue {TICKET}