diff --git a/bins/inbreeding/consts.nu b/bins/inbreeding/consts.nu index 96aa84acaf4672baef6daafd2117ab6df5419ad6..080ce247133fc02919b422099634c0170a21c583 100644 --- a/bins/inbreeding/consts.nu +++ b/bins/inbreeding/consts.nu @@ -5,10 +5,9 @@ const FMT = { env: "(?<env>.*)", seed: "(?<seed>[a-zA-Z0-9]*)", params: '(?<k>\d+)-(?<n>\d+)-(?<nb_bytes>\d+)', - timestamp: '(?<timestamp>\d+)', strat: "(?<strategy>.*)" , } export const ARG_EXPERIMENT_FORMAT = $FMT.seed + '-' + $FMT.env + '-' + $FMT.params -export const EXPERIMENT_FORMAT = $FMT.timestamp + '-' + $FMT.env + '-' + $FMT.strat + '-' + $FMT.params +export const EXPERIMENT_FORMAT = $FMT.env + '-' + $FMT.strat + '-' + $FMT.params export const FULL_EXPERIMENT_FORMAT = $FMT.seed + (char path_sep) + $EXPERIMENT_FORMAT diff --git a/bins/inbreeding/inspect.nu b/bins/inbreeding/inspect.nu index 96a908a56e0ac25da5da29ce1d983c0153fb3544..7a34aa8e968b531c5659e8d6de8e5b330f6ad204 100644 --- a/bins/inbreeding/inspect.nu +++ b/bins/inbreeding/inspect.nu @@ -8,7 +8,6 @@ def get-seeds [] [ nothing -> list<string> ] { export def main [seed: string@get-seeds]: [ nothing -> table< seed: string, - timestamp: string, env: string, strategy: string, k: string, diff --git a/bins/inbreeding/load.nu b/bins/inbreeding/load.nu index 894b2940e392f9951b15d703806864c452f12351..3896ff4dbf562d922479131ec7be4ca521371807 100644 --- a/bins/inbreeding/load.nu +++ b/bins/inbreeding/load.nu @@ -11,7 +11,7 @@ def get-experiments []: nothing -> list<string> { | get name | each { remove-cache-prefix } | parse --regex $consts.FULL_EXPERIMENT_FORMAT - | reject timestamp strategy + | reject strategy | each { values | str join '-' } | uniq } @@ -31,7 +31,7 @@ export def main [ let experiment_path = [ $consts.CACHE, $exp.seed, - (['*', $exp.env, '*', $exp.k, $exp.n, $exp.nb_bytes] | str join '-') + ([$exp.env, '*', $exp.k, $exp.n, $exp.nb_bytes] | str join '-') ] | path join | into glob diff --git a/bins/inbreeding/run.nu b/bins/inbreeding/run.nu index e27cdc8599b7d33e5a43e79fe1a5f090ddfcf855..82eb6084a472b34fdd5d33b00766bd318b6efa3b 100644 --- a/bins/inbreeding/run.nu +++ b/bins/inbreeding/run.nu @@ -69,19 +69,20 @@ export def main [ } } - let now = date now | format date "%s%f" + let exp_hash = $options | reject strategies | sort | to nuon | hash sha256 for s in $options.strategies { let output_dir = [ $consts.CACHE, $"($prng_seed)", - ([$now, $options.environment, $s, $options.k, $options.n, $options.nb_bytes] | str join '-') + ([$options.environment, $s, $options.k, $options.n, $options.nb_bytes] | str join '-') ] | path join mkdir $output_dir print $"data will be dumped to `($output_dir)`" for i in 1..$options.nb_scenarii { - let output = [ $output_dir, $"($i)" ] | path join + let seed = [ $prng_seed, $exp_hash, $s, $i ] | str join | hash sha256 + let output = [ $output_dir, $seed ] | path join ^$consts.BIN ...[ $options.nb_bytes, @@ -94,7 +95,7 @@ export def main [ --test-case recoding --strategy $s --environment $options.environment - --prng-seed ([$prng_seed, $s, $i] | str join | hash sha256) + --prng-seed $seed ] out> $output }