bswitch

Switches unfinished jobs from one queue to another.

Synopsis

bswitch [-a " application_name [([argument[,argument...]])]..."] [-J job_name] [-m host_name | -m host_group | -m compute_unit] [-q queue_name] [-u user_name | -u user_group | -u all] destination_queue [0]
bswitch destination_queue [job_ID | "job_ID[index_list]"] ...
bswitch [-h | -V]

Description

Switches one or more of your unfinished jobs to the specified queue. LSF administrators and root can switch jobs that are submitted by other users.

By default, switches one job, the most recently submitted job, or the most recently submitted job that also satisfies other specified options (-m, -q, -u, or -J). Specify 0 (zero) to switch multiple jobs.

The switch operation can be done only if a specified job is acceptable to the new queue as if it were submitted to it, and, in case the job that was dispatched to a host, if the host can be used by the new queue. If the switch operation is unsuccessful, the job stays where it is. Switched jobs use the successful application exit values (that is, the exit codes specified by the SUCCESS_EXIT_VALUES parameter) from the new queue.

If the parameter DEFAULT_USER_GROUP in the lsb.params file is defined, a job that is switched to a queue where it cannot run (without shares in a fair share queue, for example) is transferred to the default user group so the job can run.

If a switched job was not dispatched, then its behavior is as if it were submitted to the new queue in the first place.

If a switched job was dispatched, then it is controlled by the loadSched and loadStop vectors and other configuration parameters of the new queue, but its nice value and resource limits remain the same. Also, the switched job is controlled by the PRIORITY and RUN_WINDOW configuration parameters of the new queue.

Members of a chunk job can be switched to another queue. Running chunk job members are removed from the chunk and switched; all other jobs in WAIT state are requeued to PEND state. For chunk jobs in WAIT state, only the WAIT job is removed from the chunk and switched, and requeued to PEND.

The bswitch command is useful to change a job’s attributes that are inherited from the queue.

The bswitch command can switch resizable jobs between queues regardless of job state. After the job is switched, the parameters in new queue apply, including threshold configuration, run limit, CPU limit, queue-level resource requirements, and so on. Multi-phase rusage string resource requirements can be switched in the middle of a phase.

When you switch a job between fair share queues by using decayed run time to calculate dynamic priority, the decayed run time is switched. If the old queue did not decay the run time, the non-decayed run time is switched over; if the new queue does not decay run time, the undecayed run time is switched over.

When you switch a pending job to a queue with limits set by the parameter RESRSV_LIMIT in the lsb.queues file, the job’s rusage values must be within the set limits or the job cannot be switched. When you switch a running job to a queue with limits set by the parameter RESRSV_LIMIT, the job’s maximum rusage values cannot exceed the maximums set by the RESRSV_LIMIT parameter, but the job’s rusage values can be lower than the minimum values.

By default, the job's effective resource requirements are not changed when you use the bswitch command. The effective resource requirement string for scheduled jobs represents the resource requirement that is used by the scheduler to make a dispatch decision. If the BSWITCH_MODIFY_RUSAGE parameter is enabled and you run the bswitch command, the job's effective resource requirements are changed according to the new combined resource requirements.

When you switch a job that is auto-attached to a guaranteed service class, the auto-attachment is reevaluated if required.

Options

0
(Zero). Switches multiple jobs. Switches all the jobs that satisfy other specified options (-m, -q, -u, and -J).
-a "application_name(arg1[,arg2 …]) …"
Specifies an application-specific eswitch executable file that you want LSF to associate with the switch request.

This option functions the same as the bsub -a option, except that it controls eswitch files instead of esub/epsub files.

-J job_name
Switches only jobs that have the specified job name.

The job name can be up to 4094 characters long. Job names are not unique.

The wildcard character (*) can be used anywhere within a job name, but it cannot appear within an array index. For example, the pattern job* returns jobA and jobarray[1]. The *AAA*[1] pattern returns the first element in job arrays with names that contain AAA. However, the pattern job1[*] does not return anything since the wildcard is within the array index.

-m host_name | -m host_group | -m compute_unit
Switches only jobs that are dispatched to the specified host, host group, or compute unit.
-q queue_name
Switches only jobs in the specified queue.
If the job has a RUNLIMIT defined in lsb.queues, LSF will consider the new run limit while scheduling the AR jobs.
-u user_name | -u user_group | -u all
Switches only jobs that are submitted by the specified user, or all users if you specify the keyword all. To specify a Windows user account, include the domain name in uppercase letters and use a single backslash (DOMAIN_NAME\user_name) on a Windows command prompt or a double backslash (DOMAIN_NAME\\user_name) on a UNIX or Linux command line.

If you specify a user group, switches jobs submitted by all users in the group.

destination_queue
Required. Specify the queue to which the job is to be moved.
job_ID ... |"job_ID[index_list]" ...
Switches only the specified jobs.
-h
Prints command usage to stderr and exits.
-V
Prints LSF release version to stderr and exits.

Limitations

You cannot switch a LSF multicluster capability job.

See also

bhosts, bjobs, bqueues, bsub, bugroup.