MCPcopy Create free account
hub / github.com/data61/MP-SPDZ / distribute_with_sync

Method distribute_with_sync

Processor/ThreadQueues.cpp:27–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25}
26
27int ThreadQueues::distribute_with_sync(ThreadJob job, int n_items)
28{
29 if (find_available() == 0)
30 return 0;
31
32 auto res = get_n_per_thread(n_items) * get_n_threads(n_items);
33 auto n_threads = get_n_threads(n_items) + (res != n_items);
34 if (OnlineOptions::singleton.has_option("debug_sync"))
35 cerr << "sync " << n_threads << ", res " << res << "/" << n_items
36 << endl;
37 if (n_threads > 1)
38 {
39 assert(not sync_point);
40 sync_point = new barrier(n_threads);
41 }
42 return distribute_no_setup(job, n_items);
43}
44
45int ThreadQueues::find_available()
46{

Callers 1

apply_multipleMethod · 0.80

Calls 2

has_optionMethod · 0.80
get_n_threadsFunction · 0.50

Tested by

no test coverage detected