Hi,
Dominik Táborský wrote:
Okay, now it's getting more confusing since I just found out that it
somehow stopped working for me!
Anyway, let's find a solution.
I found out that there is difference between
ssh node1 echo $PATH
In this case the $PATH variable is expanded by the shell *before* the
ssh executable is called
and
ssh node1 'echo $PATH'
Here path is expanded on node1
These command give you different output. 'man ssh' states that it sets
its own PATH variable right before the user logs in but after the
connection is established. This variable is set during compilation.
I am using dropbear as SSH2 server so I won't be able to guide you if
you're using OpenSSH as a server, but the manpages should be sufficient.
Look into man ssh and man ssh_config. You should create files ~/.ssh/rc
OR ~/.ssh/config OR ~/.ssh/environment. Setting it up in one of these
files should be enough.
I will probably recompile dropbear with new default PATH.
Anyway, I am sure it used to work for me and I have no idea why it
stopped.
If you'd need more help, just ask :-)
Dr. Eddy
Tomislav Maric píše v Ne 02. 08. 2009 v 18:45 +0200:
Dominik Táborský wrote:
The .bashrc on your master is not run, therefore there are no echos.
Let's revise once more so that we're sure we understand each other :-)
On your master - on the computer you run "mpirun" - you put these 2
lines into your own .bashrc:
export PATH=$PATH:/openMPI/bin
export LD_RUN_FLAG=$LD_LIBRARY_PATH:/openMPI/lib
These 2 lines are in /home/tomislav/.bashrc (supposing your user is
tomislav).
On each of your node you can leave .bashrc files. Try putting this line
in them:
echo $PATH
Again, this file is /home/tomislav/.bashrc. It must be the same file. Or
if you don't have that file on your nodes, the system-wide bashrc file
should be run, which is - I think - /etc/bash.bashrc.
Now, when you run the command:
ssh node1 echo $PATH
It should print two lines:
1st should be the executed command which should print out new PATH,
2nd should be the command in the node's .bashrc file, which should be
the reduced PATH.
Anyway, let's try something:
$ echo $PATH
$ ssh node1 echo $PATH
node1$ echo $PATH
This should print out 3 lines, your master PATH twice and then the
reduced PATH once.
Let me know how that went.
Dr. Eddy
are you sure this is the right syntax:
ssh node1 echo $PATH
?
ssh node1 echo $PATH gives me only the full PATH and doesn't log me on
to node1.
OK, here's what I've tried:
ssh node1 && echo $PATH
gives me first the $PATH on the master, and then the reduced one, as you
said.
echo $PATH
ssh node1 && echo $PATH
gives me the master $PATH twice, and then the reduced one.
At least now I know that ~/.bashrc is not being called at all. You see,
I've also tried
ssh node1
and if ssh is using non-interactive login bash, it should start a
.bashrc. If it started .bashrc on the master, it would, because of the
echo $PATH
, echo the master $PATH, and if it starts the .bashrc on the slave node,
it would echo the reduced path. Something is not right. I've even
written echo master node and echo slave node in both .bashrc and nothing
echoed.
if i try
ssh mario 'echo $PATH' i get the reduced $PATH still.
One more thing to know, I set ALL environmental variables using
OpenFOAM's bashrc script, both for OpenFOAM and OMPI, but this shouldn't
make any difference because
. $FOAM_INST_DIR/OpenFOAM-1.5-dev/etc/bashrc
script sets all the variables the right way on the master AND slave node
, meaning that I run successful serial simulations on both computers. :)
Any suggestions?
_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users
_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users