Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CTDAS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tsurata, Aki
CTDAS
Commits
4be68deb
Commit
4be68deb
authored
14 years ago
by
Peters, Wouter
Browse files
Options
Downloads
Patches
Plain Diff
updated platform for interactive runs
parent
8228d2b1
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
da/baseclasses/platform.py
+9
-10
9 additions, 10 deletions
da/baseclasses/platform.py
with
9 additions
and
10 deletions
da/baseclasses/platform.py
+
9
−
10
View file @
4be68deb
...
@@ -65,15 +65,14 @@ class PlatForm(object):
...
@@ -65,15 +65,14 @@ class PlatForm(object):
return
os
.
environ
[
'
JOB_ID
'
]
return
os
.
environ
[
'
JOB_ID
'
]
def
UnsuspendCommand
(
self
):
def
UnsuspendCommand
(
self
):
return
'
qmod -usj %s
'
%
(
self
.
GetMyID
())
"""
Provide shell command to resume this job, or nothing if there is no suspension of the current job while a child process executes
"""
return
'
exit 0
'
def
SuspendJob
(
self
):
def
SuspendJob
(
self
):
"""
Method suspends the running job
"""
"""
Method suspends the running job
"""
cmd
=
[
'
qmod
'
,
'
-sj
'
,
self
.
GetMyID
()]
return
None
output
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
).
communicate
()[
0
]
;
logging
.
info
(
output
)
def
WriteJob
(
self
,
DaCycle
,
template
,
jobid
):
def
WriteJob
(
self
,
DaCycle
,
template
,
jobid
):
"""
This method writes a jobfile to the exec dir
"""
"""
This method writes a jobfile to the exec dir
"""
...
@@ -96,17 +95,17 @@ class PlatForm(object):
...
@@ -96,17 +95,17 @@ class PlatForm(object):
"""
This method submits a jobfile to the queue, and returns the queue ID
"""
"""
This method submits a jobfile to the queue, and returns the queue ID
"""
cmd
=
[
'
sh
'
,
jobfile
]
cmd
=
[
'
sh
'
,
jobfile
]
msg
=
"
A new job will be submitted (%s)
\n\n\n
"
%
cmd
;
logging
.
debug
(
msg
)
msg
=
"
A new task will be started (%s)
\n\n\n
"
%
cmd
;
logging
.
debug
(
msg
)
jobid
=
subprocess
.
call
(
cmd
)
process
=
subprocess
.
Popen
(
cmd
)
jobid
=
subprocess
.
Popen
(
cmd
).
pid
dummy
=
subprocess
.
Popen
(
cmd
).
wait
()
return
jobid
return
jobid
def
KillJob
(
self
,
jobid
):
def
KillJob
(
self
,
jobid
):
"""
This method kills a running job
"""
"""
This method kills a running job
"""
output
=
subprocess
.
Popen
([
'
qdel
'
,
jobid
],
stdout
=
subprocess
.
PIPE
).
communicate
()[
0
]
;
logging
.
info
(
output
)
return
None
return
output
def
StatJob
(
self
,
jobid
):
def
StatJob
(
self
,
jobid
):
"""
This method gets the status of a running job
"""
"""
This method gets the status of a running job
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment