diff --git a/src/runtime/branch.rs b/src/runtime/branch.rs index 8d35090031d08c0ba205df2726d51cf4d9ad5be0..5aaabef1b7cd41c9348bbae7e1d4d9dc2d821291 100644 --- a/src/runtime/branch.rs +++ b/src/runtime/branch.rs @@ -256,15 +256,6 @@ impl ExecTree { } } - /// Returns an iterator that starts with the provided branch, and then - /// continues to visit all of the branch's parents. - pub fn iter_parents(&self, branch_id: BranchId) -> BranchParentIter { - return BranchParentIter{ - branches: self.branches.as_slice(), - index: branch_id.index as usize, - } - } - // --- Preparing and finishing a speculative round /// Starts a synchronous round by cloning the non-sync branch and marking it @@ -332,26 +323,6 @@ impl IndexMut for ExecTree { } } -/// Iterator over the parents of an `ExecTree` branch. -pub(crate) struct BranchParentIter<'a> { - branches: &'a [Branch], - index: usize, -} - -impl<'a> Iterator for BranchParentIter<'a> { - type Item = &'a Branch; - - fn next(&mut self) -> Option { - if self.index == 0 { - return None; - } - - let branch = &self.branches[self.index]; - self.index = branch.parent_id.index as usize; - return Some(branch); - } -} - // ----------------------------------------------------------------------------- // FakeTree // ----------------------------------------------------------------------------- diff --git a/src/runtime/connector.rs b/src/runtime/connector.rs index 0b95f378e22907f6cf3479bc9bd7a60176ac6d48..70f9df50e1b80d8f0245a4e99e2c50114a5062e3 100644 --- a/src/runtime/connector.rs +++ b/src/runtime/connector.rs @@ -100,11 +100,11 @@ impl<'a> RunContext for ConnectorRunContext<'a>{ }; } - fn fires(&mut self, port: PortId) -> Option { - todo!("Remove fires() now"); - let port_id = PortIdLocal::new(port.id); - let annotation = self.consensus.get_annotation(self.branch_id, port_id); - return annotation.expected_firing.map(|v| Value::Bool(v)); + fn fires(&mut self, _port: PortId) -> Option { + todo!("Remove fires() now") + // let port_id = PortIdLocal::new(port.id); + // let annotation = self.consensus.get_annotation(self.branch_id, port_id); + // return annotation.expected_firing.map(|v| Value::Bool(v)); } fn created_channel(&mut self) -> Option<(Value, Value)> { diff --git a/src/runtime/consensus.rs b/src/runtime/consensus.rs index ddb3e086df412d7b43532c04f2cd6d41d2e4b22b..af043c10367dba4b228e5d5eb460ee29180a62c2 100644 --- a/src/runtime/consensus.rs +++ b/src/runtime/consensus.rs @@ -121,13 +121,6 @@ impl Consensus { return !self.branch_annotations.is_empty(); } - #[deprecated] - pub fn get_annotation(&self, branch_id: BranchId, channel_id: PortIdLocal) -> &ChannelAnnotation { - let branch = &self.branch_annotations[branch_id.index as usize]; - let port = branch.channel_mapping.iter().find(|v| v.channel_id.index == channel_id.index).unwrap(); - return port; - } - /// Sets up the consensus algorithm for a new synchronous round. The /// provided ports should be the ports the component owns at the start of /// the sync round. @@ -301,12 +294,12 @@ impl Consensus { /// Notifies the consensus algorithm about the chosen branch to commit to /// memory (may be the invalid "start" branch) - pub fn end_sync(&mut self, branch_id: BranchId, final_ports: &mut Vec) { + pub fn end_sync(&mut self, branch_id: BranchId, _final_ports: &mut Vec) { debug_assert!(self.is_in_sync()); // TODO: Handle sending and receiving ports // Set final ports - let branch = &self.branch_annotations[branch_id.index as usize]; + let _branch = &self.branch_annotations[branch_id.index as usize]; // Clear out internal storage to defaults println!("DEBUG: ***** Incrementing sync round stuff"); @@ -352,7 +345,7 @@ impl Consensus { find_ports_in_value_group(content, &mut self.workspace_ports); if !self.workspace_ports.is_empty() { todo!("handle sending ports"); - self.workspace_ports.clear(); + // self.workspace_ports.clear(); } // Construct data header @@ -554,7 +547,7 @@ impl Consensus { find_ports_in_value_group(&message.content, &mut self.workspace_ports); if !self.workspace_ports.is_empty() { todo!("handle received ports"); - self.workspace_ports.clear(); + // self.workspace_ports.clear(); } return; diff --git a/src/runtime/mod.rs b/src/runtime/mod.rs index c522a7397a83c029a0eabe85233498d0e844c7e0..58df7c21a5e9985f55c09a7988f0e6649b6ebd6a 100644 --- a/src/runtime/mod.rs +++ b/src/runtime/mod.rs @@ -280,7 +280,7 @@ impl RuntimeInner { /// then it is scheduled for execution. pub(crate) fn send_message_maybe_destroyed(&self, target_id: ConnectorId, message: Message) -> bool { let target = { - let mut lock = self.connectors.read().unwrap(); + let lock = self.connectors.read().unwrap(); lock.get(target_id.index) }; diff --git a/src/runtime/native.rs b/src/runtime/native.rs index b92c59536f1423adb045fa1f53099ed75095c7b7..9f038926c3f5f85edd08381dc919b486c2b27d76 100644 --- a/src/runtime/native.rs +++ b/src/runtime/native.rs @@ -115,10 +115,10 @@ impl ConnectorApplication { self.handle_new_data_message(ticket, comp_ctx) } else { match comp_ctx.take_message_using_ticket(ticket) { - Message::Data(message) => unreachable!(), + Message::Data(_message) => unreachable!(), Message::SyncComp(message) => self.handle_new_sync_comp_message(message, comp_ctx), Message::SyncPort(message) => self.handle_new_sync_port_message(message, comp_ctx), - Message::SyncControl(message) => todo!("implement"), + Message::SyncControl(_message) => todo!("implement"), Message::Control(_) => unreachable!("control message in native API component"), } } @@ -179,7 +179,7 @@ impl ConnectorApplication { let branch_id = branch_id.unwrap(); let branch = &mut self.tree[branch_id]; - let mut instruction_idx = self.branch_extra[branch_id.index as usize]; + let instruction_idx = self.branch_extra[branch_id.index as usize]; if instruction_idx >= self.sync_desc.len() { // Performed last instruction, so this branch is officially at the @@ -274,7 +274,7 @@ impl ConnectorApplication { return ConnectorScheduling::Later; }, - ApplicationJob::SyncRound(mut description) => { + ApplicationJob::SyncRound(description) => { // Entering sync mode comp_ctx.notify_sync_start(); self.sync_desc = description; diff --git a/src/runtime/scheduler.rs b/src/runtime/scheduler.rs index 59ebb2549f631608ed771282d51e6cf1ed83952f..a30ab63ff58a13b9d8625e587c077980fc289fcb 100644 --- a/src/runtime/scheduler.rs +++ b/src/runtime/scheduler.rs @@ -907,8 +907,8 @@ impl ControlMessageHandler { return Some(new_component_entry.component_key); }, None => { - todo!("handling of nefarious ACKs"); - return None; + todo!("handling of nefarious ACKs") + // return None; }, } } diff --git a/src/runtime/tests/data_transmission.rs b/src/runtime/tests/data_transmission.rs index f93df6d9f1d5078fa4bca7c25711a4845bdaafc0..d86dee7f3c8ff915d9a56d49c9281cc5ca30f768 100644 --- a/src/runtime/tests/data_transmission.rs +++ b/src/runtime/tests/data_transmission.rs @@ -17,7 +17,7 @@ fn test_doing_nothing() { } "; - let thing = TestTimer::new("doing_nothing"); + let _timer = TestTimer::new("doing_nothing"); run_test_in_runtime(CODE, |api| { api.create_connector("", "silent_willy", ValueGroup::new_stack(vec![ Value::UInt32(NUM_LOOPS), @@ -50,7 +50,7 @@ fn test_single_put_and_get() { } "; - let thing = TestTimer::new("single_put_and_get"); + let _timer = TestTimer::new("single_put_and_get"); run_test_in_runtime(CODE, |api| { let channel = api.create_channel().unwrap(); @@ -130,7 +130,7 @@ fn test_multi_put_and_get() { } "; - let thing = TestTimer::new("multi_put_and_get"); + let _timer = TestTimer::new("multi_put_and_get"); run_test_in_runtime(CODE, |api| { let channel = api.create_channel().unwrap(); api.create_connector("", "putter_static", ValueGroup::new_stack(vec![ diff --git a/src/runtime/tests/network_shapes.rs b/src/runtime/tests/network_shapes.rs index b0210e6e0cb8891c435bb048f472d54f11a8d6af..a15dcd0ebd7ec07beb24e75c668455d63ad7cfe8 100644 --- a/src/runtime/tests/network_shapes.rs +++ b/src/runtime/tests/network_shapes.rs @@ -58,7 +58,7 @@ fn test_star_shaped_request() { } "; - let thing = TestTimer::new("star_shaped_request"); + let _timer = TestTimer::new("star_shaped_request"); run_test_in_runtime(CODE, |api| { api.create_connector("", "constructor", ValueGroup::new_stack(vec![ Value::UInt32(5), @@ -135,7 +135,7 @@ fn test_conga_line_request() { } "; - let thing = TestTimer::new("conga_line_request"); + let _timer = TestTimer::new("conga_line_request"); run_test_in_runtime(CODE, |api| { api.create_connector("", "constructor", ValueGroup::new_stack(vec![ Value::UInt32(1),