SGE中将指定的job挂起

时光怂恿深爱的人放手 提交于 2020-01-08 21:42:48

【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>

在计算的过程中, 可能需要将某些任务暂停计算, 可以使用 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 ~]$qstat
job-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 3185678
modified hold of job 3185678
 
[testuser@login-node-1-0 ~]$ qstat
job-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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!