aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2025-10-20 02:15:45 +0200
committerPaul Oliver <contact@pauloliver.dev>2025-10-20 02:15:45 +0200
commit2a2f64081191dba1588561cb0f0510b44fc3711d (patch)
treef7e68bad9de94c25427dcec6541952fa5b344a93
parentd91b8a6196af711f9dface0c2a0d37794c12ac02 (diff)
Data aggregation (WIP)data
-rwxr-xr-xsalis3
-rw-r--r--src/salis.c10
2 files changed, 8 insertions, 5 deletions
diff --git a/salis b/salis
index ad5aded..7f8b4e2 100755
--- a/salis
+++ b/salis
@@ -77,6 +77,7 @@ options=(
"b|steps|N|Number of steps to run in benchmark||0x1000000|bench"
"C|clones|N|Number of ancestor clones on each core||1|bench:new"
"c|cores|N|Number of simulator cores||2|bench:new"
+ "d|data-push-pow|POW|Data aggregation interval exponent (interval == 2^POW)||30|new"
"F|muta-flip||Cosmic rays flip bits instead of randomizing whole bytes||false|bench:new"
"f|force||Overwrites existing simulation of given name||false|new"
"H|half||Compiles ancestor at the middle of the memory buffer||false|bench:new"
@@ -336,6 +337,8 @@ case ${cmd} in
load|new)
bcmd="${bcmd} -DAUTO_SAVE_INTERVAL=`fpow ${opt_auto_save_pow}`"
bcmd="${bcmd} -DAUTO_SAVE_NAME_LEN=$((${#sim_path} + 20))"
+ bcmd="${bcmd} -DDATA_PUSH_INTERVAL=`fpow ${opt_data_push_pow}`"
+ bcmd="${bcmd} -DDATA_PUSH_PATH=`fquote ${sim_path}.data`"
bcmd="${bcmd} -DMUTA_FLIP_BIT=`[[ ${opt_muta_flip} == true ]] && echo 1 || echo 0`"
bcmd="${bcmd} -DSIM_NAME=`fquote ${opt_name}`"
bcmd="${bcmd} -DSIM_PATH=`fquote ${sim_path}`"
diff --git a/src/salis.c b/src/salis.c
index 348385f..28f7779 100644
--- a/src/salis.c
+++ b/src/salis.c
@@ -569,10 +569,6 @@ void salis_save(const char *path) {
}
void salis_auto_save() {
- if (g_steps % AUTO_SAVE_INTERVAL != 0) {
- return;
- }
-
#ifndef NDEBUG
int rem = snprintf(
#else
@@ -734,9 +730,13 @@ void salis_loop(u64 ns, u64 dt) {
salis_run_thread(dt);
salis_sync();
+
#if ACTION == ACT_LOAD || ACTION == ACT_NEW
- salis_auto_save();
+ if (g_steps % AUTO_SAVE_INTERVAL == 0) {
+ salis_auto_save();
+ }
#endif
+
salis_loop(ns - dt, SYNC_INTERVAL);
}