Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Summa Actors
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package 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
Numerical_Simulations_Lab
Actors
Summa Actors
Commits
2b0dfb5f
Commit
2b0dfb5f
authored
11 months ago
by
Christopher Baker
Browse files
Options
Downloads
Patches
Plain Diff
added rollback so indecies of summa_struct can be rewriten when partition is full (not 100% stable)
parent
cb5ac757
No related branches found
No related tags found
1 merge request
!8
reimplmented checkpoining based on work from the main-chris branch. restart...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
build/source/file_access_actor/file_access_actor.cpp
+2
-2
2 additions, 2 deletions
build/source/file_access_actor/file_access_actor.cpp
build/source/hru_actor/hru_actor.cpp
+5
-3
5 additions, 3 deletions
build/source/hru_actor/hru_actor.cpp
with
7 additions
and
5 deletions
build/source/file_access_actor/file_access_actor.cpp
+
2
−
2
View file @
2b0dfb5f
...
@@ -178,7 +178,7 @@ behavior file_access_actor(stateful_actor<file_access_state>* self,
...
@@ -178,7 +178,7 @@ behavior file_access_actor(stateful_actor<file_access_state>* self,
self
->
state
.
file_access_timing
.
updateEndPoint
(
"write_duration"
);
self
->
state
.
file_access_timing
.
updateEndPoint
(
"write_duration"
);
},
},
[
=
]
(
write_restart
,
int
gru
,
int
gru_timestep
,
int
gru_checkpoint
,
int
year
,
int
month
,
int
day
,
int
hour
){
[
=
]
(
write_restart
,
int
gru
,
int
gru_timestep
,
int
gru_checkpoint
,
int
output_stucture_index
,
int
year
,
int
month
,
int
day
,
int
hour
){
// update hru progress vecs
// update hru progress vecs
int
gru_index
=
abs
(
self
->
state
.
start_gru
-
gru
);
int
gru_index
=
abs
(
self
->
state
.
start_gru
-
gru
);
self
->
state
.
hru_timesteps
[
gru_index
]
=
gru_timestep
;
self
->
state
.
hru_timesteps
[
gru_index
]
=
gru_timestep
;
...
@@ -191,7 +191,7 @@ behavior file_access_actor(stateful_actor<file_access_state>* self,
...
@@ -191,7 +191,7 @@ behavior file_access_actor(stateful_actor<file_access_state>* self,
// if the slowest hru is past the ith checkpoint (current threshold)
// if the slowest hru is past the ith checkpoint (current threshold)
if
(
slowest_checkpoint
>=
(
self
->
state
.
completed_checkpoints
)){
// temp for dubuging
if
(
slowest_checkpoint
>=
(
self
->
state
.
completed_checkpoints
)){
// temp for dubuging
Output_Partition
*
output_partition
=
self
->
state
.
output_container
->
getOutputPartition
(
gru
-
1
);
Output_Partition
*
output_partition
=
self
->
state
.
output_container
->
getOutputPartition
(
gru
-
1
);
writeRestart
(
self
,
output_partition
,
self
->
state
.
start_gru
,
self
->
state
.
hru_timesteps
.
size
(),
gru_checkpoint
,
writeRestart
(
self
,
output_partition
,
self
->
state
.
start_gru
,
self
->
state
.
hru_timesteps
.
size
(),
output_stucture_index
,
year
,
month
,
day
,
hour
);
year
,
month
,
day
,
hour
);
// update checkpint counter
// update checkpint counter
self
->
state
.
completed_checkpoints
++
;
self
->
state
.
completed_checkpoints
++
;
...
...
This diff is collapsed.
Click to expand it.
build/source/hru_actor/hru_actor.cpp
+
5
−
3
View file @
2b0dfb5f
...
@@ -442,9 +442,10 @@ int Run_HRU(stateful_actor<hru_state>* self) {
...
@@ -442,9 +442,10 @@ int Run_HRU(stateful_actor<hru_state>* self) {
// send an update to the FAA
// send an update to the FAA
if
(
isCheckpoint
(
self
)){
if
(
isCheckpoint
(
self
)){
self
->
state
.
checkpoint
++
;
self
->
state
.
checkpoint
++
;
hru_writeRestart
(
&
self
->
state
.
indxHRU
,
hru_writeRestart
(
&
self
->
state
.
indxHRU
,
&
self
->
state
.
indxGRU
,
&
self
->
state
.
indxGRU
,
&
self
->
state
.
checkpoint
,
&
self
->
state
.
output_structure_step_index
,
&
self
->
state
.
output_structure_step_index
,
//unused
&
self
->
state
.
output_structure_step_index
,
//unused
self
->
state
.
hru_data
,
self
->
state
.
hru_data
,
&
self
->
state
.
err
);
&
self
->
state
.
err
);
...
@@ -454,6 +455,7 @@ int Run_HRU(stateful_actor<hru_state>* self) {
...
@@ -454,6 +455,7 @@ int Run_HRU(stateful_actor<hru_state>* self) {
self
->
state
.
refGRU
,
self
->
state
.
refGRU
,
self
->
state
.
timestep
,
self
->
state
.
timestep
,
self
->
state
.
checkpoint
,
self
->
state
.
checkpoint
,
self
->
state
.
output_structure_step_index
,
self
->
state
.
currentDate
.
y
,
self
->
state
.
currentDate
.
y
,
self
->
state
.
currentDate
.
m
,
self
->
state
.
currentDate
.
m
,
self
->
state
.
currentDate
.
d
,
self
->
state
.
currentDate
.
d
,
...
@@ -471,8 +473,8 @@ bool isCheckpoint(stateful_actor<hru_state>* self){
...
@@ -471,8 +473,8 @@ bool isCheckpoint(stateful_actor<hru_state>* self){
switch
(
self
->
state
.
restartFrequency
){
switch
(
self
->
state
.
restartFrequency
){
case
0
:
// restart not enabled
case
0
:
// restart not enabled
break
;
break
;
case
1
:
//
hourly, not supported, would need to extract minute info from hru_data
case
1
:
//
every timestep
b
re
ak
;
re
turn
true
;
case
2
:
// daily
case
2
:
// daily
if
(
self
->
state
.
startDate
.
h
==
self
->
state
.
currentDate
.
h
){
if
(
self
->
state
.
startDate
.
h
==
self
->
state
.
currentDate
.
h
){
return
true
;
return
true
;
...
...
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