Submitting jobs with host attributes for job affinity
Use the bsub -jobaff command option to specify host attribute affinity preferences for job affinity scheduling.
Procedure
-
Use no keyword (or the attribute keyword) with the bsub
-jobaff command option to specify the host attribute affinity preferences for job
scheduling.
bsub -jobaff "[! | # | ~]attribute_name ..."
bsub -jobaff "attribute([! | # | ~]attribute_name ...)"
This specifies preferences for hosts for job scheduling based on host attributes. Use a space to separate multiple attributes. Specifying the following special characters before the attribute name indicates the following preferences:- Default (no special character): It is preferred for the selected host to have this attribute.
- !: It is preferred for the selected host to not have this attribute.
- #: It is mandatory for the selected host to have this attribute.
- ~: It is mandatory for the selected host to not have this attribute.
The following command specifies that the job must be scheduled on hosts that have the room103 attribute.bsub -jobaff "attribute(#room103)" -
Use the samehost keyword with the bsub -jobaff command
option to specify the preference for the job to run on the same host on which another job with the
specified job ID runs.
bsub -jobaff "[! | # | ~]samehost(job_id)"
The SAME_JOB_AFFINITY parameter must be set to Y or y in the lsb.params file to use the samehost keyword. The job ID can be a simple job or array job element, but you cannot specify multiple job IDs or an array job ID. Specifying the following special characters before the samehost keyword indicates the following preferences:- Default (no special character): It is preferred for the job to run on the same host on which the specified job runs.
- !: It is preferred for the job to not run on the same host on which the specified job runs.
- #: It is mandatory for the job to run on the same host on which the specified job runs.
- ~: It is mandatory for the job to not run on the same host on which the specified job runs.
The following command specifies that the job must be scheduled on hosts that are also running the job with job ID 234.bsub -jobaff "#samehost(234)" -
Use the samecu keyword with the bsub -jobaff command
option to specify the preference for the job to run on the same compute unit on which another job
with the specified job ID runs.
bsub -jobaff "[! | # | ~]samecu(job_id)"
The SAME_JOB_AFFINITY parameter must be set to Y or y in the lsb.params file to use the samecu keyword. The job ID can be a simple job or array job element, but you cannot specify multiple job IDs or an array job ID. Specifying the following special characters before the samecu keyword indicates the following preferences:- Default (no special character): It is preferred for the job to run on the same compute unit on which the specified job runs.
- !: It is preferred for the job to not run on the same compute unit on which the specified job runs.
- #: It is mandatory for the job to run on the same compute unit on which the specified job runs.
- ~: It is mandatory for the job to not run on the same compute unit on which the specified job runs.
The following command specifies that the job must not be scheduled on a host in the same compute unit that is also running the job with job ID 234.bsub -jobaff "~samecu(234)"