@@ -9,7 +9,9 @@ use mpi::traits::{Communicator, CommunicatorCollectives};
9
9
use nohash_hasher:: IntMap ;
10
10
use tracing:: info;
11
11
12
- use crate :: simulation:: config:: { CommandLineArgs , Config , PartitionMethod , RoutingMode } ;
12
+ use crate :: simulation:: config:: {
13
+ CommandLineArgs , Config , PartitionMethod , RoutingMode , WriteEvents ,
14
+ } ;
13
15
use crate :: simulation:: io:: proto_events:: ProtoEventsWriter ;
14
16
use crate :: simulation:: messaging:: communication:: communicators:: {
15
17
ChannelSimCommunicator , MpiSimCommunicator , SimCommunicator ,
@@ -126,12 +128,13 @@ fn execute_partition<C: SimCommunicator + 'static>(comm: C, args: &CommandLineAr
126
128
127
129
let mut events = EventsPublisher :: new ( ) ;
128
130
129
- let events_file = format ! ( "events.{rank}.binpb" ) ;
130
- let events_path = output_path. join ( events_file) ;
131
- events. add_subscriber ( Box :: new ( ProtoEventsWriter :: new ( & events_path) ) ) ;
131
+ if config. output ( ) . write_events == WriteEvents :: Proto {
132
+ let events_file = format ! ( "events.{rank}.binpb" ) ;
133
+ let events_path = output_path. join ( events_file) ;
134
+ events. add_subscriber ( Box :: new ( ProtoEventsWriter :: new ( & events_path) ) ) ;
135
+ }
132
136
let travel_time_collector = Box :: new ( TravelTimeCollector :: new ( ) ) ;
133
137
events. add_subscriber ( travel_time_collector) ;
134
- //events.add_subscriber(Box::new(EventsLogger {}));
135
138
136
139
let rc = Rc :: new ( comm) ;
137
140
0 commit comments