0

我正在尝试使用 LSF 中可用的内存资源分配命令。命令的正常格式是:

bsub -R "rusage [mem=1000]" 睡眠 100 秒

当我直接从终端启动此命令时,它可以工作。当我从脚本中执行此命令时,它失败了。

这是我的脚本:

#! /bin/csh -f

set cktsim_memory = $1
set tmp = "|rusage [mem = $cktsim_memory]|" #method2
set tmp = `echo $tmp | sed 's/ =/=/g'` #method2
set tmp = `echo $tmp | sed 's/|/"/g' `
set bsub_option = ""
set bsub_option = ( "$bsub_option" "-R" "$tmp") #method2
set cmd = "bsub $bsub_option sleep 100s"
echo $cmd
$cmd

它的运行输出是:

>./cktsim_memory_test 100
bsub -R "rusage [mem= 100]" sleep 100s
Bad resource requirement syntax. Job not submitted.
>bsub -R "rusage [mem= 100]" sleep 100s
Job <99775> is submitted to default queue <medium>.

正如您在上面的终端输出中看到的那样 - 当从脚本启动 bsub 命令时,它会失败,当从终端运行相同的命令时,它是好的......

请帮我调试问题。

4

1 回答 1

0
    set cktsim_memory = $1
set temp = "'rusage [mem = $cktsim_memory]'" #method2
set temp = `echo $temp | sed 's/ =/=/g'` #method2
set bsub_option = ( "$bsub_option" "-R" "$temp")
于 2012-07-03T06:30:21.090 回答