Example
$ bsub -I hostname
Job <73> is submitted to default queue <normal>. <<Waiting for dispatch ...>>
<<Starting on lsfhost.localdomain>> n1
Example
Example
$ bsub
<<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
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!
Submitting a Serial Job Using