我可以在我的机器上运行并行。我查找了在远程机器上运行 Parallel 的情况,我发现了这个语法:
parallel –S 16/node1,16/node2,16/node3,16/node4 –-workdir . ./ B1_rosettaCM_singletarget.sh {}
::: {1..48}
但是,他们说这是无密码登录,我没有设置。我想知道如何更改此语法以在我的远程计算机(我有 Linux 登录名/密码)上运行 bash 脚本。工作目录是什么?
这也适用于 Mac 吗?我是否需要在 Linux 机器上以相同的路径安装我正在运行的软件,或者 Parallel 会负责吗? mac 怎么样?
最佳答案
I can run Parallel on my machine fine. I looked up running Parallel on a remote machine, I found this syntax:
parallel –S 16/node1,16/node2,16/node3,16/node4 –-workdir . ./ B1_rosettaCM_singletarget.sh {} ::: {1..48}
此语法错误 - 可能是由于字处理器“修复”了格式。应该是:
parallel –S 16/node1,16/node2,16/node3,16/node4 --workdir . ./B1_rosettaCM_singletarget.sh {} ::: {1..48}
However, they state it's for passwordless log in, which I don't have set up.
您可以通过多种方式进行设置:
ssh 代理。这是最好的方法。看看如何https://www.cs.utah.edu/~bigler/code/sshkeys.html (第 1 步和第 2 步)和 https://oletange.wordpress.com/2016/05/22/ssh-agent-in-new-terminal-window/
没有密码的 ssh key 。请参阅:http://www.linuxproblem.org/art_9.html
sshpass。
SSHPASS=$(ssh-askpass) parallel --ssh 'sshpass ssh'
What is the workdir?
来自 man parallel
:
The special mydir value . uses the current
working dir. If the current working dir is
beneath your home dir, the value . is treated
as the relative path to your home dir. This
means that if your home dir is different on
remote computers (e.g. if your login is
different) the relative path will still be
relative to your home dir.
Will this work on a mac as well?
是的。
Do I need to install the software I'm running in identical path on the Linux machine, or does Parallel take care of that?
如果远程系统上安装了 GNU Parallel,它会自动计算核心数(因此不需要 16/
)。它不需要在相同的路径中,而只是在您的路径中的某个位置。 GNU Parallel 不会处理这个问题。
How about the mac?
同样适用于mac。
GNU Parallel 并未在 mac 上进行密集测试,因此如果您发现某些东西可以在 GNU/Linux 上运行,但在 mac 上不起作用,您应该随时提交错误报告。
关于linux - 在 linux 和 mac 机器上通过 ssh 登录运行 GNU Parallel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49261520/