I'm using OpenMPI and mpirun, and my MPI processes are divided among multiple Docker containers. Each Docker container is running its own process that has an environment variable, say, FOO
, where $FOO
(i.e. its value) differs depending on the container. The process running in the master node is the one that calls the mpirun
. Is there a way for me to get each worker node to have FOO
set in its MPI process in the mpirun command?
My question is different from this one in that the values of the environment variables may differ from container to container. Using -x
in the mpirun command exports the master node's value for the environment variable, so that doesn't work for what I'm trying to do.
edit: revised to clarify based on the comment
unset FOO
before invokingmpirun
, that might be enough for you (mpirun
will no more "export" theFOO
environment variable to the MPI tasks, and hence might leave a chance for them to get the value that was already set I do not know how. – Gilles Gouaillardet