Skip to content
Snippets Groups Projects
Commit e38dcb17 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

hash the whole experiment and remove timestamp (!129)

this is to have a complete identifier for each run, which does not depend at all on the time at which the experiment runs.
parent e5311d6c
No related branches found
No related tags found
1 merge request!129hash the whole experiment and remove timestamp
Pipeline #5319 passed
......@@ -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
......@@ -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,
......
......@@ -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
......
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment