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
5513f99f
Commit
5513f99f
authored
14 years ago
by
Peters, Wouter
Browse files
Options
Downloads
Patches
Plain Diff
two platforms where the system is used are added here
parent
180b6ef9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
da/platform/jet.py
+71
-0
71 additions, 0 deletions
da/platform/jet.py
da/platform/maunaloa.py
+16
-0
16 additions, 0 deletions
da/platform/maunaloa.py
with
87 additions
and
0 deletions
da/platform/jet.py
0 → 100755
+
71
−
0
View file @
5513f99f
#!/usr/bin/env python
# jet.py
"""
Author : peters
Revision History:
File created on 06 Sep 2010.
"""
import
os
import
sys
import
subprocess
import
logging
from
da.baseclasses.jobcontrol
import
PlatForm
class
JetPlatForm
(
PlatForm
):
def
__init__
(
self
):
self
.
Identifier
=
'
NOAA jet
'
# the identifier gives the platform name
self
.
Version
=
'
1.0
'
# the platform version used
print
self
def
GetJobTemplate
(
self
,
joboptions
=
{}):
"""
Return the job template for a given computing system, and fill it with options from the dictionary provided as argument
"""
template
=
"""
##
\n
"""
+
\
"""
## This is a set of dummy names, to be replaced by values from the dictionary
\n
"""
+
\
"""
## Please make your own platform specific template with your own keys and place it in a subfolder of the da package.
\n
"""
+
\
"""
##
\n
"""
+
\
"""
\n
"""
+
\
"""
#$ jobname
\n
"""
+
\
"""
#$ jobaccount
\n
"""
+
\
"""
#$ jobnodes
\n
"""
+
\
"""
#$ jobtime
\n
"""
+
\
"""
#$ jobshell
\n
"""
+
\
"""
\n
"""
for
k
,
v
in
joboptions
.
iteritems
():
while
k
in
template
:
template
=
template
.
replace
(
k
,
v
)
return
template
def
SubmitJob
(
self
,
jobfile
):
"""
This method submits a jobfile to the queue, and returns the queue ID
"""
cmd
=
[
'
qsub
'
,
jobfile
]
output
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
).
communicate
()[
0
]
;
logging
.
info
(
output
)
jobid
=
output
.
split
()[
2
]
return
jobid
def
KillJob
(
self
,
jobid
):
"""
This method kills a running job
"""
output
=
subprocess
.
Popen
([
'
qdel
'
,
jobid
],
stdout
=
subprocess
.
PIPE
).
communicate
()[
0
]
;
logging
.
info
(
output
)
return
output
def
StatJob
(
self
,
jobid
):
"""
This method gets the status of a running job
"""
import
subprocess
output
=
subprocess
.
Popen
([
'
qstat
'
,
jobid
],
stdout
=
subprocess
.
PIPE
).
communicate
()[
0
]
;
logging
.
info
(
output
)
return
output
if
__name__
==
"
__main__
"
:
pass
This diff is collapsed.
Click to expand it.
da/platform/maunaloa.py
0 → 100755
+
16
−
0
View file @
5513f99f
#!/usr/bin/env python
# maunaloa.py
"""
Author : peters
Revision History:
File created on 06 Sep 2010.
"""
if
__name__
==
"
__main__
"
:
pass
\ No newline at end of file
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