How to set environment variables on compute nodes in MPI job

I do not understand how the environment is installed on compute nodes when working with MPI in the scheduler.

I do:

mpirun -np 1 --hostfile ./hostfile foo.sh

with foo.sh:

#!/usr/bin/env zsh                                                                                                  
echo $LD_LIBRARY_PATH

Then I do not restore the LD_LIBRARY_PATH, which I have in the interactive shell ... What are the initialization files that are executed / received when connected to MPI?

note: I am under zsh and I tried putting things in .zprofile or .zshenv instead of .zshrc, but it doesn't seem to make a change ... My LD_LIBRARY_PATH is set to .profile, which is obtained from .bashrc, which is obtained using .zshrc.

+4
source share
2 answers

MPI -x mpirun , . OpenMPI:

-x <env>

. -x. . :

% mpirun -x DISPLAY -x OFILE =/tmp/out...

-x ; . , -x ( ).

, script, .

export LD_LIBRARY_PATH=...
+3

mpi, end, .

env OMP_NUM_THREADS=n PARALLEL=n mpirun -np m program.exe < input.file > output.file &

n m - .

:

env OMP_NUM_THREADS=2 PARALLEL=2 mpirun -np 12 program.exe < input.file > output.file &
0

All Articles