-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile.rb
515 lines (446 loc) · 23.1 KB
/
Rakefile.rb
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
exp_dir = Dir.pwd + '/exp'
data_dir = Dir.pwd + '/data'
only_public = !ENV['ONLY_PUBLIC'].nil?
file "paper/cchpp.pdf" => [
"paper/cchpp.tex",
"paper/table/preprocessing.tex",
"paper/table/customization.tex",
"paper/table/queries.tex",
"paper/fig/lazy_rphast_et_vs_dfs.pdf",
"paper/fig/knn.pdf",
"paper/table/alt_stats.tex",
"paper/table/turn_opts.tex",
"paper/table/customization_ger.tex",
"paper/table/repr_knn_overview.tex",
"paper/fig/repr_knn_ball_size.pdf",
"paper/fig/repr_knn_num_pois.pdf",
"paper/fig/lazy_rphast_et_vs_dfs_ger.pdf",
"paper/fig/knn_ger.pdf",
"paper/table/turn_opts_ext.tex",
] do
Dir.chdir "paper" do
sh "latexmk -pdf cchpp.tex"
end
end
task default: "paper/cchpp.pdf"
namespace "fig" do
directory "paper/fig"
file "paper/fig/lazy_rphast_et_vs_dfs.pdf" => FileList[
"#{exp_dir}/lazy_rphast/*.json",
] + ["eval/lazy_rphast_et_vs_dfs.py", "paper/fig"] do
sh "eval/lazy_rphast_et_vs_dfs.py"
end
file "paper/fig/lazy_rphast_et_vs_dfs_ger.pdf" => FileList[
"#{exp_dir}/lazy_rphast/*.json",
] + ["eval/lazy_rphast_et_vs_dfs_ger.py", "paper/fig"] do
sh "eval/lazy_rphast_et_vs_dfs_ger.py"
end
file "paper/fig/knn.pdf" => FileList[
"#{exp_dir}/knn/num_pois/*.json",
] + ["eval/knn.py", "paper/fig"] do
sh "eval/knn.py"
end
file "paper/fig/knn_ger.pdf" => FileList[
"#{exp_dir}/knn/num_pois/*.json",
] + ["eval/knn_ger.py", "paper/fig"] do
sh "eval/knn_ger.py"
end
file "paper/fig/repr_knn_ball_size.pdf" => FileList[
"#{exp_dir}/knn/repr/ball_size/*.json",
] + ["eval/repr_knn_ball_size.py", "paper/fig"] do
sh "eval/repr_knn_ball_size.py"
end
file "paper/fig/repr_knn_num_pois.pdf" => FileList[
"#{exp_dir}/knn/repr/num_pois/*.json",
] + ["eval/repr_knn_num_pois.py", "paper/fig"] do
sh "eval/repr_knn_num_pois.py"
end
end
namespace "table" do
directory "paper/table"
file "paper/table/preprocessing.tex" => FileList[
"#{exp_dir}/preprocessing/*.json",
"#{exp_dir}/turns/preprocessing/*.json",
"#{exp_dir}/partitioning/*.out",
] + ["eval/preprocessing.py", "paper/table"] do
sh "eval/preprocessing.py"
end
file "paper/table/customization.tex" => FileList[
"#{exp_dir}/customization/*.json",
] + ["eval/customization.py", "paper/table"] do
sh "eval/customization.py"
end
file "paper/table/customization_ger.tex" => FileList[
"#{exp_dir}/customization/*.json",
] + ["eval/customization_ger.py", "paper/table"] do
sh "eval/customization_ger.py"
end
file "paper/table/queries.tex" => FileList[
"#{exp_dir}/queries/*.json",
] + ["eval/queries.py", "paper/table"] do
sh "eval/queries.py"
end
file "paper/table/turn_opts.tex" => FileList[
"#{exp_dir}/turns/partitioning/*.out",
"#{exp_dir}/turns/preprocessing/*.json",
"#{exp_dir}/turns/customization/*.json",
"#{exp_dir}/turns/queries/*.json",
] + ["eval/turn_opts.py", "paper/table"] do
sh "eval/turn_opts.py"
end
file "paper/table/turn_opts_ext.tex" => FileList[
"#{exp_dir}/turns/partitioning/*.out",
"#{exp_dir}/turns/preprocessing/*.json",
"#{exp_dir}/turns/customization/*.json",
"#{exp_dir}/turns/queries/*.json",
] + ["eval/turn_opts_ext.py", "paper/table"] do
sh "eval/turn_opts_ext.py"
end
file "paper/table/repr_knn_overview.tex" => FileList[
"#{exp_dir}/knn/repr/**/*.json",
] + ["eval/repr_knn_overview.py", "paper/table"] do
sh "eval/repr_knn_overview.py"
end
file "paper/table/alt_stats.tex" => FileList[
"#{exp_dir}/alternatives/*.json",
] + ["eval/alt.py", "paper/table"] do
sh "eval/alt.py"
end
end
osm_ger_src = 'https://download.geofabrik.de/europe/germany-200101.osm.pbf'
osm_ger_src_file = "#{data_dir}/germany-200101.osm.pbf"
osm_ger = "#{data_dir}/osm_ger/"
osm_ger_exp = "#{data_dir}/osm_ger_exp/"
live_dir = "#{data_dir}/mapbox/live-speeds/2019-08-02-15:41/"
typical_glob = "#{data_dir}/mapbox/typical-speeds/**/**/*.csv"
typical_file = "#{data_dir}/mapbox/typical-tuesday-cleaned.csv"
live_travel_time = 'live_travel_time'
dimacs_eur = "#{data_dir}/europe/"
dimacs_eur_exp = "#{data_dir}/europe_exp/"
dimacs_eur_turns = "#{data_dir}/europe_turns/"
dimacs_eur_turns_exp = "#{data_dir}/europe_turns_exp/"
stuttgart = "#{data_dir}/stuttgart/"
stuttgart_exp = "#{data_dir}/stuttgart_exp/"
london = "#{data_dir}/london/"
london_exp = "#{data_dir}/london_exp/"
chicago = "#{data_dir}/chicago/"
chicago_exp = "#{data_dir}/chicago_exp/"
graphs = [dimacs_eur, osm_ger]
main_graphs = graphs + [stuttgart]
turn_graphs = [[dimacs_eur, dimacs_eur_exp], [dimacs_eur_turns, dimacs_eur_turns_exp], [osm_ger, osm_ger_exp], [stuttgart, stuttgart_exp], [london, london_exp], [chicago, chicago_exp]]
namespace "prep" do
file osm_ger_src_file => data_dir do
sh "wget -O #{osm_ger_src_file} #{osm_ger_src}"
end
directory osm_ger
file osm_ger => ["code/osm_import/build/import_osm", osm_ger_src_file] do
wd = Dir.pwd
Dir.chdir osm_ger do
if only_public
sh "#{wd}/code/osm_import/build/import_osm #{osm_ger_src_file}"
else
sh "#{wd}/code/osm_import/build/import_osm #{osm_ger_src_file} #{Dir[live_dir + '*'].join(' ')} #{typical_file}"
end
end
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --bin write_unit_files -- #{osm_ger} 1000 1"
end
end
file "#{osm_ger}#{live_travel_time}" => osm_ger do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --bin import_mapbox_live -- #{osm_ger} #{live_dir} #{live_travel_time}"
end
end
directory osm_ger_exp
file osm_ger_exp => [osm_ger] do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --bin turn_expand_osm -- #{osm_ger} #{osm_ger_exp}"
sh "cargo run --release --bin write_unit_files -- #{osm_ger_exp} 1000 1"
end
end
directory dimacs_eur_exp
file dimacs_eur_exp => [dimacs_eur] do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --bin turn_expand_100s_uturn -- #{dimacs_eur} #{dimacs_eur_exp}"
end
end
(graphs + turn_graphs.flatten).each do |graph|
directory graph
directory graph + "queries/rank"
directory graph + "queries/uniform"
file graph + "queries/1h" => graph do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --bin generate_1h_queries -- #{graph} 1000000"
end
end
file graph + "queries/rank" => graph do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --bin generate_rank_queries -- #{graph}"
end
end
file graph + "queries/uniform" => graph do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --bin generate_rand_queries -- #{graph} 1000000"
end
end
file graph + "cch_perm" => [graph, "code/rust_road_router/lib/InertialFlowCutter/build/console"] do
Dir.chdir "code/rust_road_router" do
sh "./flow_cutter_cch_order.sh #{graph} #{Etc.nprocessors}"
end
end
directory graph + "travel_time_ch"
file graph + "travel_time_ch" => ["code/compute_ch/build/compute_ch"] do
sh("code/compute_ch/build/compute_ch #{graph}/first_out #{graph}/head #{graph}/travel_time " +
"#{graph}/travel_time_ch/order " +
"#{graph}/travel_time_ch/forward_first_out #{graph}/travel_time_ch/forward_head #{graph}/travel_time_ch/forward_weight " +
"#{graph}/travel_time_ch/backward_first_out #{graph}/travel_time_ch/backward_head #{graph}/travel_time_ch/backward_weight")
end
end
turn_graphs.each do |graph, graph_exp|
file graph_exp + "cch_perm_cuts" => [graph_exp, "code/rust_road_router/lib/InertialFlowCutter/build/console"] do
Dir.chdir "code/rust_road_router" do
sh "./flow_cutter_cch_cut_order.sh #{graph} #{Etc.nprocessors}"
sh "mv #{graph}cch_perm_cuts #{graph_exp}"
end
end
file graph_exp + "cch_perm_cuts_reorder" => [graph_exp, "code/rust_road_router/lib/InertialFlowCutter/build/console"] do
Dir.chdir "code/rust_road_router" do
sh "./flow_cutter_cch_cut_reorder.sh #{graph} #{Etc.nprocessors}"
sh "mv #{graph}cch_perm_cuts_reorder #{graph_exp}"
end
end
end
end
namespace "exp" do
desc "Run all experiments"
task all: [:preprocessing, :customization, :partitioning, :queries]
directory "#{exp_dir}/customization"
directory "#{exp_dir}/preprocessing"
directory "#{exp_dir}/partitioning"
directory "#{exp_dir}/queries"
directory "#{exp_dir}/baseline_queries"
namespace "turns" do
task all: [:customization, :queries, :partitioning, :preprocessing]
directory "#{exp_dir}/turns/partitioning"
directory "#{exp_dir}/turns/preprocessing"
directory "#{exp_dir}/turns/customization"
directory "#{exp_dir}/turns/queries"
directory "#{exp_dir}/turns/baseline_queries"
task partitioning: ["#{exp_dir}/turns/partitioning", "code/rust_road_router/lib/InertialFlowCutter/build/console"] + turn_graphs.flatten do
hostname = `hostname`
turn_graphs.each do |g, g_exp|
10.times do
Dir.chdir "code/rust_road_router" do
filename = "#{exp_dir}/turns/partitioning/" + `date --iso-8601=seconds`.strip + '.out'
sh "echo '#{g} #{hostname}' >> #{filename}"
sh "./flow_cutter_cch_order.sh #{g} #{Etc.nprocessors} >> #{filename}"
filename = "#{exp_dir}/turns/partitioning/" + `date --iso-8601=seconds`.strip + '.out'
sh "echo '#{g_exp} cuts #{hostname}' >> #{filename}"
sh "./flow_cutter_cch_cut_reorder.sh #{g} #{Etc.nprocessors} >> #{filename}"
filename = "#{exp_dir}/turns/partitioning/" + `date --iso-8601=seconds`.strip + '.out'
sh "echo '#{g_exp} #{hostname}' >> #{filename}"
sh "./flow_cutter_cch_order.sh #{g_exp} #{Etc.nprocessors} >> #{filename}"
end
end
end
end
task preprocessing: ["#{exp_dir}/turns/preprocessing"] + turn_graphs.map { |g, g_exp| [g + 'cch_perm', g_exp + 'cch_perm', g_exp + 'cch_perm_cuts', g_exp + 'cch_perm_cuts_reorder'] }.flatten do
Dir.chdir "code/rust_road_router" do
turn_graphs.each do |g, g_exp|
# non-turn baseline
sh "cargo run --release --bin cch_preprocessing_by_features -- #{g} cch_perm > #{exp_dir}/turns/preprocessing/$(date --iso-8601=seconds).json"
# slow order on expanded graph
sh "cargo run --release --bin cch_preprocessing_by_features -- #{g_exp} cch_perm > #{exp_dir}/turns/preprocessing/$(date --iso-8601=seconds).json"
# cut order
sh "cargo run --release --bin cch_preprocessing_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/preprocessing/$(date --iso-8601=seconds).json"
# remove inf
sh "cargo run --release --features 'remove-inf' --bin cch_preprocessing_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/preprocessing/$(date --iso-8601=seconds).json"
# directed hierarchies
sh "cargo run --release --features 'directed' --bin cch_preprocessing_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/preprocessing/$(date --iso-8601=seconds).json"
# reordered separators
sh "cargo run --release --features 'directed' --bin cch_preprocessing_by_features -- #{g_exp} cch_perm_cuts_reorder > #{exp_dir}/turns/preprocessing/$(date --iso-8601=seconds).json"
end
end
end
task customization: ["#{exp_dir}/turns/customization"] + turn_graphs.map { |g, g_exp| [g + 'cch_perm', g_exp + 'cch_perm', g_exp + 'cch_perm_cuts', g_exp + 'cch_perm_cuts_reorder'] }.flatten do
Dir.chdir "code/rust_road_router" do
turn_graphs.each do |g, g_exp|
["", "RAYON_NUM_THREADS=1 "].each do |pre|
# non-turn baseline
sh "#{pre}cargo run --release --no-default-features --features 'perfect-customization' --bin cch_customization_by_features -- #{g} cch_perm > #{exp_dir}/turns/customization/$(date --iso-8601=seconds).json"
# slow order on expanded graph
sh "#{pre}cargo run --release --no-default-features --features 'perfect-customization' --bin cch_customization_by_features -- #{g_exp} cch_perm > #{exp_dir}/turns/customization/$(date --iso-8601=seconds).json"
# cut order
sh "#{pre}cargo run --release --no-default-features --features 'perfect-customization' --bin cch_customization_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/customization/$(date --iso-8601=seconds).json"
# remove inf
sh "#{pre}cargo run --release --no-default-features --features 'remove-inf perfect-customization' --bin cch_customization_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/customization/$(date --iso-8601=seconds).json"
# directed hierarchies
sh "#{pre}cargo run --release --no-default-features --features 'directed perfect-customization' --bin cch_customization_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/customization/$(date --iso-8601=seconds).json"
# reordered separators
sh "#{pre}cargo run --release --no-default-features --features 'directed perfect-customization' --bin cch_customization_by_features -- #{g_exp} cch_perm_cuts_reorder > #{exp_dir}/turns/customization/$(date --iso-8601=seconds).json"
end
end
end
end
task queries: ["#{exp_dir}/turns/queries"] + turn_graphs.map { |g, g_exp| [g + 'cch_perm', g_exp + 'cch_perm', g_exp + 'cch_perm_cuts', g_exp + 'cch_perm_cuts_reorder'] }.flatten do
Dir.chdir "code/rust_road_router" do
turn_graphs.each do |g, g_exp|
# non-turn baseline
sh "cargo run --release --no-default-features --features 'cch-disable-par' --bin cch_rand_queries_by_features -- #{g} cch_perm > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
sh "cargo run --release --no-default-features --features 'cch-disable-par perfect-customization' --bin cch_rand_queries_by_features -- #{g} cch_perm > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
# slow order on expanded graph
sh "cargo run --release --no-default-features --features 'cch-disable-par' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
sh "cargo run --release --no-default-features --features 'cch-disable-par perfect-customization' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
# cut order
sh "cargo run --release --no-default-features --features 'cch-disable-par' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
sh "cargo run --release --no-default-features --features 'cch-disable-par perfect-customization' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
# remove inf
sh "cargo run --release --no-default-features --features 'cch-disable-par remove-inf' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
sh "cargo run --release --no-default-features --features 'cch-disable-par remove-inf perfect-customization' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
# directed hierarchies
sh "cargo run --release --no-default-features --features 'cch-disable-par directed' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
sh "cargo run --release --no-default-features --features 'cch-disable-par directed perfect-customization' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm_cuts > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
# reordered separators
sh "cargo run --release --no-default-features --features 'cch-disable-par directed' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm_cuts_reorder > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
sh "cargo run --release --no-default-features --features 'cch-disable-par directed perfect-customization' --bin cch_rand_queries_by_features -- #{g_exp} cch_perm_cuts_reorder > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
# CCHPot
sh "cargo run --release --features 'cch-disable-par' --bin cchpot_turns_with_pre_exp -- #{g} cch_perm #{g_exp} > #{exp_dir}/turns/queries/$(date --iso-8601=seconds).json"
end
end
end
task baseline_queries: ["#{exp_dir}/turns/baseline_queries", dimacs_eur_exp] do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --bin baseline_rand_queries -- #{dimacs_eur_exp} > #{exp_dir}/turns/baseline_queries/$(date --iso-8601=seconds).json"
end
end
end
namespace "kNN" do
directory "#{exp_dir}/knn/num_pois"
directory "#{exp_dir}/knn/repr/num_pois"
directory "#{exp_dir}/knn/repr/ball_size"
task num_pois: ["#{exp_dir}/knn/num_pois"] + graphs.map { |g| g + 'cch_perm' } do
Dir.chdir "code/rust_road_router" do
graphs.each do |g|
sh "cargo run --release --features cch-disable-par --bin cch_nearest_neighbors_from_entire_graph -- #{g} > #{exp_dir}/knn/num_pois/$(date --iso-8601=seconds).json"
end
end
end
namespace "repr" do
task num_pois: ["#{exp_dir}/knn/repr/num_pois", dimacs_eur + 'cch_perm'] do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --features cch-disable-par --bin cch_nearest_neighbors_from_entire_graph -- #{dimacs_eur} > #{exp_dir}/knn/repr/num_pois/$(date --iso-8601=seconds).json"
end
end
task ball_size: ["#{exp_dir}/knn/repr/ball_size", dimacs_eur + 'cch_perm'] do
Dir.chdir "code/rust_road_router" do
sh "cargo run --release --features cch-disable-par --bin cch_nearest_neighbors_from_varying_balls -- #{dimacs_eur} > #{exp_dir}/knn/repr/ball_size/$(date --iso-8601=seconds).json"
end
end
end
end
namespace "lazy_rphast" do
directory "#{exp_dir}/lazy_rphast"
task ball_size: ["#{exp_dir}/lazy_rphast"] + graphs.map { |g| g + 'cch_perm' } + graphs.map { |g| g + 'travel_time_ch' } do
Dir.chdir "code/rust_road_router" do
graphs.each do |g|
sh "cargo run --release --features cch-disable-par --bin lazy_rphast_inc_cch_vs_elim_tree -- #{g} > #{exp_dir}/lazy_rphast/$(date --iso-8601=seconds).json"
end
end
end
end
namespace "alternatives" do
directory "#{exp_dir}/alternatives"
task penalty: ["#{exp_dir}/alternatives"] + main_graphs.map { |g| g + 'cch_perm' } do
Dir.chdir "code/rust_road_router" do
main_graphs.each do |g|
sh "cargo run --release --features cch-disable-par --bin cchpot_penalty_iterative -- #{g} > #{exp_dir}/alternatives/$(date --iso-8601=seconds).json"
end
end
end
end
task partitioning: ["#{exp_dir}/partitioning", "code/rust_road_router/lib/InertialFlowCutter/build/console"] + main_graphs do
main_graphs.each do |graph|
10.times do
Dir.chdir "code/rust_road_router" do
filename = "#{exp_dir}/partitioning/" + `date --iso-8601=seconds`.strip + '.out'
sh "echo '#{graph}' >> #{filename}"
sh "./flow_cutter_cch_order.sh #{graph} #{Etc.nprocessors} >> #{filename}"
end
end
end
end
task preprocessing: ["#{exp_dir}/preprocessing"] + main_graphs.map { |g| g + 'cch_perm' } do
Dir.chdir "code/rust_road_router" do
main_graphs.each do |graph|
100.times do
sleep 1
sh "RAYON_NUM_THREADS=#{num_threads} cargo run --release --bin cch_preprocessing -- #{graph} > #{exp_dir}/preprocessing/$(date --iso-8601=seconds).json"
end
end
end
end
task customization: ["#{exp_dir}/customization"] + main_graphs.map { |g| g + 'cch_perm' } do
Dir.chdir "code/rust_road_router" do
main_graphs.each do |graph|
num_threads = 1
while num_threads <= Etc.nprocessors
sh "RAYON_NUM_THREADS=#{num_threads} cargo run --release --bin cch_customization_by_features -- #{graph} > #{exp_dir}/customization/$(date --iso-8601=seconds).json"
num_threads *= 2
end
end
end
end
task queries: ["#{exp_dir}/queries", osm_ger + live_travel_time] + main_graphs.map { |g| g + 'cch_perm' } do
Dir.chdir "code/rust_road_router" do
main_graphs.each do |graph|
['travel_time', 'geo_distance'].each do |m|
sh "cargo run --release --features 'cch-disable-par' --bin cch_rand_queries_with_unpacking -- #{graph} #{m} > #{exp_dir}/queries/$(date --iso-8601=seconds).json"
sh "cargo run --release --no-default-features --features 'cch-disable-par' --bin cch_rand_queries_with_unpacking -- #{graph} #{m} > #{exp_dir}/queries/$(date --iso-8601=seconds).json"
end
end
sh "cargo run --release --features 'cch-disable-par' --bin cch_rand_queries_with_unpacking -- #{osm_ger} #{live_travel_time} > #{exp_dir}/queries/$(date --iso-8601=seconds).json"
sh "cargo run --release --no-default-features --features 'cch-disable-par' --bin cch_rand_queries_with_unpacking -- #{osm_ger} #{live_travel_time} > #{exp_dir}/queries/$(date --iso-8601=seconds).json"
end
end
task baseline_queries: ["#{exp_dir}/baseline_queries", osm_ger + live_travel_time] + main_graphs.map { |g| g + 'cch_perm' } do
Dir.chdir "code/rust_road_router" do
main_graphs.each do |graph|
['travel_time', 'geo_distance'].each do |m|
sh "cargo run --release --bin baseline_rand_queries -- #{graph} #{m} > #{exp_dir}/baseline_queries/$(date --iso-8601=seconds).json"
end
end
sh "cargo run --release --bin baseline_rand_queries -- #{osm_ger} #{live_travel_time} > #{exp_dir}/baseline_queries/$(date --iso-8601=seconds).json"
end
end
end
namespace 'build' do
task :osm_import => "code/osm_import/build/import_osm"
directory "code/osm_import/build"
file "code/osm_import/build/import_osm" => ["code/osm_import/build", "code/osm_import/src/bin/import_osm.cpp"] do
Dir.chdir "code/osm_import/build/" do
sh "cmake -DCMAKE_BUILD_TYPE=Release .. && make"
end
end
task :compute_ch => "code/compute_ch/build/compute_ch"
directory "code/compute_ch/build"
file "code/compute_ch/build/compute_ch" => ["code/compute_ch/build", "code/compute_ch/src/bin/compute_contraction_hierarchy_and_order.cpp"] do
Dir.chdir "code/compute_ch/build/" do
sh "cmake -DCMAKE_BUILD_TYPE=Release .. && make"
end
end
task routingkit: "code/RoutingKit/bin"
file "code/RoutingKit/bin" do
Dir.chdir "code/RoutingKit/" do
sh "./generate_make_file"
sh "make"
end
end
task :inertialflowcutter => "code/rust_road_router/lib/InertialFlowCutter/build/console"
directory "code/rust_road_router/lib/InertialFlowCutter/build"
desc "Building Flow Cutter Accelerated"
file "code/rust_road_router/lib/InertialFlowCutter/build/console" => ["code/rust_road_router/lib/InertialFlowCutter/src/console.cpp", "code/rust_road_router/lib/InertialFlowCutter/build"] do
Dir.chdir "code/rust_road_router/lib/InertialFlowCutter/build" do
sh "cmake -DCMAKE_BUILD_TYPE=Release .. && make console"
end
end
end