Skip to content

Commit

Permalink
write events to relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
janekdererste committed Jul 17, 2024
1 parent 2a3a87d commit 90b50a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/simulation/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ fn execute_partition<C: SimCommunicator + 'static>(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());
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/io/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 90b50a7

Please sign in to comment.