Remote running of job

Mikael Fredriksson mike at
Sun Jan 5 06:27:52 PST 2003

howard roark wrote:
> Hi,
> How could I ssh from machine A to machine B, run a job and return the result back to machine A?
> What I attempted was setup a ssh agent so could log into machine B without getting the passphrase prompt, then thought could pipe a command over to machine B. something like below to make it work,
> $ssh hostB | mpirun -np 2 hello
> unfortunately it just hangs there, does anyone have any idea how to achieve what I was trying to do?
> Thks for any help,
> Howard

Well, first I assume that you have already fixed so you don't have to
type in any passphrases.  Then you have at least 2 options: 

If the remote result (your machine B) is text, then you could write
something like this: 

  ssh account at remotehost "<remote commands>" | <local text processing
commands>  >  <local file name>
E.g. "ssh foo at B "w" | wc -l > w.txt" will localy (your machine A) count
the lines returned from the remote command "w" on "foo at B", and store the
result in a local file "w.txt" (your machine A).

If the result is not text, you can then store the result from the remote
command(s) on the remote machine (your machine B), and then get the
result file(s) with "scp" to the local machine (your machine A).

   scp account at remotehost:<remote file name> <your choosen local file

E.g. "scp foo at B:resultdata.dat result-from-B.dat"

This principle works for me.


More information about the Beowulf mailing list