Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tsurata, Aki
CTDAS
Commits
e32ff611
Commit
e32ff611
authored
Nov 09, 2018
by
brunner
Browse files
No commit message
No commit message
parent
7c9c4182
Changes
1
Hide whitespace changes
Inline
Side-by-side
da/tools/initexit.py
View file @
e32ff611
...
...
@@ -73,7 +73,7 @@ import glob
import
shutil
import
copy
import
getopt
#
import
cP
ickle
import
p
ickle
import
numpy
as
np
#from string import join
...
...
@@ -257,7 +257,7 @@ class CycleControl(dict):
filename
=
os
.
path
.
join
(
self
[
'dir.restart'
],
'randomseed_%s.pickle'
%
self
[
'time.start'
].
strftime
(
'%Y%m%d'
))
f
=
open
(
filename
,
'wb'
)
seed
=
np
.
random
.
get_state
()
#
cP
ickle.dump(seed, f, -1)
p
ickle
.
dump
(
seed
,
f
,
-
1
)
f
.
close
()
logging
.
info
(
"Saved the random seed generator values to file"
)
...
...
@@ -271,7 +271,7 @@ class CycleControl(dict):
filename
=
os
.
path
.
join
(
self
[
'dir.restart'
],
'randomseed_%s.pickle'
%
self
[
'da.restart.tstamp'
].
strftime
(
'%Y%m%d'
))
logging
.
info
(
"Retrieved the random seed generator values of last cycle from file"
)
f
=
open
(
filename
,
'rb'
)
#
seed =
cP
ickle.load(f)
seed
=
p
ickle
.
load
(
f
)
np
.
random
.
set_state
(
seed
)
f
.
close
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment