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
Package registry
Container registry
Model registry
Operate
Terraform modules
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
NearRealTimeCTDAS
CTDAS
Commits
9fbe70f4
Commit
9fbe70f4
authored
13 years ago
by
Peters, Wouter
Browse files
Options
Downloads
Patches
Plain Diff
latest implementation of new TM5 run mode
parent
d270e779
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
da/baseclasses/platform.py
+9
-0
9 additions, 0 deletions
da/baseclasses/platform.py
da/platform/maunaloa.py
+8
-0
8 additions, 0 deletions
da/platform/maunaloa.py
da/tm5/observationoperator.py
+12
-23
12 additions, 23 deletions
da/tm5/observationoperator.py
with
29 additions
and
23 deletions
da/baseclasses/platform.py
+
9
−
0
View file @
9fbe70f4
...
...
@@ -50,6 +50,15 @@ class PlatForm(object):
return
self
.
Version
def
ReturnBlockingFlag
(
self
):
return
""
def
ReturnQueueType
(
self
):
return
"
foreground
"
def
GetJobTemplate
(
self
,
joboptions
=
{},
block
=
False
):
"""
Returns the job template for a given computing system, and fill it with options from the dictionary provided as argument.
...
...
This diff is collapsed.
Click to expand it.
da/platform/maunaloa.py
+
8
−
0
View file @
9fbe70f4
...
...
@@ -22,6 +22,14 @@ class MaunaloaPlatForm(PlatForm):
self
.
Identifier
=
'
WU maunaloa
'
# the identifier gives the platform name
self
.
Version
=
'
1.0
'
# the platform version used
def
ReturnBlockingFlag
(
self
):
return
""
def
ReturnQueueType
(
self
):
return
"
foreground
"
def
GetJobTemplate
(
self
,
joboptions
=
{},
block
=
False
):
"""
Returns the job template for a given computing system, and fill it with options from the dictionary provided as argument.
...
...
This diff is collapsed.
Click to expand it.
da/tm5/observationoperator.py
+
12
−
23
View file @
9fbe70f4
...
...
@@ -135,6 +135,7 @@ class TM5ObservationOperator(ObservationOperator):
"""
import
subprocess
from
string
import
join
DaPlatForm
=
self
.
DaCycle
.
DaPlatForm
try
:
os
.
chdir
(
self
.
DaCycle
[
'
da.obsoperator.home
'
])
...
...
@@ -147,7 +148,7 @@ class TM5ObservationOperator(ObservationOperator):
os
.
chdir
(
tm5_dir
)
cmd
=
[
'
python
'
,
'
setup_tm5
'
,
'
-
q
'
,
self
.
RcFileName
]
cmd
=
[
'
python
'
,
'
setup_tm5
'
,
'
-
-%s
'
%
DaPlatForm
.
ReturnQueueType
()
,
self
.
RcFileName
]
msg
=
'
Starting the external TM5 setup script
'
;
logging
.
info
(
msg
)
msg
=
'
using command ... %s
'
%
join
(
cmd
)
;
logging
.
info
(
msg
)
...
...
@@ -180,6 +181,8 @@ class TM5ObservationOperator(ObservationOperator):
"""
from
da.tools.general
import
CreateLinks
DaPlatForm
=
self
.
DaCycle
.
DaPlatForm
# First reload the original tm5.rc file to get unmodified settings
dummy
=
self
.
LoadRc
(
self
.
RcFileName
)
# load the specified rc-file
...
...
@@ -189,6 +192,7 @@ class TM5ObservationOperator(ObservationOperator):
# Write a modified TM5 model rc-file in which run/break times are defined by our da system
NewItems
=
{
'
submit.options
'
:
DaPlatForm
.
ReturnBlockingFlag
()
,
self
.
timestartkey
:
self
.
DaCycle
[
'
time.sample.start
'
]
,
self
.
timefinalkey
:
self
.
DaCycle
[
'
time.sample.end
'
]
,
'
jobstep.timerange.start
'
:
self
.
DaCycle
[
'
time.sample.start
'
]
,
...
...
@@ -566,15 +570,16 @@ class TM5ObservationOperator(ObservationOperator):
"""
Method handles the case where one TM5 model instance with N tracers does the sampling of all ensemble members
"""
from
string
import
join
import
datetime
import
subprocess
import
os
DaPlatForm
=
self
.
DaCycle
.
DaPlatForm
t
arge
tdir
=
os
.
path
.
join
(
self
.
tm_settings
[
self
.
rundirkey
])
t
m5submi
tdir
=
os
.
path
.
join
(
self
.
tm_settings
[
self
.
rundirkey
])
# Go to executable directory and start the subprocess, using a new logfile
dummy
=
os
.
chdir
(
t
arge
tdir
)
msg
=
'
Changing directory to %s
'
%
t
arge
tdir
;
logging
.
debug
(
msg
)
dummy
=
os
.
chdir
(
t
m5submi
tdir
)
msg
=
'
Changing directory to %s
'
%
t
m5submi
tdir
;
logging
.
debug
(
msg
)
# Remove the tm5.ok file from a previous run, placed back only if a successful TM5 run is executed
...
...
@@ -592,25 +597,9 @@ class TM5ObservationOperator(ObservationOperator):
# An option would need to be added to force a re-compile of the TM5 code, for debugging purposes.
# file ID and names
jobid
=
'
tm5
'
jobfile
=
os
.
path
.
join
(
targetdir
,
'
jb.%s.jb
'
%
jobid
)
logfile
=
jobfile
.
replace
(
'
.jb
'
,
'
.log
'
)
nthreads
=
int
(
self
.
DaCycle
[
'
da.obsoperator.threads
'
])
jobparams
=
{
'
jobname
'
:
'
tm5
'
,
'
jobnodes
'
:
'
ncomp %d
'
%
int
(
nthreads
),
'
jobtime
'
:
'
00:30:00
'
,
'
joblog
'
:
os
.
path
.
join
(
self
.
DaCycle
[
'
dir.jobs
'
])
}
template
=
DaPlatForm
.
GetJobTemplate
(
jobparams
,
block
=
True
)
template
+=
'
cd %s
\n
'
%
targetdir
template
+=
'
%s -np %d %s tm5.rc
\n
'
%
(
self
.
tm_settings
[
'
mpirun.command
'
],
int
(
nthreads
),
self
.
Tm5Executable
,)
dummy
=
DaPlatForm
.
WriteJob
(
jobfile
,
template
,
jobid
)
submitcommand
=
self
.
tm_settings
[
'
submit.command
'
]
msg
=
'
Submitting job at %s
'
%
datetime
.
datetime
.
now
()
;
logging
.
info
(
msg
)
code
=
DaPlatForm
.
SubmitJob
(
jobfile
,
block
=
True
)
code
=
subprocess
.
call
(
submitcommand
.
split
()
)
msg
=
'
Resuming job at %s
'
%
datetime
.
datetime
.
now
()
;
logging
.
info
(
msg
)
if
not
os
.
path
.
exists
(
okfile
):
...
...
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