Add test sim for interaction between data recording and checkpointing (#1398)

* Add test sim and documentation for interaction between data recording and checkpointing
* Dump failing logs from first phase jobs
This commit is contained in:
Jacqueline Deans 2022-11-21 11:57:19 -06:00 committed by GitHub
parent d0f679b31a
commit 1b394e9386
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 616 additions and 7 deletions

View File

@ -417,4 +417,16 @@ GROUP "/" {
} }
``` ```
### Interaction with Checkpoints
Data recording groups are able to be checkpointed, reloaded, and restarted without any interaction by the user. When a checkpoint is loaded that includes data recording,
the data recording groups will be initiated and begin recording at the time in the checkpoint. For example, if a checkpoint was dumped when t=5, when the checkpoint is
loaded into another run, it will data record starting at t=5, no matter what time in the run it was loaded or whether the run was already data recording. Loading a checkpoint
will overwrite any data recording files that were being recorded before the load.
Loading a checkpoint with different data recording groups than the current run will overwrite the current data recording groups.
Refer to test/SIM_checkpoint_data_recording to see expected behavior in action. Overall, the loading a checkpoint should completely overwrite any other data recording the sim is currently doing, and the new recording will start at the time in the checkpoint. If you come across different behavior, please open an issue.
[Continue to Checkpointing](Checkpoints) [Continue to Checkpointing](Checkpoints)

View File

@ -0,0 +1,18 @@
global DR_GROUP_ID
global drg
try:
if DR_GROUP_ID >= 0:
DR_GROUP_ID += 1
except NameError:
DR_GROUP_ID = 0
drg = []
drg.append(trick.DRAscii("anotherfoo"))
drg[DR_GROUP_ID].set_freq(trick.DR_Always)
drg[DR_GROUP_ID].set_cycle(0.1)
drg[DR_GROUP_ID].set_single_prec_only(False)
drg[DR_GROUP_ID].add_variable("testSimObject.name")
drg[DR_GROUP_ID].add_variable("testSimObject.my_foo.b")
drg[DR_GROUP_ID].set_max_file_size(1 * 1073741824) # multiply converts GiB to B --Dr. Dre
trick.add_data_record_group(drg[DR_GROUP_ID], trick.DR_Buffer)
drg[DR_GROUP_ID].enable()

View File

@ -0,0 +1,18 @@
global DR_GROUP_ID
global drg
try:
if DR_GROUP_ID >= 0:
DR_GROUP_ID += 1
except NameError:
DR_GROUP_ID = 0
drg = []
drg.append(trick.DRAscii("foo"))
drg[DR_GROUP_ID].set_freq(trick.DR_Always)
drg[DR_GROUP_ID].set_cycle(0.1)
drg[DR_GROUP_ID].set_single_prec_only(False)
drg[DR_GROUP_ID].add_variable("testSimObject.my_foo.a")
drg[DR_GROUP_ID].add_variable("testSimObject.my_foo.b")
drg[DR_GROUP_ID].set_max_file_size(1 * 1073741824) # multiply converts GiB to B --Dr. Dre
trick.add_data_record_group(drg[DR_GROUP_ID], trick.DR_Buffer)
drg[DR_GROUP_ID].enable()

View File

@ -0,0 +1,17 @@
global DR_GROUP_ID
global drg
try:
if DR_GROUP_ID >= 0:
DR_GROUP_ID += 1
except NameError:
DR_GROUP_ID = 0
drg = []
drg.append(trick.DRAscii("foo2"))
drg[DR_GROUP_ID].set_freq(trick.DR_Always)
drg[DR_GROUP_ID].set_cycle(1)
drg[DR_GROUP_ID].set_single_prec_only(False)
drg[DR_GROUP_ID].add_variable("testSimObject.my_foo.b")
drg[DR_GROUP_ID].set_max_file_size(1 * 1073741824) # multiply converts GiB to B --Dr. Dre
trick.add_data_record_group(drg[DR_GROUP_ID], trick.DR_Buffer)
drg[DR_GROUP_ID].enable()

