pub struct DualModuleParallelUnit<SerialModule: DualModuleImpl + Send + Sync> {Show 14 fields
pub unit_index: usize,
pub partition_info: Arc<PartitionInfo>,
pub partition_unit: PartitionUnitPtr,
pub is_active: bool,
pub whole_range: VertexRange,
pub owning_range: VertexRange,
pub extra_descendant_mirrored_vertices: HashSet<VertexIndex>,
pub serial_module: SerialModule,
pub children: Option<(DualModuleParallelUnitWeak<SerialModule>, DualModuleParallelUnitWeak<SerialModule>)>,
pub parent: Option<DualModuleParallelUnitWeak<SerialModule>>,
pub elevated_dual_nodes: PtrWeakHashSet<DualNodeWeak>,
pub empty_sync_request: Vec<SyncRequest>,
pub enable_parallel_execution: bool,
pub has_active_node: bool,
}Fields§
§unit_index: usizethe index
partition_info: Arc<PartitionInfo>partition information generated by the config
partition_unit: PartitionUnitPtrinformation shared with serial module
is_active: boolwhether it’s active or not; some units are “placeholder” units that are not active until they actually fuse their children
whole_range: VertexRangethe vertex range of this parallel unit consists of all the owning_range of its descendants
owning_range: VertexRangethe vertices owned by this unit, note that owning_range is a subset of whole_range
extra_descendant_mirrored_vertices: HashSet<VertexIndex>the vertices that are mirrored outside of whole_range, in order to propagate a vertex’s sync event to every unit that mirrors it
serial_module: SerialModulethe owned serial dual module
children: Option<(DualModuleParallelUnitWeak<SerialModule>, DualModuleParallelUnitWeak<SerialModule>)>left and right children dual modules
parent: Option<DualModuleParallelUnitWeak<SerialModule>>parent dual module
elevated_dual_nodes: PtrWeakHashSet<DualNodeWeak>elevated dual nodes: whose descendent not on the representative path of a dual node
empty_sync_request: Vec<SyncRequest>an empty sync requests queue just to implement the trait
enable_parallel_execution: boolrun things in thread pool
has_active_node: boolwhether any descendant unit has active dual node
Implementations§
Source§impl<SerialModule: DualModuleImpl + Send + Sync> DualModuleParallelUnit<SerialModule>
impl<SerialModule: DualModuleImpl + Send + Sync> DualModuleParallelUnit<SerialModule>
Sourcepub fn static_fuse(&mut self)
pub fn static_fuse(&mut self)
statically fuse the children of this unit
Sourcepub fn fuse(
&mut self,
parent_interface: &DualModuleInterfacePtr,
children_interfaces: (&DualModuleInterfacePtr, &DualModuleInterfacePtr),
)
pub fn fuse( &mut self, parent_interface: &DualModuleInterfacePtr, children_interfaces: (&DualModuleInterfacePtr, &DualModuleInterfacePtr), )
fuse the children of this unit and also fuse the interfaces of them
pub fn iterative_bias_dual_node_index(&mut self, bias: NodeIndex)
Sourcepub fn is_vertex_in_descendant(&self, vertex_index: VertexIndex) -> bool
pub fn is_vertex_in_descendant(&self, vertex_index: VertexIndex) -> bool
if any descendant unit mirror or own the vertex
Sourcepub fn elevated_dual_nodes_contains_any(&self, nodes: &[DualNodePtr]) -> bool
pub fn elevated_dual_nodes_contains_any(&self, nodes: &[DualNodePtr]) -> bool
check if elevated_dual_nodes contains any dual node in the list
Trait Implementations§
Source§impl<SerialModule: DualModuleImpl + Send + Sync> DualModuleImpl for DualModuleParallelUnit<SerialModule>
We cannot implement async function because a RwLockWriteGuard implements !Send
impl<SerialModule: DualModuleImpl + Send + Sync> DualModuleImpl for DualModuleParallelUnit<SerialModule>
We cannot implement async function because a RwLockWriteGuard implements !Send
Source§fn new_empty(_initializer: &SolverInitializer) -> Self
fn new_empty(_initializer: &SolverInitializer) -> Self
clear all growth and existing dual nodes
Source§fn add_dual_node(&mut self, dual_node_ptr: &DualNodePtr)
fn add_dual_node(&mut self, dual_node_ptr: &DualNodePtr)
add a new dual node from dual module root
Source§fn remove_blossom(&mut self, dual_node_ptr: DualNodePtr)
fn remove_blossom(&mut self, dual_node_ptr: DualNodePtr)
Source§fn set_grow_state(
&mut self,
dual_node_ptr: &DualNodePtr,
grow_state: DualNodeGrowState,
)
fn set_grow_state( &mut self, dual_node_ptr: &DualNodePtr, grow_state: DualNodeGrowState, )
Source§fn compute_maximum_update_length_dual_node(
&mut self,
dual_node_ptr: &DualNodePtr,
is_grow: bool,
simultaneous_update: bool,
) -> MaxUpdateLength
fn compute_maximum_update_length_dual_node( &mut self, dual_node_ptr: &DualNodePtr, is_grow: bool, simultaneous_update: bool, ) -> MaxUpdateLength
DualModuleImpl::compute_maximum_update_length
check the maximum length to grow (shrink) specific dual node, if length is 0, give the reason of why it cannot further grow (shrink).
if is_grow is false, return length <= 0, in any case |length| is maximized so that at least one edge becomes fully grown or fully not-grown.
if simultaneous_update is true, also check for the peer node according to DualNode::grow_state.Source§fn compute_maximum_update_length(&mut self) -> GroupMaxUpdateLength
fn compute_maximum_update_length(&mut self) -> GroupMaxUpdateLength
Source§fn grow_dual_node(&mut self, dual_node_ptr: &DualNodePtr, length: Weight)
fn grow_dual_node(&mut self, dual_node_ptr: &DualNodePtr, length: Weight)
Source§fn grow(&mut self, length: Weight)
fn grow(&mut self, length: Weight)
Source§fn load_edge_modifier(&mut self, edge_modifier: &[(EdgeIndex, Weight)])
fn load_edge_modifier(&mut self, edge_modifier: &[(EdgeIndex, Weight)])
Source§fn prepare_nodes_shrink(
&mut self,
nodes_circle: &[DualNodePtr],
) -> &mut Vec<SyncRequest>
fn prepare_nodes_shrink( &mut self, nodes_circle: &[DualNodePtr], ) -> &mut Vec<SyncRequest>
Source§fn prepare_all(&mut self) -> &mut Vec<SyncRequest>
fn prepare_all(&mut self) -> &mut Vec<SyncRequest>
Source§fn execute_sync_event(&mut self, sync_event: &SyncRequest)
fn execute_sync_event(&mut self, sync_event: &SyncRequest)
Source§fn add_defect_node(&mut self, dual_node_ptr: &DualNodePtr)
fn add_defect_node(&mut self, dual_node_ptr: &DualNodePtr)
Source§fn add_blossom(&mut self, dual_node_ptr: &DualNodePtr)
fn add_blossom(&mut self, dual_node_ptr: &DualNodePtr)
Source§fn load_erasures(&mut self, erasures: &[EdgeIndex])
fn load_erasures(&mut self, erasures: &[EdgeIndex])
fn load_dynamic_weights(&mut self, dynamic_weights: &[(EdgeIndex, Weight)])
Source§fn generate_profiler_report(&self) -> Value
fn generate_profiler_report(&self) -> Value
Source§fn new_partitioned(
_partitioned_initializer: &PartitionedSolverInitializer,
) -> Selfwhere
Self: Sized,
fn new_partitioned(
_partitioned_initializer: &PartitionedSolverInitializer,
) -> Selfwhere
Self: Sized,
Source§fn contains_dual_node(&self, _dual_node_ptr: &DualNodePtr) -> bool
fn contains_dual_node(&self, _dual_node_ptr: &DualNodePtr) -> bool
Source§fn contains_dual_nodes_any(&self, dual_node_ptrs: &[DualNodePtr]) -> bool
fn contains_dual_nodes_any(&self, dual_node_ptrs: &[DualNodePtr]) -> bool
Source§fn contains_vertex(&self, _vertex_index: VertexIndex) -> bool
fn contains_vertex(&self, _vertex_index: VertexIndex) -> bool
Source§fn bias_dual_node_index(&mut self, _bias: NodeIndex)
fn bias_dual_node_index(&mut self, _bias: NodeIndex)
Source§impl<SerialModule: DualModuleImpl + FusionVisualizer + Send + Sync> FusionVisualizer for DualModuleParallelUnit<SerialModule>
impl<SerialModule: DualModuleImpl + FusionVisualizer + Send + Sync> FusionVisualizer for DualModuleParallelUnit<SerialModule>
Auto Trait Implementations§
impl<SerialModule> Freeze for DualModuleParallelUnit<SerialModule>where
SerialModule: Freeze,
impl<SerialModule> !RefUnwindSafe for DualModuleParallelUnit<SerialModule>
impl<SerialModule> Send for DualModuleParallelUnit<SerialModule>
impl<SerialModule> Sync for DualModuleParallelUnit<SerialModule>
impl<SerialModule> Unpin for DualModuleParallelUnit<SerialModule>where
SerialModule: Unpin,
impl<SerialModule> !UnwindSafe for DualModuleParallelUnit<SerialModule>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more