## Managing Resources Abstractly

There are times when it is useful to allow requests for a particular abstract resource without regard to the specific host or system resources provided. Some examples include:

- different priorities of job, eg, low, medium, high priority
- different kinds of jobs, eg, simulation, synthesis, etc
- very particular system characteristics, eg, OS-release-level, patch-level
- node-locked software, eg, software which is only available on a certain set of hosts

To achieve this in Grid Engine, you can define any number of custom resources. You would then attach these resources to any number of queues, eg, all "high priority" queues or all queues on a host which provides a node-locked license. Then, when submitting a job, this resource can be requested and only those queues that are tagged with this resource will be candidates for running the job.
The following steps outline the procedure to attach a resource to a queue using Qmon.

1) Define the resource
In the main qmon window, click "Complexes Configuration". Highlight "queue" in the lefthand box. A list of built-in resources appears in the main window. Click "Modify". In the next screen, the resource needs to be defined. For example:

    #Name   Shortcut Type   Value   Relation Requestable Consumable Default
    #------------------------------------------------------------------------
    build   build    bool   false   ==       YES         NO         0

      Name: The name of this resource
      Shortcut: Each resource may have a unique shortcut assigned to it
      Type: The type of resource (boolean, integer, char, etc)
      Value: The default value for this resource
      Relation: == since a boolean value.
      Requestable: Allow users to request the resource
      Consumable: This resource is not consumed when requested
      Default: Not used

After adding the resource, be sure to click "Add" to add the new resource to the table below. Then click "Ok".

2) Attach the resource to specific queues
In the main qmon window, click "Queue Control". Highlight the queue that the resource should be attached to, and click "Modify".
Click on the "Complexes" tab, and then click on "Load" on the right-side of the window. A list of available resources appears. Choose or type in the new resource and click "OK". Type in 'true' for the "Value".

3) Request the resource
Any job submitted requesting this resource will be scheduled on the queues specified in the above step. To request the resource, use the -l switch:
qsub -l build=true myjob.sh
note: '-l build' is equivalent to '-l build=true'