Setting MCA parameters

IBM Spectrum® MPI gives precedence to parameter values that are set by using the mpirun command. Therefore, a parameter's value that was set by using the mpirun command overrides the same parameter that was previously set as an environment variable or in a text file.

Setting MCA parameters with the mpirun command

To specify MCA parameters on the mpirun command line, use the --mca option. The basic syntax is:
mpirun --mca param_name value
In the following example, the MCA mpi_show_handle_leaks parameter is set to a value of 1 and the program a.out is run with four processes:
mpirun --mca mpi_show_handle_leaks 1 -np 4 a.out 
Note that if you want to specify a value that includes multiple words, you must surround the value in quotes so that the shell and IBM Spectrum MPI understand that it is a single value. For example:
mpirun --mca param "multiple_word_value" ...

Setting MCA parameters as environment variables

An ssh style example is:
OMPI_MCA_param="multiple_word_value"
 
A csh style example is:
setenv OMPI_MCA_param "multiple_word_value"

The way in which you specify an MCA parameter as an environment variable differs, depending on the shell that you are using.

For ssh style shells, the syntax of this example would be:
OMPI_MCA_mpi_show_handle_leaks=1
   export OMPI_MCA_mpi_show_handle_leaks
   mpirun -np 4 a.out
For csh style shells, the syntax of this example would be:
setenv OMPI_MCA_mpi_show_handle_leaks 1
   mpirun -np 4 a.out

Note that if you want to specify a value that includes multiple words, you must surround the value in quotes so that the shell and IBM Spectrum MPI understand that it is a single value.

Setting MCA parameters with a text file

MCA parameter values can be provided in a text file, called mca-params.conf. At runtime, IBM Spectrum MPI searches for the mca-params.conf file in one of the following locations, and in the following order:
  • $HOME/.openmpi/mca-params.conf: This is the user-supplied set of values, which has the highest precedence.
  • $prefix/etc/openmpi-mca-params.conf: This is the system-supplied set of values, which has a lower precedence.
The mca_param_files parameter specifies a colon-delimited path of files to search for MCA parameters. Files to the left have lower precedence, while files to the right have higher precedence.
The mca-params.conf file contains multiple parameter definitions, in which each parameter is specified on a separate line. The following example shows the mpi_show_handle_leaks parameter, as it is specified in a file:
# This is a comment
   # Set the same MCA parameter as in previous examples
   mpi_show_handle_leaks = 1

In MCA parameter files, quotes are not necessary for setting values that contain multiple words. If you include quotes in the MCA parameter file, they will be used as part of the value itself.