diff options
-rwxr-xr-x | salis | 3 | ||||
-rw-r--r-- | src/salis.c | 10 |
2 files changed, 8 insertions, 5 deletions
@@ -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); } |