Limit the number of processors allocated

Use the TASKLIMIT parameter in lsb.queues or lsb.applications to limit the number of tasks that can be allocated to a parallel job.

Syntax

TASKLIMIT = [minimum_limit [default_limit]] maximum_limit

All limits must be positive numbers greater than or equal to 1 that satisfy the following relationship:

1 <= minimum <= default <= maximum

You can specify up to three limits in the TASKLIMIT parameter:

If you specify ...

Then ...

One limit

It is the maximum task limit. The minimum and default limits are set to 1.

Two limits

The first is the minimum task limit, and the second is the maximum. The default is set equal to the minimum.

The minimum must be less than or equal to the maximum.

Three limits

The first is the minimum task limit, the second is the default task limit, and the third is the maximum.

The minimum must be less than the default and the maximum.


How TASKLIMIT affects submission of parallel jobs

The -n option of bsub specifies the number of tasks to be used by a parallel job, subject to the task limits of the queue or application profile.

Jobs that specify fewer tasks than the minimum TASKLIMIT or more tasks than the maximum TASKLIMIT are rejected.

If a default value for TASKLIMIT is specified, jobs submitted without specifying -n use the default number of TASKLIMIT. If the queue or application profile has only minimum and maximum values for TASKLIMIT, the number of tasks is equal to the minimum value. If only a maximum value for TASKLIMIT is specified, or no TASKLIMIT is specified, the number of processors is equal to 1.

Incorrect task limits are ignored, and a warning message is displayed when LSF is reconfigured or restarted. A warning message is also logged to the mbatchd log file when LSF is started.

Change TASKLIMIT

If you change the TASKLIMIT parameter, the new task limit does not affect running jobs. Pending jobs with no task requirements use the new default TASKLIMIT value. If the pending job does not satisfy the new task limits, it remains in PEND state, and the pending reason changes to the following:
Job no longer satisfies TASKLIMIT configuration

If the TASKLIMIT specification is incorrect (for example, too many parameters), a reconfiguration error message is issued. Reconfiguration proceeds and the incorrect TASKLIMIT is ignored.

Resizable jobs

Resizable job allocation requests obey the TASKLIMIT definition in both application profiles and queues. When the maximum job task request is greater than the maximum task definition in TASKLIMIT, LSF chooses the minimum value of both. For example, if a job asks for -n 1,4, but TASKLIMIT is defined as 2 2 3, the maximum task request for the job is 3 rather than 4.

Automatic queue selection

When you submit a parallel job without specifying a queue name, LSF automatically selects the most suitable queue from the queues listed in the DEFAULT_QUEUE parameter in lsb.params or the LSB_DEFAULTQUEUE environment variable. Automatic queue selection takes into account any maximum and minimum TASKLIMIT values for the queues available for automatic selection.

If you specify -n min_task,max_task, but do not specify a queue, the first queue that satisfies the task requirements of the job is used. If no queue satisfies the task requirements, the job is rejected.

For example, queues with the following TASKLIMIT values are defined in lsb.queues:
  • queueA with TASKLIMIT=1 1 1

  • queueB with TASKLIMIT=2 2 2

  • queueC with TASKLIMIT=4 4 4

  • queueD with TASKLIMIT=8 8 8

  • queueE with TASKLIMIT=16 16 16

In lsb.params: DEFAULT_QUEUE=queueA queueB queueC queueD queueE

For the following jobs:

bsub -n 8 myjob

LSF automatically selects queueD to run myjob.

bsub -n 5 myjob

Job myjob fails because no default queue has the correct number of processors.

Maximum task limit

TASKLIMIT is specified in the default queue in lsb.queues as:
TASKLIMIT = 3
The maximum number of tasks that can be allocated for this queue is 3.

Example

Description

bsub -n 2 myjob

The job myjob has 2 tasks.

bsub -n 4 myjob

The job myjob is rejected from the queue because it requires more than the maximum number of tasks configured for the queue (3).

bsub -n 2,3 myjob

The job myjob runs on 2 or 3 processors.

bsub -n 2,5 myjob

The job myjob runs on 2 or 3 processors, depending on how many slots are currently available on the host.

bsub myjob

No default or minimum is configured, so the job myjob runs on 1 processor.


Minimum and maximum task limits

TASKLIMIT is specified in lsb.queues as:
TASKLIMIT = 3 8

The minimum number of tasks that can be allocated for this queue is 3 and the maximum number of tasks that can be allocated for this queue is 8.


Example

Description

bsub -n 5 myjob

The job myjob has 5 tasks.

bsub -n 2 myjob

The job myjob is rejected from the queue because the number of processors requested is less than the minimum number of processors configured for the queue (3).

bsub -n 4,5 myjob

The job myjob runs on 4 or 5 processors.

bsub -n 2,6 myjob

The job myjob runs on 3 to 6 processors.

bsub -n 4,9 myjob

The job myjob runs on 4 to 8 processors.

bsub myjob

The default number of processors is equal to the minimum number (3). The job myjob runs on 3 processors.


Minimum, default, and maximum task limits

TASKLIMIT is specified in lsb.queues as:
TASKLIMIT = 4 6 9
  • Minimum number of tasks that can be allocated for this queue is 4

  • Default number of tasks for the queue is 6

  • Maximum number of tasks that can be allocated for this queue is 9


Example

Description

bsub myjob

Because a default number of tasks is configured, the job myjob runs on 6 processors.