|
|
@@ -1,5 +1,5 @@
|
|
|
using ArgParse
|
|
|
-
|
|
|
+using Profile
|
|
|
using Agents
|
|
|
using DEVS2Agents
|
|
|
|
|
|
@@ -80,6 +80,7 @@ function run_single_simulation(topology_type::Structure, type_str::String, depth
|
|
|
ext_delay = 0.0
|
|
|
|
|
|
# Model Creation
|
|
|
+ GC.gc() # clear the heap before the next run
|
|
|
start_time = time()
|
|
|
devstone_model = build_devstone(topology_type, "DEVStone_$(type_str)", depth, width, int_delay, ext_delay, stats)
|
|
|
env = build_environment(topology_type, devstone_model, Float64(width), 1)
|
|
|
@@ -92,8 +93,9 @@ function run_single_simulation(topology_type::Structure, type_str::String, depth
|
|
|
|
|
|
if profile
|
|
|
# Profile.clear()
|
|
|
- @time simulate_devs!(model)
|
|
|
+# @profile simulate_devs!(model)
|
|
|
# Profile.print(format=:flat, sortedby=:count)
|
|
|
+ @time simulate_devs!(model)
|
|
|
else
|
|
|
simulate_devs!(model)
|
|
|
end
|
|
|
@@ -153,7 +155,7 @@ function main()
|
|
|
end
|
|
|
|
|
|
# WARM-UP PASS (Only for the very first execution of the script to compile)
|
|
|
- if run == 0 && depth == ds && width == ws && repetitions != 1
|
|
|
+ if run == 0 && depth == ds && width == ws
|
|
|
run_single_simulation(topology_type, model_str, 2, 2, false, false, false)
|
|
|
end
|
|
|
|