MCPcopy Create free account
hub / github.com/NthTensor/Forte / random_tree_inner

Function random_tree_inner

src/scope.rs:1377–1393  ·  view source on GitHub ↗
(
        depth: usize,
        rng: &mut XorShift64Star,
    )

Source from the content-addressed store, hash-verified

1375 assert!(completed);
1376
1377 THREAD_POOL.depopulate();
1378 }
1379
1380 /// Tests that a serial and parallel version of a binary tree traversal
1381 /// produces the same output.
1382 #[test]
1383 fn scope_divide_and_conquer() {
1384 static THREAD_POOL: ThreadPool = ThreadPool::new();
1385 THREAD_POOL.resize_to_available();
1386
1387 let counter_p = &AtomicUsize::new(0);
1388 THREAD_POOL.with_worker(|worker| {
1389 worker.scope(|scope| {
1390 scope.spawn(move |_: &Worker| {
1391 divide_and_conquer(scope, counter_p, 1024)
1392 })
1393 });
1394 });
1395
1396 let counter_s = &AtomicUsize::new(0);

Callers 1

random_treeFunction · 0.85

Calls 1

next_usizeMethod · 0.80

Tested by

no test coverage detected