在计算的过程中, 可能需要将某些任务暂停计算, 可以使用 qalter 将其 "hold on"。
man qalter-h | -h {u|s|o|n|U|O|S}... Available for qsub (only -h), qrsh, qalter and qresub (hold state is removed when not set explicitly). List of holds to place on a job, a task or some tasks of a job. `u' denotes a user hold. `s' denotes a system hold. `o' denotes a operator hold. `n' denotes no hold (requires manager privileges). As long as any hold other than `n' is assigned to the job the job is not eligible for execution. Holds can be released via qalter and qrls(1). In case of qalter this is supported by the following additional option speci‐ fiers for the -h switch: `U' removes a user hold. `S' removes a system hold. `O' removes a operator hold. Sun Grid Engine managers can assign and remove all hold types, Sun Grid Engine operators can assign and remove user and operator holds, and users can only assign or remove user holds. In the case of qsub only user holds can be placed on a job and thus only the first form of the option with the -h switch alone is allowed. As opposed to this, qalter requires the second form described above. An alternate means to assign hold is provided by the qhold(1) facility. If the job is a array job (see the -t option below), all tasks specified via -t are affected by the -h opera‐ tion simultaneously. Qalter allows changing this option even while the job executes. The modified parameter will only be in effect after a restart or migration of the job, however. If this option is specified with qsub or during the submission of a job in qmon then the parameter h with the value u will be passed to the defined JSV instances indicating that the job will be in user hold after the submission finishes.
如使用命令 qalter -h u jobid
将job暂停, 并在适合的时间重新启动:
[testuser@login-node-1-0 ~]$qstatjob-ID prior name user state submit/start at queue slots ja-task-ID-----------------------------------------------------------------------------------------------------------------3185678 0.00000 test.job testuser qw 02/12/2015 10:44:09 1 [testuser@login-node-1-0 ~]$ qalter -h u 3185678modified hold of job 3185678 [testuser@login-node-1-0 ~]$ qstatjob-ID prior name user state submit/start at queue slots ja-task-ID-----------------------------------------------------------------------------------------------------------------3185678 0.00000 test.job testuser hqw 02/12/2015 10:44:09
当需要重新运行该job时, 则可以执行命令:
qalter -h U jobid