具有可变资源请求的 PBS 指令

PBS directive with variable resource request

我使用 shell 脚本通过在循环内调用 qsub 在计算集群上启动多个作业。我使用循环为每个作业赋予不同的起始值。当我从命令行 运行 时,我想通过简单地将一个数字传递给 shell 脚本来指定要请求的每个作业的核心数。例如

./lauchJobs.sh 8

将启动每个节点请求 8 个内核的作业。我试图用

来做到这一点
#!/bin/tcsh
#check that all input arguments are there
if ($# != 3) then
    echo "This script requires three input arguments: (i) number of cores per job, (ii) starting guessNum, (iii) ending guessNum"
else
    foreach iNum (`seq  1 `) #loop over guess numbers
        qsub  -v iGuess=${iNum} estimate.pbs
    end
endif

(是的,从技术上讲,我的第一个示例应该类似于 ./launchJobs.sh 8 1 50,因为我希望有三个参数)

并且estimate.pbs开始于

#!/bin/tcsh 
#PBS -l pmem=1gb,nodes=1:ppn=${nCores},walltime=60:00:00 

问题是 ${nCores} 没有解析为我从 shell 脚本传递的值,因为它在 PBS 指令中。

是否可以编写一个脚本文件和 PBS 文件,允许我通过将其传递给脚本来指定要请求的内核数,如 ./lauchJobs.sh 8

您不必在 estimate.pbs 中指定 nodes=1:ppn=${nCores}

你也可以这样调用qsub:

qsub -l nodes=1:ppn= -v iGuess=${iNum} estimate.pbs