我有从名称为的输入文件run_md.py
生成文件的脚本。我想使用GNU parallel在远程服务器上的多个输入文件()上执行相同的命令,并将结果传输回本地计算机。因此,我正在使用以下命令:test.dcd
test.pdb
test*.pdb
parallel --trc {.}.dcd -j 2 -S $SERVER1 './run_md.py {} 1000' ::: test*.pdb
该命令正在使用2个插槽的服务器上按预期运行。但是,文件没有传回,并且出现以下错误:
rsync: link_stat "/home/bougui/{.}.dcd" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1655) [Receiver=3.1.1]
替换字符串似乎不起作用。我该如何运作?
以下是输出parallel --version
:
GNU parallel 20130922
Copyright (C) 2007,2008,2009,2010,2011,2012,2013 Ole Tange and Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
GNU parallel comes with no warranty.
Web site: http://www.gnu.org/software/parallel
When using GNU Parallel for a publication please cite:
O. Tange (2011): GNU Parallel - The Command-Line Power Tool,
;login: The USENIX Magazine, February 2011:42-47.
该线程中报告的错误已得到修复,并且此功能与最新版本的GNU parallel(20160622)一起使用时效果很好。与Debian 8.5打包在一起的GNU并行版本20130922在使用{.}
字符串替换方面存在很多问题,如下所述:
经过更多测试,我发现在并行运行的命令中必须使用替换字符串指定输出文件。
出于测试目的,您可以在下面找到其他人可以运行的完整示例:
echo This is input_file > input_file && parallel --trc {}.out -S $SERVER1 cat {} ">"{}.out ::: input_file
上面的示例效果很好。当我如下使用替换字符串时{.}
:
echo This is input_file > input_file.in && parallel --trc {.}.out -S $SERVER1 cat {} ">"{.}.out ::: input_file
它也可以。但是,如果我未{.}.out
在命令中指定,则按如下所示并行运行:
echo This is input_file > input_file.in && parallel --trc {.}.out -S $SERVER1 cat {} ">"input_file.out ::: input_file
...我重现错误:
rsync: link_stat "/home/bouvier/{.}.out" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1655) [Receiver=3.1.1]
rsync: [Receiver] write error: Broken pipe (32)
因此,必须在并行运行的命令中指定输出文件。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句