Sun MPI 4.0 User's Guide: With CRE

Specifying Where a Program Is to Run

The mprun command provides you with considerable flexibility in specifying where you want your job to run.

In cases where your specified requirements can be met by more than one node, the cluster chooses the least-loaded node, unless you have specified other sorting criteria.

Specifying the Partition

Use mprun -p to specify the partition in which you want your program to run. The partition must be in the enabled state. For example,

% mprun -p part2 a.out 

specifies that a.out is to be run in the partition part2.

The mpinfo command will tell you the names of enabled partitions in the cluster, along with other useful information about cluster resources. See "mpinfo: Configuration and Status" for a description of mpinfo.

Specifying the Cluster

By default, your job will run on the cluster where you are logged in.

If you are logged in on a machine that is connected to the Sun HPC cluster on which you want to run your job, but is not part of the cluster, use mprun -c cluster_name to specify the cluster.


Note -

Use the hostname of the cluster's master node as the cluster name. You can find the cluster's master node by running mpinfo -C on any node in the cluster. See "Specifying the Partition" for additional details.


Controlling Process Spawning

Specify the Number of Processes

Use the -np option to specify the number of processes you want to start; the default is 1. This option is typically used with a Sun MPI program.

For example,

% mprun -p part2 -np 4 a.out

specifies that you want four copies of a.out to start on the nodes of the partition named part2.

You can also specify 0 as the -np value. The CRE will start one process per CPU on each available CPU. Thus, if the partition part2 has six available CPUs, the command

% mprun -p part2 -np 0 a.out

will start six copies of a.out.

Limit to One Process Per Node

Use the -Ns option to limit the number of processes to one per node. This prevents nodes from spawning more processes regardless of the number of CPUs they have.

When Number of Processes Exceeds Number of CPUs

When you request multiple processes (via the -np option), the CRE attempts to start one process per CPU. If you request more processes than the number of available CPUs, you must include either the -W or -S option. Otherwise, mprun will fail.

Use the -W option if you want the processes to wrap--that is, to allocate multiple processes to each CPU, which will execute their respective sets of processes one by one. For example, if the partition part2 has six available CPUs and you specify

% mprun -p part2 -np 10 -W a.out

the CRE will start 10 processes on the six CPUs.


Note -

When the CRE wraps processes, it distributes them according to load-balancing rules. Therefore, you will not be able to predict where they will execute.


If you prefer to have a certain number of processes started, but are willing to settle for however many CPUs are available, use the -S option. The CRE will start one process on each available CPU. Thus, if you issue the same command as above, but substitute -S for -W:

% mprun -p part2 -np 10 -S a.out

and six CPUs are available on part2, then six copies of a.out will start, one per CPU.


Note -

If you specify -np number, but not -np 0, -S, or -W, and there are not enough nodes within the partition, the CRE will look for nodes outside the partition to make up the difference. To be elegible, an external node must be both enabled and independent. That is, the node must not be a member of another partition that is enabled. If you specify -np 0, -S, or -W, the search will be restricted to the partition you are in.