Skip to content

Commit

Permalink
Add current worker
Browse files Browse the repository at this point in the history
  • Loading branch information
blakestier committed Mar 1, 2022
1 parent ca2c3c1 commit 0047229
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/operators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::log_func;
use crate::pyo3_extensions::{TdPyAny, TdPyCallable, TdPyIterator};
use crate::with_traceback;
use log::debug;
use std::thread;

// These are all shims which map the Timely Rust API into equivalent
// calls to Python functions through PyO3.
Expand Down Expand Up @@ -142,11 +143,13 @@ pub(crate) fn reduce_epoch_local(
all_key_value_in_epoch: &Vec<(TdPyAny, TdPyAny)>,
) {
Python::with_gil(|py| {
let _current = thread::current();
let id = _current.id();
for (key, value) in all_key_value_in_epoch {
let aggregator = aggregators.entry(key.clone_ref(py));
debug!(
"worker_name:{:?}, {}, reducer:{:?}, key:{:?}, value:{:?}, aggregator:{:?}",
worker_name,
"thread:{:?}, {}, reducer:{:?}, key:{:?}, value:{:?}, aggregator:{:?}",
id,
log_func!(),
reducer,
key,
Expand Down

0 comments on commit 0047229

Please sign in to comment.