Intel® Math Kernel Library 2018 Update 2 Developer Guide

Setting Environment Variables on a Cluster

If you are using MPICH2 or higher or Intel MPI, to set an environment variable on the cluster, use -env, -genv, -genvlist keys of mpiexec.

See the following MPICH2 examples on how to set the value of OMP_NUM_THREADS:

mpiexec -genv OMP_NUM_THREADS 2 ....

mpiexec -genvlist OMP_NUM_THREADS ....

mpiexec -n 1 -host first -env OMP_NUM_THREADS 2 test.exe : -n 1 -host second -env OMP_NUM_THREADS 3 test.exe ....

See the following Intel MPI examples on how to set the value of MKL_BLACS_MPI:

mpiexec -genv MKL_BLACS_MPI INTELMPI ....

mpiexec -genvlist MKL_BLACS_MPI ....

mpiexec -n 1 -host first -env MKL_BLACS_MPI INTELMPI test.exe : -n 1 -host second -env MKL_BLACS_MPI INTELMPI test.exe.

When using MPICH2 or higher, you may have problems with getting the global environment, such as MKL_BLACS_MPI, by the -genvlist key. In this case, set up user or system environments on each node as follows:
From the Start menu, select Settings > Control Panel > System > Advanced > Environment Variables.

If you are using Microsoft MPI, the above ways of setting environment variables are also applicable if the Microsoft Single Program Multiple Data (SPMD) process managers are running in a debug mode on all nodes of the cluster. However, the best way to set environment variables is using the Job Scheduler with the Microsoft Management Console (MMC) and/or the Command Line Interface (CLI) to submit a job and pass environment variables. For more information about MMC and CLI, see the Microsoft Help and Support page at the Microsoft Web site (http://www.microsoft.com/).