本文介绍了"/bin/bash -l"无效的选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我正在尝试在超级计算机上运行掩盖为一项作业的串行MPI作业.主要的提交脚本基本上如下所示:

Well, I am trying to run serial MPI jobs masked as a one job on our supercomputer. The main submission script basically looks like that:

#!/bin/bash -l
#PBS -l nodes=4:ppn=8,walltime=24:00:00

cat $PBS_NODEFILE | uniq | tr '\\012' ' ' > tmp-$PBS_JOBID
read -a NODE < tmp-$PBS_JOBID
rm tmp-$PBS_JOBID

inode=-1
ijob=0

for ((K=1;K<=8;K++))
do
        [ $((ijob++ % 2)) -eq 0 ] && ((inode++))
        ssh ${NODE[inode]} _somepath_/RUN$K/sub.script &
done
wait
exit 0

每个子脚本如下:

#!/bin/bash -l
#PBS -l walltime=24:00:00,nodes=1:ppn=4

module load intel
module load ompi
export FORT_BUFFERED=1

*run executable*

wait
exit 0

有时我每个sub.script都会遇到一个错误(工作立即死亡):

And sometimes I encounter an error for each sub.script (jobs die immediately):

/bin/bash: -
: invalid option
Usage:  /bin/bash [GNU long option] [option] ...
        /bin/bash [GNU long option] [option] script-file ...
*etc.*

最有趣的是,这是一个随机错误,这意味着如果我第二次(或第三次等)运行相同的脚本,它将毫无问题地运行.有时候我很幸运,有时候我不是...删除-l不会有帮助,因为在那种情况下,无法加载模块,而mpirun则无法工作.有什么建议如何解决吗?

The most interesting thing is that it is a random error meaning if I run the same script for the second (or 3rd etc.) time it will run without any problems. Sometimes I'm lucky, sometimes I'm not... Removing -l won't help because in that case modules cannot be loaded and mpirun won't work. Any suggestions how to fix it?

非常感谢!

推荐答案

您的脚本中可能包含看不见的字符.可能是使用错误的字符集翻译复制/粘贴的,或者是DOS格式的.如果是后者,则可以使用tofrodos或dos2unix包进行更正.

You script probably has characters in it that you cannot see. Perhaps it was copy/pasted using the wrong character set translation or is in DOS format. In the case of the latter you can use the tofrodos or dos2unix package to correct.

无论哪种情况,您都可以在'vi'或另一个通常显示诸如^ @或^ M之类的怪异字符的应用程序中将其上拉.您可以尝试 cat -v文件名,这可能有助于查看这些奇怪之处.推送来推尝试hexdump(或hd或od).

In either case you could pull it up in 'vi' or another application which will usually show weird characters like ^@ or ^M. You could try cat -v filename which might help see these oddities. Push comes to shove try hexdump (or hd, or od).

这篇关于"/bin/bash -l"无效的选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 12:04