1

Specifically, Cray requires a special command (aprun) embedded within the qsub request to execute the job on a batch node (Cray defaults to running on login/compute nodes without the aprun syntax). When hand-keying a qsub request to Cray Linux supercomputers, the directed syntax is:

qsub <qsub parameters> -V
aprun -n #CPUS /executable.exe param1 param2 ...
Ctrl-D

Where the user provides 'return' after the -V (denoting passage of parameters in the qsub statement) and after the executable/parameter set. Ctrl-D terminates the input and executes the qsub/aprun command.

The problem is, there are a variety of ways described on the net for inputting the Ctrl-D (which simply means EOF) in a BASH script, but none of them work in the context of the qsub-embedded aprun command.

What I need to do is execute this same syntax for multiple qsub/aprun commands in a single script. How do I code this in BASH?

4

1 回答 1

1

解决方案语法是:

qsub <qsub parameters> -V <<EOF 
cd 
aprun -n #CPUS /executable.exe param1 param2 ... 
EOF 

qsub <qsub parameters> -V <<EOF 
cd 
aprun -n #CPUS /executable.exe param1 param2 ... 
EOF 

注意<<EOF(<< 和 EOF 之间没有空格) 的位置,cd在一个新行上,后跟一个带有aprun语法的换行符,EOF集合中的最后一个没有前导<<,后跟一个换行符。

此语法会将每个qsub/aprun命令执行到一个新的批处理节点作业提交中。脚本的输出将是一系列请求的作业 ID。

于 2016-11-11T15:30:27.223 回答