着重查阅红色字体部分。
<aside>
🚧 All options:
- configfile <file_name>
Read mpiexec command line from <file_name>.
The lines of filename are command line sections of the form:
[options] executable [arguments]
The command may span multiple lines by terminating a line with '\'.
Comment lines begin with '#', and empty lines are ignored.
- optionfile <file_name>
Read mpiexec command options from <file_name>.
The lines of <file_name> are command options of the form:
[option 1] [option 2] ... [option n]
The options may span multiple lines by terminating a line with '\'.
Comment lines begin with '#' and empty lines are ignored.
Additional options may be used as part of the command line.
- n <num_processes>
-np <num_processes>
Launch the specified number of processes.
- **n *
-np ***
Launch one process on each available core. The absence of the -n option is
equivalent to -n *.
- machinefile <file_name>
Read the list of hosts from <file_name> on which to run the application.
The format is one host per line, optionally followed by the number of cores.
Comments are from '#' to end of line, and empty lines are ignored.
The -n * option uses the sum of cores in the file.
- host <host_name>
Launch the application on <host_name>.
The -n * option uses 1 core.
- hosts n host1 [m1][,mask[:group]] host2 [m2] ... hostn [mn]
Launch the application on n hosts with m(i) processes on host(i).
The number of processes on each host is optional, and defaults to 1.
The total number of processes is the sum of m1 + ... + mn.
For each process count, an optional list of affinity masks can be specified
that will assign the process to run on specific cores. The group can be
specified for systems that support > 64 logical cores.
- c <num_processes>
-cores <num_processes>
Set hosts to <num_processes> cores each. This option overrides the cores count
specified for each host by the -hosts or the -machinefile options in all sections.
- a
-affinity
Set the affinity mask to a single core for each of the launched processes,
spreading them as far as possible throughout the available cores. This is the
equivalent of using the "-affinity_layout spr:L" option.
- al <algo>[:<target>]
-al <algo>[:<stride>:<target>]
-affinity_layout <algo>[:<target>]
-affinity_layout <algo>[:<stride>:<target>]
Set the algorithm used to distribute launched processes to the compute cores,
and optionally specify the stride and the affinity target. The process
affinity is set to the specified target. Setting the stride in addition to
the target provides finer granularity (for example, "spr:P:L" will spread
processes across physical cores, and will bind each process to a single
logical core). If no stride is specified, it is assumed to be the same as the
target (for example, "seq:p" is the same as "seq:p:p"). Specifying affinity
with this option overrides any setting for the MPIEXEC_AFFINITY environment
variable.
The following table lists the values for the <algo> parameter:
Value Description
0 No affinity (overrides any setting for MPIEXEC_AFFINITY).
1 or spr Spread: Distribute the processes as far as possible. (Default)
2 or seq Sequential: Distribute the processes sequentially.
3 or bal Balanced: Distribute the processes over the available NUMA nodes.
The following table lists the values for the <target> and <stride> parameters:
Value Description
l or L Assign each process to a logical core. (Default)
p or P Assign each process to a physical core.
n or N Assign each process to a NUMA node.
- aa
-affinity_auto
affinity_auto complements affinity_layout's behavior. It targets the
case where multiple jobs are running on the same node. When it is set, mpiexec
- Reads in the affinity settings which are published by other jobs running
on the same node, and determines the cores that are in use.
- Runs the specified MPIEXEC_AFFINITY algorithm avoiding the cores that are
in use, and calculates the affinity setting for this job.
- Publishes the calculated affinity settings so that upcoming jobs can avoid
the cores that are in use.
This way, multiple jobs on the same node can use the cores in a mutually exclusive
manner.
- dir <working_directory>
-wdir <working_directory>
Set the working directory for the launched application. The directory may be
a local or remote path and may include environment variables to be expanded at
the target host. The maximum accepted length of the path is 260 characters.
- env <env_var_name> <env_var_value>
Set an environment variable for the launched application.
- genvlist <env_var_name1>[,env2,env3,...]
Pass the values of the specified environment variables to the launched
application. The list is a comma separated list of environment variables.
- exitcodes
Print the processes exit codes at the end of the run.
- priority {0-4}
Set the process startup priority class.
The priority values are: 0=idle, 1=below, 2=normal, 3=above, 4=high.
the default is -priority normal.
- p <port>
-port <port>
Specify the port that smpd is listening on.
- path <path1>[;<path2>...]
Search for the application on the specified path on the target host.
To specify multiple paths, separate paths with a semicolon ';'.
Does not replace or append the PATH environment variable.
- timeout <seconds>
Set the timeout for the job.
- job <string>
Associate the application with a job created by the Windows HPC Server.
- l
-lines
Prefix the output with the process rank.
- d [level]
-debug [level]
Print debug output to stderr. Level is: 0=none, 1=error, 2=debug 3=both.
When level is not specified '2=debug' is used.
- logFile <log file>
Redirect logs to the given file.
- genv, -gpath, -gdir, -gwdir, -ghost, -gmachinefile
These options are the global version of the corresponding option affecting all
sections of the command line.
- pwd <string>
Authenticate the user with the provided password. This option is only valid when
MS-MPI Launch Service is being used.
- saveCreds
Notify the launch service to save credentials. This option is only valid when -pwd
is provided.
After a successful invocation of saveCreds, it is not necessary to provide
the password with -pwd unless the password is changed.
- unicode
Switch mpiexec output to unicode stream. This only affects the output of mpiexec.
Unicode path and executables are supported with or without this option.
- ?
-help
Display a list of common options for mpiexec command line.
- ??
-help2
Display this help message.
- ???
-help3
List environment variables.
Examples:
Run four pi.exe processes on the local host with four cores:
mpiexec pi.exe
mpiexec -n * pi
Run one master process and three worker processes on the local host with four
cores:
mpiexec -n 1 master : worker
Run one master process and 31 worker processes on the hosts listed in the
hosts.txt file (which lists four hosts with 8 cores each):
mpiexec -gmachinefile hosts.txt -n 1 master : worker
</aside>