RsBundle  Diff

Differences From Artifact [c1eaa5ce8f]:

  • File src/solver/sync.rs — part of check-in [c9e9d1b177] at 2020-06-14 14:30:38 on branch error — Reorder `MErr` and `PErr` arguments (user: fifr size: 31697)

To Artifact [55e021cf5f]:

  • File src/solver/sync.rs — part of check-in [f38015073f] at 2020-06-14 18:10:32 on branch error — masterprocess: add some type aliases for `Error` and `Result` (user: fifr size: 31677)

29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
29
30
31
32
33
34
35

36
37
38
39
40
41
42
43







-
+







use threadpool::ThreadPool;

use crate::{DVector, Real};

use super::channels::{
    ChannelResultSender, ChannelUpdateSender, ClientReceiver, ClientSender, EvalResult, Message, Update,
};
use super::masterprocess::{self, MasterConfig, MasterProcess, MasterResponse, Response};
use super::masterprocess::{MasterConfig, MasterError, MasterProcess, MasterResponse, Response};
use crate::master::{Builder as MasterBuilder, MasterProblem};
use crate::problem::{FirstOrderProblem, UpdateState};
use crate::terminator::{StandardTerminatable, StandardTerminator, Terminator};
use crate::weighter::{HKWeightable, HKWeighter, Weighter};

/// The default iteration limit.
pub const DEFAULT_ITERATION_LIMIT: usize = 10_000;
134
135
136
137
138
139
140
141

142
143
144
145
146


147
148
149
150
151
152
153
134
135
136
137
138
139
140

141
142
143
144


145
146
147
148
149
150
151
152
153







-
+



-
-
+
+







            Evaluation(err) => Some(err),
            Process(err) => Some(err),
            _ => None,
        }
    }
}

impl<PErr, MErr> From<masterprocess::Error<PErr, MErr>> for Error<PErr, MErr>
impl<PErr, MErr> From<MasterError<PErr, MErr>> for Error<PErr, MErr>
where
    MErr: std::error::Error + 'static,
{
    fn from(err: masterprocess::Error<PErr, MErr>) -> Error<PErr, MErr> {
        use masterprocess::Error::*;
    fn from(err: MasterError<PErr, MErr>) -> Error<PErr, MErr> {
        use MasterError::*;
        match err {
            DisconnectedSender => Error::Disconnected,
            DisconnectedReceiver => Error::Disconnected,
            Aggregation(err) => Error::Master(err),
            SubgradientExtension(err) => Error::Update(err),
            Master(err) => Error::Master(err),
        }