Possible to run simulation asynchronously

But the async version causes panics

    thread 'main' panicked at 'could not create DataFrame from iterator: Duplicate("Column with name: '1' has more than one occurrences")', /Users/evenson/.cargo/registry/src/github.com-1ecc6299db9ec823/polars-core-0.22.7/src/frame/upstream_traits.rs:11:27
This commit is contained in:
Mark Evenson 2022-09-04 12:33:53 +02:00
parent 80224ac99a
commit 928cb1a0e6
2 changed files with 19 additions and 1 deletions

View File

@ -23,6 +23,7 @@
("distribution"
:OBJ ("honest" . 1) ("infantile" . 0) ("random" . 0) ("omniscient" . 0)))
("wards" (:OBJ ("time_to_finality" :OBJ ("ttf_threshold" . 100))))
("simulation_style" . "Sync")
("network_modifiers" (:OBJ ("random_drop" :OBJ ("drop_rate" . 0))))))
;;; N.b. assumes that all JSON keys are 1) lowercase, and 2) unique

View File

@ -94,4 +94,21 @@ template."
`(($.byzantine_settings.total_size ,(expt 10 4))
($.distribution.yes ,(coerce yes 'single-float))
($.distribution.no ,(coerce no 'single-float))))))
(defun search-parameters-async ()
"A parameter search run"
;; not exactly sure why something like
;; (loop :for yes :from 0.4 :to 0.6 :by 0.05… has rounding problems
;;
(loop :for yes :from 2/5 :to 3/5 :by 1/20
:for no :from 3/5 :downto 2/5 :by 1/20
:doing
(run 10
:parameters
`(($.byzantine_settings.total_size ,(expt 10 3))
($.distribution.yes ,(coerce yes 'single-float))
($.simulation_style (:obj ("Async" :obj ("chunks" . 20))))
($.distribution.no ,(coerce no 'single-float))))))