diff --git a/src/runtime2/connector.rs b/src/runtime2/connector.rs index a79d9810109b7215372f2f19213c6546221829ec..fffbad2d7b3a76febb3067a58d4e0c31173c2fe1 100644 --- a/src/runtime2/connector.rs +++ b/src/runtime2/connector.rs @@ -281,7 +281,6 @@ impl ConnectorPorts { let branch_idx = branch_idx as usize; let num_ports = self.owned_ports.len(); - println!("port_idx = {}, branch_idx = {}, num_ports = {}, port_mapping.len() = {}", port_idx, branch_idx, num_ports, self.port_mapping.len()); debug_assert!(port_idx < num_ports); debug_assert!((branch_idx + 1) * num_ports <= self.port_mapping.len()); diff --git a/src/runtime2/native.rs b/src/runtime2/native.rs index f8779bcb9fd6fa1dbea81a7fd38cac5bb8078811..cf25163fb61249b33639cc6d0d24bb2acba8e214 100644 --- a/src/runtime2/native.rs +++ b/src/runtime2/native.rs @@ -133,7 +133,7 @@ impl ApplicationInterface { /// Creates a new connector. Note that it is not scheduled immediately, but /// depends on the `ApplicationConnector` to run, followed by the created /// connector being scheduled. - // TODO: Optimize by yanking out scheduler logic for common use. + // TODO: Yank out scheduler logic for common use. pub fn create_connector(&mut self, module: &str, routine: &str, arguments: ValueGroup) -> Result<(), ComponentCreationError> { // Retrieve ports and make sure that we own the ones that are currently // specified. This is also checked by the scheduler, but that is done diff --git a/src/runtime2/scheduler.rs b/src/runtime2/scheduler.rs index 5623f2f59e5c52e89029c2adcd4533c4400b492a..70274990203972a1013b5025d7720cdd57369f05 100644 --- a/src/runtime2/scheduler.rs +++ b/src/runtime2/scheduler.rs @@ -73,7 +73,6 @@ impl Scheduler { pub fn run(&mut self) { // Setup global storage and workspaces that are reused for every // connector that we run - let scheduler_id = self.scheduler_id; let mut delta_state = RunDeltaState::new(); 'thread_loop: loop { @@ -100,12 +99,14 @@ impl Scheduler { // Check all the message that are in the shared inbox while let Some(message) = scheduled.public.inbox.take_message() { // Check for rerouting - self.debug_conn(connector_id, &format!("Handling message from {}:{}\n --- {:?}", message.sending_connector.0, message.receiving_port.index, message)); + self.debug_conn(connector_id, &format!("Handling message from conn({}) at port({})\n --- {:?}", message.sending_connector.0, message.receiving_port.index, message)); if let Some(other_connector_id) = scheduled.router.should_reroute(message.sending_connector, message.receiving_port) { + self.debug_conn(connector_id, &format!(" ... Rerouting to connector {}", other_connector_id.0)); self.runtime.send_message(other_connector_id, message); continue; } + self.debug_conn(connector_id, " ... Handling message myself"); // Check for messages that requires special action from the // scheduler. if let MessageContents::Control(content) = message.contents { diff --git a/src/runtime2/tests/mod.rs b/src/runtime2/tests/mod.rs index 6e2c177a086fd82ac787b34c665d28b1da2a4ae0..794f42274ffbd045070e49049e068e1c613ba26f 100644 --- a/src/runtime2/tests/mod.rs +++ b/src/runtime2/tests/mod.rs @@ -42,7 +42,7 @@ primitive getter(in receiver, u32 loops) { let mut api = rt.create_interface(); let channel = api.create_channel(); - let num_loops = 100; + let num_loops = 1; api.create_connector("", "putter", ValueGroup::new_stack(vec![ Value::Output(PortId(Id{ connector_id: 0, u32_suffix: channel.putter_id.index })), @@ -53,6 +53,4 @@ primitive getter(in receiver, u32 loops) { Value::Input(PortId(Id{ connector_id: 0, u32_suffix: channel.getter_id.index })), Value::UInt32(num_loops) ])).expect("create getter"); - - println!("Am I running?"); } \ No newline at end of file