Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] defining different values for same environment variable
From: Nicolas Deladerriere (nicolas.deladerriere_at_[hidden])
Date: 2009-02-27 12:36:05


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

I would like to set this variable with the following form :
*nicolas_at_n001 % setenv GMON_OUT_PREFIX 'gmon.out_'`/bin/uname -n`
nicolas_at_n001 % echo $GMON_OUT_PREFIX

my mpirun command looks like :
*nicolas_at_n001 % cat CLUSTER_NODES
n001 slots=1
n002 slots=1
nicolas_at_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?