View File

@ -0,0 +1,10 @@
trick.frame_log_on()
trick.real_time_enable()
trick.exec_set_software_frame(0.1)
trick.itimer_enable()
trick.exec_set_enable_freeze(True)
# trick.exec_set_freeze_command(True)
# simControlPanel = trick.SimControlPanel()
# trick.add_external_application(simControlPanel)

View File

@ -0,0 +1,39 @@
This test suite runs different data recording and checkpoint combinations in an effort to document and test expected behaviors.
RUN_test1
Checkpoint dumped at t=5 with data recording
Run started without data recording
Checkpoint loaded at t=5
Expected: log_foo.csv contains data recorded from t=5+
RUN_test2
Checkpoint dumped at t=5 without data recording
Run started with data recording
Checkpoint loaded at t=5
Expected: log_foo.csv does not exist
RUN_test3
Checkpoint dumped at t=5 with data recording
Run started with data recording
Checkpoint loaded at t=5
Expected: log_foo.csv contains data recorded from t=5+
RUN_test4
Checkpoint dumped at t=2 with data recording
Run started with data recording
Checkpoint loaded at t=5
Expected: log_foo.csv contains data recorded from t=2+
RUN_test5
Checkpoint dumped at t=7 with data recording
Run started with data recording
Checkpoint loaded at t=5
Expected: log_foo.csv contains data recorded from t=7+
RUN_test6
Checkpoint dumped at t=7 with data recording group foo2
Run started with data recording group 1
Checkpoint loaded at t=5
Expected: ?
Overall: expectation is that what loads in from the checkpoint should take precedence and overwrite the file of the same name.

View File

