PrimalModuleParallel

Struct PrimalModuleParallel 

Source
pub struct PrimalModuleParallel {
    pub units: Vec<PrimalModuleParallelUnitPtr>,
    pub config: PrimalModuleParallelConfig,
    pub partition_info: Arc<PartitionInfo>,
    pub thread_pool: Arc<ThreadPool>,
    pub last_solve_start_time: ArcRwLock<Instant>,
}

Fields§

§units: Vec<PrimalModuleParallelUnitPtr>

the basic wrapped serial modules at the beginning, afterwards the fused units are appended after them

§config: PrimalModuleParallelConfig

local configuration

§partition_info: Arc<PartitionInfo>

partition information generated by the config

§thread_pool: Arc<ThreadPool>

thread pool used to execute async functions in parallel

§last_solve_start_time: ArcRwLock<Instant>

Implementations§

Source§

impl PrimalModuleParallel

Source

pub fn new_config( initializer: &SolverInitializer, partition_info: &PartitionInfo, config: PrimalModuleParallelConfig, ) -> Self

recommended way to create a new instance, given a customized configuration

Source§

impl PrimalModuleParallel

Source

pub fn parallel_solve<DualSerialModule: DualModuleImpl + Send + Sync>( &mut self, syndrome_pattern: &SyndromePattern, parallel_dual_module: &DualModuleParallel<DualSerialModule>, )

Source

pub fn parallel_solve_visualizer<DualSerialModule: DualModuleImpl + Send + Sync + FusionVisualizer>( &mut self, syndrome_pattern: &SyndromePattern, parallel_dual_module: &DualModuleParallel<DualSerialModule>, visualizer: Option<&mut Visualizer>, )

Source

pub fn parallel_solve_step_callback<DualSerialModule: DualModuleImpl + Send + Sync, F>( &mut self, syndrome_pattern: &SyndromePattern, parallel_dual_module: &DualModuleParallel<DualSerialModule>, callback: F, )

Trait Implementations§

Source§

impl FusionVisualizer for PrimalModuleParallel

Source§

fn snapshot(&self, abbrev: bool) -> Value

take a snapshot, set abbrev to true to save space
Source§

impl PrimalModuleImpl for PrimalModuleParallel

Source§

fn new_empty(initializer: &SolverInitializer) -> Self

create a primal module given the dual module
Source§

fn clear(&mut self)

clear all states; however this method is not necessarily called when load a new decoding problem, so you need to call it yourself
Source§

fn load_defect_dual_node(&mut self, _dual_node_ptr: &DualNodePtr)

Source§

fn resolve<D: DualModuleImpl>( &mut self, _group_max_update_length: GroupMaxUpdateLength, _interface: &DualModuleInterfacePtr, _dual_module: &mut D, )

analyze the reason why dual module cannot further grow, update primal data structure (alternating tree, temporary matches, etc) and then tell dual module what to do to resolve these conflicts; note that this function doesn’t necessarily resolve all the conflicts, but can return early if some major change is made. when implementing this function, it’s recommended that you resolve as many conflicts as possible.
Source§

fn intermediate_matching<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, ) -> IntermediateMatching

return a matching that can possibly include blossom nodes: this does not affect dual module
Source§

fn generate_profiler_report(&self) -> Value

performance profiler report
Source§

fn load_defect<D: DualModuleImpl>( &mut self, defect_vertex: VertexIndex, interface_ptr: &DualModuleInterfacePtr, dual_module: &mut D, )

load a single syndrome and update the dual module and the interface
Source§

fn load(&mut self, interface_ptr: &DualModuleInterfacePtr)

load a new decoding problem given dual interface: note that all nodes MUST be syndrome node
Source§

fn perfect_matching<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, ) -> PerfectMatching

break down the blossoms to find the final matching; this function will take more time on the dual module
Source§

fn solve<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, )

Source§

fn solve_visualizer<D: DualModuleImpl + FusionVisualizer>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, visualizer: Option<&mut Visualizer>, )
where Self: FusionVisualizer + Sized,

Source§

fn solve_step_callback<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, callback: F, )

Source§

fn solve_step_callback_interface_loaded<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, callback: F, )

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V