Skip to content

Commit 90b50a7

Browse files
author
janekdererste
committed
write events to relative path
1 parent 2a3a87d commit 90b50a7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/simulation/controller.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ fn execute_partition<C: SimCommunicator + 'static>(comm: C, args: &CommandLineAr
132132

133133
if config.output().write_events == WriteEvents::Proto {
134134
let events_file = format!("events.{rank}.binpb");
135-
let events_path = output_path.join(events_file);
135+
let events_path = io::resolve_path(
136+
&args.config_path,
137+
&output_path.join(events_file).to_str().unwrap().to_string(),
138+
);
139+
info!("adding events writer with path: {events_path:?}");
136140
events.add_subscriber(Box::new(ProtoEventsWriter::new(&events_path)));
137141
}
138142
let travel_time_collector = Box::new(TravelTimeCollector::new());

src/simulation/io/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod worker;
99
pub mod xml;
1010
pub mod xml_events;
1111

12-
pub fn resolve_path(config: &String, file: &String) -> PathBuf {
12+
pub fn resolve_path(config: &String, file: &str) -> PathBuf {
1313
let file_path = PathBuf::from(file);
1414
if file_path.is_absolute() || file_path.starts_with("./") {
1515
return file_path;

0 commit comments

Comments
 (0)