Просмотр исходного кода

updated benchmarks for upgraded DEVS framework

Snej69420 6 месяцев назад
Родитель
Сommit
37c3e98a95

+ 1 - 1
benchmarks/Agents/DelayedAtomic.jl

@@ -2,7 +2,7 @@ import DEVS2Agents: time_advance, internal_transition!, external_transition!, co
 
 @enum State DA_Passive=1 DA_Active=2
 
-struct A2A <: DEVSMessage
+struct A2A
     activate::Int
 end
 

+ 1 - 1
benchmarks/Agents/Generator.jl

@@ -2,7 +2,7 @@ import DEVS2Agents: time_advance, internal_transition!, external_transition!, co
 
 @enum GenState G_Waiting=1 G_Active=2 G_Passive=3
 
-struct Generate <: DEVSMessage
+struct Generate
     activate::UnitRange{Int}
 end
 

+ 3 - 3
benchmarks/Agents/Manifest.toml

@@ -2,7 +2,7 @@
 
 julia_version = "1.12.5"
 manifest_format = "2.0"
-project_hash = "5d298123c5a26569afa491caa1b3184db6cc5195"
+project_hash = "841b8e2e6442a9ee8bf8f5e5475465765b84235a"
 
 [[deps.AbstractTrees]]
 git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177"
@@ -166,8 +166,8 @@ uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
 version = "4.1.1"
 
 [[deps.DEVS2Agents]]
-deps = ["Agents", "ArgParse", "Test"]
-git-tree-sha1 = "3fbb8083303e1d3164f0d5e0e838b83cb2b3ec42"
+deps = ["Agents", "ArgParse", "DataStructures", "Test"]
+git-tree-sha1 = "6cc6dc7dd96e13ecfa29b9670c9bd0b181275460"
 repo-rev = "main"
 repo-url = "git@github.com:Snej69420/DEVS2Agents.git"
 uuid = "073a0784-fe80-4c04-b3c3-fb0686668e26"

+ 1 - 0
benchmarks/Agents/Project.toml

@@ -1,3 +1,4 @@
 [deps]
 ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63"
 DEVS2Agents = "073a0784-fe80-4c04-b3c3-fb0686668e26"
+DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"

+ 5 - 3
benchmarks/Agents/main.jl

@@ -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