Commit 5a77d436 authored by Carla Goncalves Ourofino's avatar Carla Goncalves Ourofino
Browse files

Merge branch 'newFeature/SOMA-1281-action-terminate-pbs' into 'master'

Adicionando a acao de terminate ao driver pbs

See merge request !24
parents 24f2c711 d1a6e197
......@@ -10,6 +10,7 @@ local cmds = {
nodeinfo = "pbsnodes -a ",
qsub = "qsub ",
qstat = "qstat -fx ",
qdel = "qdel "
}
--- Type of the SGA, returned to the server during registration.
......@@ -168,7 +169,25 @@ local function get_mem(minfo)
end
pbs.actions = {
-- Terminates a command
-- @param job The job object
terminate = function(self, job)
local data, err = job.data.squeue_data
if not data then
data, err = qstat(self, job)
if not data then
return nil, err
end
end
local state = pbs_to_sga_state[data.Job.job_state]
if state ~= "FINISHED" then
self.exec:run(cmds.qdel..job.data.pbsjid)
job.data.killed = true
return true
else
return false, "Job is not running"
end
end,
-- Gets a command current status
-- @param job The job object
-- @return A table with information for each command component (process)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment