How IBM Platform Make works

IBM Platform Make is invoked using the lsmake command. For command syntax and complete information about command line options that control load sharing, see lsmake in the IBM Platform LSF Command Reference.

lsmake command

Attention:

The submission host is always one of the hosts selected to run the job, unless you have used -m (choose hosts by name) or -R (choose hosts with special resource requirements) to define some host selection criteria that excludes it.

Furthermore, for this command only, the resource requirement string gives precedence to the submission host when choosing the best available hosts for the job. If you define resource requirements, and the submission host meets the criteria defined in the selection string, the submission host is always selected. The order string is only used to sort the other hosts.

The following examples show how to build your software in parallel and control the execution hosts used, the number of cores used, and the number of tasks run simultaneously on one core.

% lsmake -f mymakefile

lsmake uses one core on the submission host, and runs one task at a time (one task per core). This is the default behavior.

% lsmake -R "swp > 50 && mem > 100" -f mymakefile

lsmake uses one core on the submission host or best available host that satisfies the specified resource requirements, and runs one task at a time. If there are no eligible hosts, the job fails.

By default, IBM Platform Make selects the same host type as the submitting host. This is necessary for most compilation jobs. All components must be compiled on the same host type and operating system version to run correctly. If your make task requires other resources, override the default resource requirements with -R.

% lsmake -V -j 3 -f mymakefile
[hostA] [hostD] [hostK]
<< Execute on local host >>
cc -O -c arg.c -o arg.o
<< Execute on remote host hostA >>
cc -O -c dev.c -o dev.o
<< Execute on remote host hostK >>
cc -O -c main.c -o main.o
<< Execute on remote host hostD >>
cc -O arg.o dev.o main.o

lsmake uses 3 cores, on hosts that are the same host type as the submission host. Use -V to return output as shown, including the names of the execution hosts. Use -j to specify a maximum number of cores.

If 5 cores are eligible, IBM Platform Make automatically selects 3, the submission host and the best 2 of the remaining hosts.

If only 2 cores are eligible, IBM Platform Make uses only 2 cores. At least one core is always eligible because the submission host always meets the default requirement.

% lsmake -R "swp > 50 && mem > 100" -j 3 -c 2 -f mymakefile

lsmake uses up to 3 cores, on hosts that satisfy the specified resource requirements, and starts 2 tasks on each core. If there are no eligible hosts, the job fails.

Use -c to take advantage of parallelism between the CPU and I/O on a powerful host and specify the number of concurrent jobs for each core.

% lsmake -m "hostA 2 hostB" -f mymakefile

lsmake uses 2 cores on hostA and one core on hostB, and runs one task per core. Use -m to specify exactly which hosts to use.

Use GNU make options

IBM Platform Make supports all the GNU Make command line options. See the gmake(1) man page.

Reset environment variables

By default, IBM Platform Make sets the environment variables on the execution hosts once, when you run lsmake. If your tasks overwrite files or environment variables during execution, use -E to automatically reset the environment variables for every task that executes on a remote host.

Run interactive tasks

When IBM Platform Make is running processes on more than one host, it does not send standard input to the remote processes. Most makefiles do not require any user interaction through standard I/O.

Run lsmake under LSF

Make jobs often require a lot of resources, but no user interaction. Such jobs can be submitted to LSF so that they are processed when the needed resources are available. The command lsmake includes extensions to run as a parallel batch job under LSF:

% bsub -n 10 lsmake

This command queues a IBM Platform Make job that needs 10 job slots. When all 10 slots are available, LSF starts IBM Platform Make on the first host, and passes the names of all hosts in an environment variable. IBM Platform Make gets the host names from the environment variable and uses RES to run tasks.

You can also specify a minimum and maximum number of slots to dedicate to your make job:

% bsub -n 6,18 lsmake

Because IBM Platform Make passes the suspend signal (SIGTSTP) to all its remote processes, the entire parallel make job can be suspended and resumed by the user or by LSF.

Output tagging

You can enable output tagging to prefix the sender's task ID to the parallel task data of the lsmake command. The following examples show the differences between the standard output and the tagged output of the lsmake command.

The following is the standard output from an lsmake session running in parallel:

% lsmake -j 3
echo sub1 ; sleep 1000
sub1
echo sub2 ; sleep 1000
echo sub3 ; sleep 1000
sub2
sub3

The following is the tagged output from an lsmake session running in parallel:

% lsmake -T -j 3
T1<local>: echo sub1 ; sleep 1000
T1<local>: sub1
T2<hostD>: echo sub2 ; sleep 1000
T3<hostA>: echo sub3 ; sleep 1000
T2<hostD>: sub2
T3<hostA>: sub3

The following is the tagged output from an lsmake session that includes the names of the hosts used:

% lsmake -T -V -j 3
<hostA> <hostD>
<< Execute T1 on host hostA >>
T1<local>: echo sub1 ; sleep 1000
T1<local>: sub1
<< Execute T2 on remote host hostD >>
T2<hostD>: echo sub2 ; sleep 1000
<< Execute T3 on host hostA >>
T3<hostA>: echo sub3 ; sleep 1000
T2<hostD>: sub2
T3<hostA>: sub3