Allocating CPUs as blocks for parallel jobs

Parallel jobs always ask for more than one CPU to run. Some jobs can run faster if the assigned CPUs can be allocated as blocks.

About this task

For example, parallelJobA asks for 16 CPUs in a cluster with 4 hosts and 8 slots per host. The job will have the best performance if CPUs can be allocated in groups of 4.

Note: The term slot in LSF represents the computing capacity of a host. By default, the number of CPU cores on one host is the number of slots for the host. In this topic, 1 CPU is treated as 1 slot.
Illustration of parallel job A and the cluster

Procedure

  • Method 1: The allocated slots are grouped as 4, but one host has one slot group at most.
    How to allocate CPUs as groups when one host has one slot group at most.

    Use "span[ptile=4]" syntax to achieve this allocation.

    $ bsub -n 16 -R "span[ptile=4]" ./a.out
  • Method 2: The allocated CPUs are grouped as 4. One host can have one or more CPU blocks.

    The CPU blocks are allocated with as many as possible on one host, then go to the next host.

    How to allocate as many CPU groups as possible on one host.

    Use "span[block=4]" syntax to achieve this allocation.

    $ bsub -n 16 -R "span[block=4]" ./a.out

What to do next

For more information on "span[ptile=number]" and "span[block=number]" syntax, refer to Span string.