I am looking for a way to set
environment variable with different value on each node before running
MPI executable. (not only export the environment variable !)
Let's consider that I have cluster with two nodes (n001 and n002) and I want to set the environment variable GMON_OUT_PREFIX with different value on each node.
I would like to set this variable with
the following form :
nicolas@n001 % setenv GMON_OUT_PREFIX 'gmon.out_'`/bin/uname -n`
nicolas@n001 % echo $GMON_OUT_PREFIX
my mpirun command looks like :
nicolas@n001 % cat CLUSTER_NODES
nicolas@n001 % mpirun -np 2 --bynode --hostfile CLUSTER_NODES myexe
I would like to export the GMON_OUT_PREFIX environment variable in order to have « gmon.out_n001 » on first node and « gmon.out_n002 » on second one.
I cannot use '-x' option of mpirun
command since it is only use to export (not set) variable.
MPI executable is running on cluster nodes where HOME directory is not mounted such that I cannot use ~/.cshrc file.
Is there another way to do it?