buffer_proto5: auto-create the output directories (and fix them to out/applications)
This commit is contained in:
@@ -335,6 +335,12 @@ fn derive_geometries(p: GeomParams) -> Option<Geometries> {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn ensure_out_dir(id: u32) -> String {
|
||||||
|
let base = format!("out/applications/buffer_proto5/{}", id);
|
||||||
|
let _ = std::fs::create_dir_all(&base);
|
||||||
|
base
|
||||||
|
}
|
||||||
|
|
||||||
fn run_sim(id: u32, p: Params, g: Geometries) -> Results {
|
fn run_sim(id: u32, p: Params, g: Geometries) -> Results {
|
||||||
info!("run_sim {}: {:?}", id, p);
|
info!("run_sim {}: {:?}", id, p);
|
||||||
|
|
||||||
@@ -346,10 +352,11 @@ fn run_sim(id: u32, p: Params, g: Geometries) -> Results {
|
|||||||
info!("ferro1: {:?}", g.ferro1_region.center());
|
info!("ferro1: {:?}", g.ferro1_region.center());
|
||||||
info!("ferro2: {:?}", g.ferro2_region.center());
|
info!("ferro2: {:?}", g.ferro2_region.center());
|
||||||
|
|
||||||
let base = format!("buffer5-{}", id);
|
let base = ensure_out_dir(id);
|
||||||
let prefix = format!("out/{}/{}-{}-{}setmA-{}setps-{}clkmA-{}clkps-{}um-{}ferromaj-{}:{}wraps-{}:{}cov-{:?}clk",
|
let prefix = format!(
|
||||||
base,
|
"{}/{}-{}-{}setmA-{}setps-{}clkmA-{}clkps-{}um-{}ferromaj-{}:{}wraps-{}:{}cov-{:?}clk",
|
||||||
base,
|
base,
|
||||||
|
id,
|
||||||
*g.dim.to_index(p.geom.feat_size),
|
*g.dim.to_index(p.geom.feat_size),
|
||||||
(p.peak_set_current * 1e3).round() as i64,
|
(p.peak_set_current * 1e3).round() as i64,
|
||||||
(p.set_duration * 1e12).round() as i64,
|
(p.set_duration * 1e12).round() as i64,
|
||||||
@@ -630,7 +637,7 @@ fn main() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let mut geom_cache = DiskCache::new_with_supplier(
|
let mut geom_cache = DiskCache::new_with_supplier(
|
||||||
&format!("out/buffer5-{}/.geom_cache", i),
|
&format!("{}/.geom_cache", ensure_out_dir(i)),
|
||||||
|geom: &GeomParams| derive_geometries(geom.clone())
|
|geom: &GeomParams| derive_geometries(geom.clone())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user