Index: src/solver/sync.rs ================================================================== --- src/solver/sync.rs +++ src/solver/sync.rs @@ -396,10 +396,16 @@ /// Time when the solution process started. /// /// This is actually the time of the last call to `Solver::init`. start_time: Instant, + + /// Time when the last master problem evaluation started. + start_master_time: Instant, + + /// Time when the last subproblem evaluation started. + start_eval_time: Instant, } impl Solver where P: FirstOrderProblem, @@ -435,10 +441,12 @@ cnt_descent: 0, cnt_null: 0, cnt_evals: 0, start_time: Instant::now(), + start_master_time: Instant::now(), + start_eval_time: Instant::now(), } } /// Return the underlying threadpool. /// @@ -614,10 +622,11 @@ if let Some(ref mut master_proc) = self.master_proc { // Continue the solution process, start with a new master // problem evaluation. if !self.data.cur_val.is_infinite() { + self.start_master_time = Instant::now(); master_proc.solve(self.data.cur_val)?; } } else { // No master problem, initialize solver. self.init()?; @@ -633,11 +642,14 @@ return Ok(false); } } Message::Update(_) => warn!("Ignore unexpected problem update message from client"), Message::Master(mresponse) => { - debug!("Receive master response"); + debug!( + "Receive master response (time: {})", + self.start_master_time.elapsed().as_millis() as f64 / 1000.0 + ); // Receive result (new candidate) from the master if self.handle_master_response(mresponse)? { return Ok(true); } } @@ -685,11 +697,14 @@ let descent_bnd = Self::get_descent_bound(self.params.acceptance_factor, &self.data); self.data.nxt_val = nxt_ub; self.data.new_cutval = self.data.nxt_cutvals.iter().sum::(); - debug!("Step"); + debug!( + "Step (time: {)", + self.start_eval_time.elapsed().as_millis() as f64 / 1000.0 + ); debug!(" cur_val ={}", self.data.cur_val); debug!(" nxt_mod ={}", self.data.nxt_mod); debug!(" nxt_ub ={}", nxt_ub); debug!(" descent_bnd={}", descent_bnd); @@ -743,10 +758,11 @@ } if self.data.cnt_iter < self.data.max_iter { // Compute the new candidate. The main loop will wait for the result of // this solution process of the master problem. + self.start_master_time = Instant::now(); self.master_proc.as_mut().unwrap().solve(self.data.cur_val)?; Ok(false) } else { Ok(true) } @@ -809,10 +825,11 @@ .resize(self.problem.num_subproblems(), -Real::infinity()); self.data.cnt_remaining_mins = self.problem.num_subproblems(); // Start evaluation of all subproblems at the new candidate. let client_tx = self.client_tx.as_ref().ok_or(Error::NotInitialized)?; + self.start_eval_time = Instant::now(); for i in 0..self.problem.num_subproblems() { self.problem .evaluate( i, self.data.nxt_y.clone(),