Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP XC System Software: User's Guide > Chapter 5 Submitting Jobs

Submitting a Serial Job Using LSF-HPC

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

There are various methods for submitting a serial job on the HP XC system:

  • Using the LSF bsub command alone.

  • Using the LSF bsub command in conjunction with the SLURM srun command.

  • Using the LSF bsub command in conjunction with the SLURM srun command and the LSF-SLURM External Scheduler.

  • Using the SLURM srun command alone.

These methods are explored in this section.

For most instances, the recommended method for submitting a job is to use the LSF bsub command in conjunction with the SLURM srun command.

Submitting a Serial Job with the LSF bsub Command

Use the bsub command to submit a serial job on the LSF execution host using the following format:

bsub [bsub-options ]  [ srun [srun-options]] jobname [job-options]

The bsub command launches the job.

Use the bsub command's -I option to launch an interactive serial job.

The srun command is only necessary to launch the job on the allocated node if the HP XC JOB STARTER script is not configured. to run a job on the compute nodes in the lsf partition.

The jobname argument is the name of an executable file.

The SLURM srun job launch command is only needed if the LSF-HPC JOB_STARTER script is not configured for the intended queue, but it can be used regardless of whether or not the script is configured. You can use the bqueues command to confirm whether or not the JOB_STARTER script exists; see “Notes on LSF-HPC” for information on the bqueues command.

Example 5-2 shows the submission and launch of a serial interactive job and its output.

Example 5-2 Submitting a Serial Job Using LSF-HPC

$ bsub -I srun hostname
Job <20> is submitted to default queue <normal>.
<<Waiting for dispatch ...>>
<<Starting on lsfhost.localdomain>>
n1

Example 5-3 shows the submission of an interactive serial job without the SLURM srun command and the job output.

Example 5-3 Submitting an Interactive Serial Job Using LSF-HPC only

$ bsub -I hostname
Job <73> is submitted to default queue <normal>.
<<Waiting for dispatch ...>>
<<Starting on lsfhost.localdomain>>
n1

Example 5-4 uses the LSF-SLURM External Scheduler to submit a job to run on four cores on two specific compute nodes.

Example 5-4 Submitting an Interactive Serial Job Using LSF-HPC and the LSF-SLURM External Scheduler

$ bsub -I -n4 -ext "SLURM[nodelist=n[14,16]]" srun hostname
Job <9> is submitted to default queue <normal>.
<<Waiting for dispatch ...>>
<<Starting on lsfhost.localdomain>>
n14
n14
n16
n16

Submitting a Serial Job Through SLURM only

This section describes how to build a simple hello world application, called hw_hostname, execute it on the login node, and launch it with the SLURM srun command.

The following is the C source code for this program; the file name is hw_hostname.c.

	#include <unistd.h>
	#include <stdio.h>

	int main()
	{
	  char name[100];
	  gethostname(name, sizeof(name));
	  printf("%s says Hello!\n", name);
	  return 0;
	}

The following is the command line used to compile this program:

$ cc hw_hostname.c -o hw_hostname

When run on the login node, it shows the name of the login node, n16 in this case:

$ ./hw_hostname
n16 says Hello!

When you use the srun command to submit this program, it runs on one of the compute nodes. In this instance, it runs on node n13:

$ srun ./hw_hostname
n13 says Hello!

Submitting the same program again with the srun command may run this program on another node, as shown here:

$ srun ./hw_hostname
n12 says Hello!

The srun can also be used to replicate the program on several cores. Although it is not generally useful, it illustrates the point. Here, the same program is run on 4 cores on 2 nodes.

$ srun -n4 ./hw_hostname
n13 says Hello!
n13 says Hello!
n14 says Hello!
n14 says Hello!

The output for this command could also have been 1 core on each of 4 compute nodes in the SLURM allocation.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2003 Hewlett-Packard Development Company, L.P.