Include machine identity and date in filename

This commit is contained in:
Mark Evenson 2022-09-04 09:09:54 +02:00
parent 4128cb7edb
commit e6b431a2fd
3 changed files with 29 additions and 13 deletions

View File

@ -11,10 +11,15 @@
("evidence_alpha_2" . 0.5)
("confidence_beta" . 1.0)
("look_ahead" . 500)
("query" :OBJ ("query_size" . 100) ("initial_query_size" . 100)
("query_multiplier" . 1) ("max_multiplier" . 1))))
("distribution" :OBJ ("yes" . 0.5) ("no" . 0.5) ("none" . 0))
("byzantine_settings" :OBJ ("total_size" . 10000)
("query" :OBJ
("query_size" . 100)
("initial_query_size" . 100)
("query_multiplier" . 1)
("max_multiplier" . 1))))
("distribution"
:OBJ ("yes" . 0.5) ("no" . 0.5) ("none" . 0))
("byzantine_settings"
:OBJ ("total_size" . 10000)
("distribution"
:OBJ ("honest" . 1) ("infantile" . 0) ("random" . 0) ("omniscient" . 0)))
("wards" (:OBJ ("time_to_finality" :OBJ ("ttf_threshold" . 100))))
@ -52,7 +57,6 @@
(let ((name (pathname-name (pathname filename))))
(do-urlencode:urldecode name :queryp t)))
;;; unused
(defun json-parameters ()
`($.consensus_settings.glacier.evidence_alpha
@ -63,6 +67,8 @@
1
$.consensus_settings.glacier.look_ahead
997
$.consensus_settings.glacier.query.query_size ;; difference from initial_query_size ?
100
$.consensus_settings.glacier.query.initial_query_size
100
$.consensus_settings.glacier.query.query_multiplier

View File

@ -1,7 +1,10 @@
(in-package :glacier)
(defparameter +filename-record-separator+
#\-)
(defun summarize (file)
"Summarize the contents of polars FILE as per round undecided, no, and yes votes"
"Summarize the contents of Polars formatted FILE as per round undecided, no, and yes votes"
(let* ((s
(alexandria:read-file-into-string file))
(j
@ -60,8 +63,8 @@ source using 3 with linespoints pointnumber 11 title 'yes', ~
(let* ((name
(do-urlencode:urldecode (pathname-name filename) :queryp t))
(all-pairs
(second ;; not going to work for negative integer values
(split-sequence:split-sequence #\- name)))
(first
(split-sequence:split-sequence +filename-record-separator+ name)))
(pairs
(split-sequence:split-sequence #\space all-pairs))
(assoc-pairs

View File

@ -5,7 +5,6 @@
"work/consensus-prototypes/target/release-opt/consensus-simulations"
(user-homedir-pathname)))
(defun run (trials
&key
parameters
@ -20,10 +19,17 @@ template."
(set-path jsown path value)))
(let* ((parameter-string
(encode-parameters jsown))
(id ;; TODO use host-date))
"0")
(machine
(machine-instance))
(time
(format nil "~a" (get-universal-time)))
(separator
(string +filename-record-separator+))
(base
(format nil "~a-~a" id parameter-string))
(concatenate 'string
parameter-string separator
machine separator
time))
(input-settings
(merge-pathnames
(concatenate 'string "var/" base ".json")
@ -54,8 +60,9 @@ template."
:doing
(let* ((output
(make-pathname :defaults output-file
:name (format nil "~a-~a"
:name (format nil "~a~a~a"
(pathname-name output-file)
(string +filename-record-separator+)
i)))
(stdout
(make-pathname :defaults output