@ -0,0 +1,14 @@
import trick
from trick.unit_test import *
# This was just here for convenience to dump the checkpoints.
def main():
exec(open("Modified_data/foo.dr").read())
trick.checkpoint(5.0)
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,10 @@
def main():
exec(open("Modified_data/realtime.py").read())
trick.exec_set_software_frame(0.10)
trick.exec_set_freeze_frame(0.10)
trick.stop(5.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,14 @@
import trick
from trick.unit_test import *
# This was just here for convenience to dump the checkpoints.
def main():
exec(open("Modified_data/foo.dr").read())
trick.checkpoint(5.0)
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,51 @@
sys.exec.out.time {s},testSimObject.my_foo.a {1},testSimObject.my_foo.b {1}
5.1,6,12
5.2,6,12
5.3,6,12
5.4,6,12
5.5,6,12
5.6,6,12
5.7,6,12
5.8,6,12
5.9,6,12
6,7,14
6.1,7,14
6.2,7,14
6.3,7,14
6.4,7,14
6.5,7,14
6.6,7,14
6.7,7,14
6.8,7,14
6.9,7,14
7,8,16
7.1,8,16
7.2,8,16
7.3,8,16
7.4,8,16
7.5,8,16
7.6,8,16
7.7,8,16
7.8,8,16
7.9,8,16
8,9,18
8.1,9,18
8.199999999999999,9,18
8.300000000000001,9,18
8.4,9,18
8.5,9,18
8.6,9,18
8.699999999999999,9,18
8.800000000000001,9,18
8.9,9,18
9,10,20
9.1,10,20
9.199999999999999,10,20
9.300000000000001,10,20
9.4,10,20
9.5,10,20
9.6,10,20
9.699999999999999,10,20
9.800000000000001,10,20
9.9,10,20
10,11,22
1 sys.exec.out.time {s} testSimObject.my_foo.a {1} testSimObject.my_foo.b {1}
2 5.1 6 12
3 5.2 6 12
4 5.3 6 12
5 5.4 6 12
6 5.5 6 12
7 5.6 6 12
8 5.7 6 12
9 5.8 6 12
10 5.9 6 12
11 6 7 14
12 6.1 7 14
13 6.2 7 14
14 6.3 7 14
15 6.4 7 14
16 6.5 7 14
17 6.6 7 14
18 6.7 7 14
19 6.8 7 14
20 6.9 7 14
21 7 8 16
22 7.1 8 16
23 7.2 8 16
24 7.3 8 16
25 7.4 8 16
26 7.5 8 16
27 7.6 8 16
28 7.7 8 16
29 7.8 8 16
30 7.9 8 16
31 8 9 18
32 8.1 9 18
33 8.199999999999999 9 18
34 8.300000000000001 9 18
35 8.4 9 18
36 8.5 9 18
37 8.6 9 18
38 8.699999999999999 9 18
39 8.800000000000001 9 18
40 8.9 9 18
41 9 10 20
42 9.1 10 20
43 9.199999999999999 10 20
44 9.300000000000001 10 20
45 9.4 10 20
46 9.5 10 20
47 9.6 10 20
48 9.699999999999999 10 20
49 9.800000000000001 10 20
50 9.9 10 20
51 10 11 22

View File

@ -0,0 +1,9 @@
import trick
def main():
trick.add_read(5.0, 'trick.load_checkpoint("RUN_test1/chkpnt_5.000000")') # This checkpoint has data recording
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,9 @@
FILE=log_foo.csv
if test -f "$FILE"; then
echo "$FILE exists."
exit 1
else
# Expect the file not to exist.
echo "$FILE does not exist."
exit 0
fi

View File

@ -0,0 +1,12 @@
import trick
from trick.unit_test import *
# This was just here for convenience to dump the checkpoints.
def main():
trick.checkpoint(5.0)
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,11 @@
import trick
def main():
exec(open("Modified_data/foo.dr").read())
trick.add_read(5.0, 'trick.load_checkpoint("RUN_test2/chkpnt_5.000000")') # this checkpoint does not contain data recording
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,14 @@
import trick
from trick.unit_test import *
# This was just here for convenience to dump the checkpoints.
def main():
exec(open("Modified_data/foo.dr").read())
trick.checkpoint(5.0)
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,51 @@
sys.exec.out.time {s},testSimObject.my_foo.a {1},testSimObject.my_foo.b {1}
5.1,6,12
5.2,6,12
5.3,6,12
5.4,6,12
5.5,6,12
5.6,6,12
5.7,6,12
5.8,6,12
5.9,6,12
6,7,14
6.1,7,14
6.2,7,14
6.3,7,14
6.4,7,14
6.5,7,14
6.6,7,14
6.7,7,14
6.8,7,14
6.9,7,14
7,8,16
7.1,8,16
7.2,8,16
7.3,8,16
7.4,8,16
7.5,8,16
7.6,8,16
7.7,8,16
7.8,8,16
7.9,8,16
8,9,18
8.1,9,18
8.199999999999999,9,18
8.300000000000001,9,18
8.4,9,18
8.5,9,18
8.6,9,18
8.699999999999999,9,18
8.800000000000001,9,18
8.9,9,18
9,10,20
9.1,10,20
9.199999999999999,10,20
9.300000000000001,10,20
9.4,10,20
9.5,10,20
9.6,10,20
9.699999999999999,10,20
9.800000000000001,10,20
9.9,10,20
10,11,22
1 sys.exec.out.time {s} testSimObject.my_foo.a {1} testSimObject.my_foo.b {1}
2 5.1 6 12
3 5.2 6 12
4 5.3 6 12
5 5.4 6 12
6 5.5 6 12
7 5.6 6 12
8 5.7 6 12
9 5.8 6 12
10 5.9 6 12
11 6 7 14
12 6.1 7 14
13 6.2 7 14
14 6.3 7 14
15 6.4 7 14
16 6.5 7 14
17 6.6 7 14
18 6.7 7 14
19 6.8 7 14
20 6.9 7 14
21 7 8 16
22 7.1 8 16
23 7.2 8 16
24 7.3 8 16
25 7.4 8 16
26 7.5 8 16
27 7.6 8 16
28 7.7 8 16
29 7.8 8 16
30 7.9 8 16
31 8 9 18
32 8.1 9 18
33 8.199999999999999 9 18
34 8.300000000000001 9 18
35 8.4 9 18
36 8.5 9 18
37 8.6 9 18
38 8.699999999999999 9 18
39 8.800000000000001 9 18
40 8.9 9 18
41 9 10 20
42 9.1 10 20
43 9.199999999999999 10 20
44 9.300000000000001 10 20
45 9.4 10 20
46 9.5 10 20
47 9.6 10 20
48 9.699999999999999 10 20
49 9.800000000000001 10 20
50 9.9 10 20
51 10 11 22

View File

@ -0,0 +1,12 @@
import trick
def main():
exec(open("Modified_data/foo.dr").read())
trick.add_read(5.0, 'trick.load_checkpoint("RUN_test3/chkpnt_5.000000")') # contains data recording
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,14 @@
import trick
from trick.unit_test import *
# This was just here for convenience to dump the checkpoints.
def main():
exec(open("Modified_data/foo.dr").read())
trick.checkpoint(2.0)
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,81 @@
sys.exec.out.time {s},testSimObject.my_foo.a {1},testSimObject.my_foo.b {1}
2.1,3,6
2.2,3,6
2.3,3,6
2.4,3,6
2.5,3,6
2.6,3,6
2.7,3,6
2.8,3,6
2.9,3,6
3,4,8
3.1,4,8
3.2,4,8
3.3,4,8
3.4,4,8
3.5,4,8
3.6,4,8
3.7,4,8
3.8,4,8
3.9,4,8
4,5,10
4.1,5,10
4.2,5,10
4.3,5,10
4.4,5,10
4.5,5,10
4.6,5,10
4.7,5,10
4.8,5,10
4.9,5,10
5,6,12
5.1,6,12
5.2,6,12
5.3,6,12
5.4,6,12
5.5,6,12
5.6,6,12
5.7,6,12
5.8,6,12
5.9,6,12
6,7,14
6.1,7,14
6.2,7,14
6.3,7,14
6.4,7,14
6.5,7,14
6.6,7,14
6.7,7,14
6.8,7,14
6.9,7,14
7,8,16
7.1,8,16
7.2,8,16
7.3,8,16
7.4,8,16
7.5,8,16
7.6,8,16
7.7,8,16
7.8,8,16
7.9,8,16
8,9,18
8.1,9,18
8.199999999999999,9,18
8.300000000000001,9,18
8.4,9,18
8.5,9,18
8.6,9,18
8.699999999999999,9,18
8.800000000000001,9,18
8.9,9,18
9,10,20
9.1,10,20
9.199999999999999,10,20
9.300000000000001,10,20
9.4,10,20
9.5,10,20
9.6,10,20
9.699999999999999,10,20
9.800000000000001,10,20
9.9,10,20
10,11,22
1 sys.exec.out.time {s} testSimObject.my_foo.a {1} testSimObject.my_foo.b {1}
2 2.1 3 6
3 2.2 3 6
4 2.3 3 6
5 2.4 3 6
6 2.5 3 6
7 2.6 3 6
8 2.7 3 6
9 2.8 3 6
10 2.9 3 6
11 3 4 8
12 3.1 4 8
13 3.2 4 8
14 3.3 4 8
15 3.4 4 8
16 3.5 4 8
17 3.6 4 8
18 3.7 4 8
19 3.8 4 8
20 3.9 4 8
21 4 5 10
22 4.1 5 10
23 4.2 5 10
24 4.3 5 10
25 4.4 5 10
26 4.5 5 10
27 4.6 5 10
28 4.7 5 10
29 4.8 5 10
30 4.9 5 10
31 5 6 12
32 5.1 6 12
33 5.2 6 12
34 5.3 6 12
35 5.4 6 12
36 5.5 6 12
37 5.6 6 12
38 5.7 6 12
39 5.8 6 12
40 5.9 6 12
41 6 7 14
42 6.1 7 14
43 6.2 7 14
44 6.3 7 14
45 6.4 7 14
46 6.5 7 14
47 6.6 7 14
48 6.7 7 14
49 6.8 7 14
50 6.9 7 14
51 7 8 16
52 7.1 8 16
53 7.2 8 16
54 7.3 8 16
55 7.4 8 16
56 7.5 8 16
57 7.6 8 16
58 7.7 8 16
59 7.8 8 16
60 7.9 8 16
61 8 9 18
62 8.1 9 18
63 8.199999999999999 9 18
64 8.300000000000001 9 18
65 8.4 9 18
66 8.5 9 18
67 8.6 9 18
68 8.699999999999999 9 18
69 8.800000000000001 9 18
70 8.9 9 18
71 9 10 20
72 9.1 10 20
73 9.199999999999999 10 20
74 9.300000000000001 10 20
75 9.4 10 20
76 9.5 10 20
77 9.6 10 20
78 9.699999999999999 10 20
79 9.800000000000001 10 20
80 9.9 10 20
81 10 11 22

View File

@ -0,0 +1,12 @@
import trick
def main():
exec(open("Modified_data/foo.dr").read())
trick.add_read(5.0, 'trick.load_checkpoint("RUN_test4/chkpnt_2.000000")') # contains data recording, starts at t=2
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,14 @@
import trick
from trick.unit_test import *
# This was just here for convenience to dump the checkpoints.
def main():
exec(open("Modified_data/foo.dr").read())
trick.checkpoint(7.0)
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,31 @@
sys.exec.out.time {s},testSimObject.my_foo.a {1},testSimObject.my_foo.b {1}
7.1,8,16
7.2,8,16
7.3,8,16
7.4,8,16
7.5,8,16
7.6,8,16
7.7,8,16
7.8,8,16
7.9,8,16
8,9,18
8.1,9,18
8.199999999999999,9,18
8.300000000000001,9,18
8.4,9,18
8.5,9,18
8.6,9,18
8.699999999999999,9,18
8.800000000000001,9,18
8.9,9,18
9,10,20
9.1,10,20
9.199999999999999,10,20
9.300000000000001,10,20
9.4,10,20
9.5,10,20
9.6,10,20
9.699999999999999,10,20
9.800000000000001,10,20
9.9,10,20
10,11,22
1 sys.exec.out.time {s} testSimObject.my_foo.a {1} testSimObject.my_foo.b {1}
2 7.1 8 16
3 7.2 8 16
4 7.3 8 16
5 7.4 8 16
6 7.5 8 16
7 7.6 8 16
8 7.7 8 16
9 7.8 8 16
10 7.9 8 16
11 8 9 18
12 8.1 9 18
13 8.199999999999999 9 18
14 8.300000000000001 9 18
15 8.4 9 18
16 8.5 9 18
17 8.6 9 18
18 8.699999999999999 9 18
19 8.800000000000001 9 18
20 8.9 9 18
21 9 10 20
22 9.1 10 20
23 9.199999999999999 10 20
24 9.300000000000001 10 20
25 9.4 10 20
26 9.5 10 20
27 9.6 10 20
28 9.699999999999999 10 20
29 9.800000000000001 10 20
30 9.9 10 20
31 10 11 22

View File

@ -0,0 +1,12 @@
import trick
def main():
exec(open("Modified_data/foo.dr").read())
trick.add_read(5.0, 'trick.load_checkpoint("RUN_test5/chkpnt_7.000000")') # contains data recording, starts at t=7
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,14 @@
import trick
from trick.unit_test import *
# This was just here for convenience to dump the checkpoints.
def main():
exec(open("Modified_data/foo2.dr").read())
trick.checkpoint(7.0)
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,4 @@
sys.exec.out.time {s},testSimObject.my_foo.b {1}
8,18
9,20
10,22
1 sys.exec.out.time {s} testSimObject.my_foo.b {1}
2 8 18
3 9 20
4 10 22

View File

@ -0,0 +1,13 @@
import trick
def main():
exec(open("Modified_data/foo.dr").read())
# trick.checkpoint(7.0)
trick.add_read(5.0, 'trick.load_checkpoint("RUN_test6/chkpnt_7.000000")') # contains data recording, starts at t=7
trick.stop(10.0)
if __name__ == "__main__":
main()

View File

@ -0,0 +1,16 @@
#include "sim_objects/default_trick_sys.sm"
##include "Foo.hh"
class TestSimObject : public Trick::SimObject {
public:
Foo my_foo;
TestSimObject () {
("initialization") my_foo.init ();
(1.0, "scheduled") my_foo.increment () ;
}
};
TestSimObject testSimObject;

View File

@ -0,0 +1,7 @@
TRICK_CFLAGS += -I./models
TRICK_CXXFLAGS += -I./models
clean_logs:
rm RUN_test*/log_foo*
clean: clean_logs

View File

@ -0,0 +1 @@
#include "Foo.hh"

View File

@ -0,0 +1,16 @@
class Foo {
public:
int a;
int b;
void init () {
a = 0;
b = 0;
}
void increment () {
a++;
b+=2;
}
};

View File

@ -21,8 +21,8 @@ SIM_measurement_units:
path: test/SIM_measurement_units path: test/SIM_measurement_units
SIM_parse_s_define: SIM_parse_s_define:
path: test/SIM_parse_s_define path: test/SIM_parse_s_define
# SIM_target_specific_variables: <-- This sim has to sit out on Mac until we fix the sprintf issue SIM_target_specific_variables:
# path: test/SIM_target_specific_variables path: test/SIM_target_specific_variables
SIM_test_abstract: SIM_test_abstract:
path: test/SIM_test_abstract path: test/SIM_test_abstract
SIM_test_inherit: SIM_test_inherit:
@ -233,3 +233,46 @@ SIM_test_dr:
- test/SIM_test_dr/RUN_test/log_DR_typesASCII.csv vs. test/SIM_test_dr/RUN_test/Ref_Logs/log_DR_typesASCII_Master.csv - test/SIM_test_dr/RUN_test/log_DR_typesASCII.csv vs. test/SIM_test_dr/RUN_test/Ref_Logs/log_DR_typesASCII_Master.csv
- test/SIM_test_dr/RUN_test/log_DR_bitfieldsBINARY.trk vs. test/SIM_test_dr/RUN_test/Ref_Logs/log_DR_bitfieldsBINARY.trk - test/SIM_test_dr/RUN_test/log_DR_bitfieldsBINARY.trk vs. test/SIM_test_dr/RUN_test/Ref_Logs/log_DR_bitfieldsBINARY.trk
# All the dump.py runs dump a checkpoint
# All the unit_test.py runs load that checkpoint and then compare against expected logs
SIM_checkpoint_data_recording:
path: test/SIM_checkpoint_data_recording
build_command: "trick-CP -t"
binary: "T_main_{cpu}_test.exe"
runs:
RUN_test1/dump.py:
returns: 0
RUN_test2/dump.py:
returns: 0
RUN_test3/dump.py:
returns: 0
RUN_test4/dump.py:
returns: 0
RUN_test5/dump.py:
returns: 0
# RUN_test6/dump.py:
# returns: 0
RUN_test1/unit_test.py:
returns: 0
compare:
- test/SIM_checkpoint_data_recording/RUN_test1/ref_log_foo.csv vs. test/SIM_checkpoint_data_recording/RUN_test1/log_foo.csv
RUN_test2/unit_test.py:
returns: 0
analyze: './test/SIM_checkpoint_data_recording/RUN_test2/check_log.sh'
RUN_test3/unit_test.py:
returns: 0
compare:
- test/SIM_checkpoint_data_recording/RUN_test3/ref_log_foo.csv vs. test/SIM_checkpoint_data_recording/RUN_test3/log_foo.csv
RUN_test4/unit_test.py:
returns: 0
compare:
- test/SIM_checkpoint_data_recording/RUN_test4/ref_log_foo.csv vs. test/SIM_checkpoint_data_recording/RUN_test4/log_foo.csv
RUN_test5/unit_test.py:
returns: 0
compare:
- test/SIM_checkpoint_data_recording/RUN_test5/ref_log_foo.csv vs. test/SIM_checkpoint_data_recording/RUN_test5/log_foo.csv
# RUN_test6/unit_test.py:
# returns: 0
# compare:
# - test/SIM_checkpoint_data_recording/RUN_test6/ref_log_foo2.csv vs. test/SIM_checkpoint_data_recording/RUN_test6/log_foo2.csv

View File

@ -23,13 +23,23 @@ class SimTestWorkflow(TrickWorkflow):
run_jobs = self.get_jobs(kind='run') run_jobs = self.get_jobs(kind='run')
analysis_jobs = self.get_jobs(kind='analyze') analysis_jobs = self.get_jobs(kind='analyze')
# This job dumps a checkpoint that is then read in and checked by RUN_test/unit_test.py in the same sim # This job in SIM_stls dumps a checkpoint that is then read in and checked by RUN_test/unit_test.py in the same sim
# This is a workaround to ensure that this run goes first. # This is a workaround to ensure that this run goes first.
first_phase_job = self.get_sim('SIM_stls').get_run(input='RUN_test/setup.py').get_run_job() first_phase_jobs = []
run_jobs.remove(first_phase_job) stl_dump_job = self.get_sim('SIM_stls').get_run(input='RUN_test/setup.py').get_run_job()
first_phase_jobs.append(stl_dump_job)
run_jobs.remove(stl_dump_job)
# Same with SIM_checkpoint_data_recording - half the runs dump checkpoints, the others read and verify.
# Make sure that the dump checkpoint runs go first.
num_dump_runs = int(len(self.get_sim('SIM_checkpoint_data_recording').get_runs())/2)
for i in range(num_dump_runs):
job = self.get_sim('SIM_checkpoint_data_recording').get_run(input=('RUN_test' + str(i+1) + '/dump.py')).get_run_job()
first_phase_jobs.append(job)
run_jobs.remove(job)
builds_status = self.execute_jobs(build_jobs, max_concurrent=self.cpus, header='Executing all sim builds.') builds_status = self.execute_jobs(build_jobs, max_concurrent=self.cpus, header='Executing all sim builds.')
first_phase_run_status = self.execute_jobs([first_phase_job], max_concurrent=self.cpus, header="Executing required first phase runs.") first_phase_run_status = self.execute_jobs(first_phase_jobs, max_concurrent=self.cpus, header="Executing required first phase runs.")
runs_status = self.execute_jobs(run_jobs, max_concurrent=self.cpus, header='Executing all sim runs.') runs_status = self.execute_jobs(run_jobs, max_concurrent=self.cpus, header='Executing all sim runs.')
comparison_result = self.compare() comparison_result = self.compare()
analysis_status = self.execute_jobs(analysis_jobs, max_concurrent=self.cpus, header='Executing all analysis.') analysis_status = self.execute_jobs(analysis_jobs, max_concurrent=self.cpus, header='Executing all analysis.')
@ -38,7 +48,7 @@ class SimTestWorkflow(TrickWorkflow):
self.status_summary() # Print a Succinct summary self.status_summary() # Print a Succinct summary
# Dump failing logs # Dump failing logs
jobs = build_jobs + run_jobs jobs = build_jobs + first_phase_jobs + run_jobs
for job in jobs: for job in jobs:
if job.get_status() == Job.Status.FAILED: if job.get_status() == Job.Status.FAILED:
print("Failing job: ", job.name) print("Failing job: ", job.name)