From 90b50a7f90aeeca48fe0bb6f6ae0d8ea1f8ad624 Mon Sep 17 00:00:00 2001 From: janekdererste Date: Wed, 17 Jul 2024 09:23:15 +0200 Subject: [PATCH] write events to relative path --- src/simulation/controller.rs | 6 +++++- src/simulation/io/mod.rs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/simulation/controller.rs b/src/simulation/controller.rs index 50171e0..3934491 100644 --- a/src/simulation/controller.rs +++ b/src/simulation/controller.rs @@ -132,7 +132,11 @@ fn execute_partition(comm: C, args: &CommandLineAr if config.output().write_events == WriteEvents::Proto { let events_file = format!("events.{rank}.binpb"); - let events_path = output_path.join(events_file); + let events_path = io::resolve_path( + &args.config_path, + &output_path.join(events_file).to_str().unwrap().to_string(), + ); + info!("adding events writer with path: {events_path:?}"); events.add_subscriber(Box::new(ProtoEventsWriter::new(&events_path))); } let travel_time_collector = Box::new(TravelTimeCollector::new()); diff --git a/src/simulation/io/mod.rs b/src/simulation/io/mod.rs index e66e872..c465f1a 100644 --- a/src/simulation/io/mod.rs +++ b/src/simulation/io/mod.rs @@ -9,7 +9,7 @@ mod worker; pub mod xml; pub mod xml_events; -pub fn resolve_path(config: &String, file: &String) -> PathBuf { +pub fn resolve_path(config: &String, file: &str) -> PathBuf { let file_path = PathBuf::from(file); if file_path.is_absolute() || file_path.starts_with("./") { return file_path;