about summary refs log tree commit diff stats
path: root/cpp/.traces/wait_for_location
blob: 2c3573782c6a23b93d418e053755cadced19e4e6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
parse/0: instruction: copy
parse/0:   ingredient: {name: "0", value: 0, type: 0, properties: ["0": "literal"]}
parse/0:   product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]}
parse/0: instruction: start-running
parse/0:   ingredient: {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]}
parse/0: instruction: wait-for-location
parse/0:   ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]}
parse/0: instruction: copy
parse/0:   ingredient: {name: "1", value: 0, type: 1, properties: ["1": "integer"]}
parse/0:   product: {name: "2", value: 0, type: 1, properties: ["2": "integer"]}
parse/0: instruction: copy
parse/0:   ingredient: {name: "34", value: 0, type: 0, properties: ["34": "literal"]}
parse/0:   product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]}
after-brace/0: recipe f1
after-brace/0: copy ...
after-brace/0: start-running ...
after-brace/0: wait-for-location ...
after-brace/0: copy ...
after-brace/0: recipe f2
after-brace/0: copy ...
new/0: routine allocated memory from 1000 to 101000
schedule/0: f1
run/0: instruction f1/0
run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy {name: "0", value: 0, type: 0, properties: ["0": "literal"]}
run/0: ingredient 0 is 0
mem/0: storing 0 in location 1
run/0: instruction f1/1
run/0: start-running {name: "f2", value: 0, type: 0, properties: ["f2": "recipe"]}
run/0: ingredient 0 is f2
new/0: routine allocated memory from 101000 to 201000
run/0: instruction f1/2
run/0: wait-for-location {name: "1", value: 1, type: 1, properties: ["1": "integer"]}
run/0: waiting for 1 to change from 0
schedule/0: f2
run/0: instruction f2/0
run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- copy {name: "34", value: 34, type: 0, properties: ["34": "literal"]}
run/0: ingredient 0 is 34
mem/0: storing 34 in location 1
schedule/0: waking up routine
schedule/0: f1
run/0: instruction f1/3
run/0: {name: "2", value: 2, type: 1, properties: ["2": "integer"]} <- copy {name: "1", value: 1, type: 1, properties: ["1": "integer"]}
run/0: ingredient 0 is 1
mem/0: location 1 is 34
mem/0: storing 34 in location 2
openstruct import OpenStruct TESTDIR = realpath(join(dirname(__file__), 'testdir')) #TESTDIR = "/usr/sbin" class Test1(unittest.TestCase): def test_loader(self): loader = Loader() fm = OpenStruct(loader=loader) SettingsAware.settings = Fake() FileManagerAware.fm = fm # initially, the loader has nothing to do self.assertFalse(loader.has_work()) dir = Directory(TESTDIR) self.assertEqual(None, dir.files) self.assertFalse(loader.has_work()) # Calling load_content() will enqueue the loading operation. # dir is not loaded yet, but the loader has work dir.load_content(schedule=True) self.assertEqual(None, dir.files) self.assertTrue(loader.has_work()) iterations = 0 while loader.has_work(): iterations += 1 loader.work() #print(iterations) self.assertNotEqual(None, dir.files) self.assertFalse(loader.has_work()) # # def test_get_overhead_of_loader(self): # N = 5 # tloader = benchmark_load(N) # traw = benchmark_raw_load(N) # #traw1k = 250.0 # #traw = traw1k * N / 1000.0 # #print("Loader: {0}s".format(tloader)) # #print("Raw: {0}s".format(traw)) # self.assertTrue(tloader > traw) # overhead = tloader * 100 / traw - 100 # self.assertTrue(overhead < 2, "overhead of loader too high: {0}" \ # .format(overhead)) # #print("Overhead: {0:.5}%".format(overhead)) if __name__ == '__main__': unittest.main()