-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* channel throws if write on closed * manager sets up a threadpool * manager sets up random vector each epoch * Squashed commit of the following: commit 6284db7 Merge: 06d979b b75a7d2 Author: Jonathan Weiss <[email protected]> Date: Sun Dec 11 14:20:26 2022 +0200 Merge branch 'dev' of github.com:elkanatovey/distribicom into dev commit 06d979b Author: Jonathan Weiss <[email protected]> Date: Sun Dec 11 14:20:17 2022 +0200 fix: query_expander construction commit b75a7d2 Author: Elkana Tovey <[email protected]> Date: Sun Dec 11 14:03:55 2022 +0200 Second stage pir (#57) * manager: fix location of commas in test funcs * evaluator: add ptx decomposition mult * evaluator:add test for ptx embedding * evaluator:add ntt transform for EmbeddedCiphertext * server.cpp: minor change for debug mode * code-style fix * new epoch async prepares for frievald. * server.cpp: minor change for debug mode * added test to async query expansion * verify the query_x_rand_vec in debug mod * refactor locking in distribute-work * client_context.hpp: start refactor of clientDB * fx: safelatch introduced * refactor safelatch in its own file * refactor safelatch in its own file * client_context.hpp: refactor client setting manager.hpp: start adding partial work to dbs * client_context.hpp: minor fix for cmake * convert client db mutex to pointer * move ClientDB into manager * matrix_operations.tpp: fix multiplication bug for regular plaintext case evaluator_wrapper.cpp: create method for calculating expansion ratio worker_test.cpp: update according to evaluator wrapper * query_expander.cpp: add version of expansion that returns query as col vector * server: factor db into manager matrix_operations: add sync version of scalar dot product manager: add sync versions of stage two, freivalds still has bugs * removed promise-hell * improved async usage * server.cpp: add partial answer struct to client manager.cpp: add method to store partial work, start calculate final answer worker_test: update per mods to client struct * refactor: queries_dim2 are now not promised * fx: ntt form db multiply with query_vec * ensuring worker-manager ntt forms match * ntt-forms match * matrix_operations.hpp: fix for scalar dot product dims * worker_test.cpp update test for more general query nums. manager.hpp: add comment * ntt query-dim-2 * ledger: added promise for verify_worker * async-verification * integrating with current server * fx: removed comments * duct-tape without sending responses * todos Co-authored-by: Jonathan Weiss <[email protected]> Co-authored-by: elkana <[email protected]>
- Loading branch information
1 parent
416d434
commit e8a63dd
Showing
24 changed files
with
737 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
add_library(concurrency_utils concurrency.h channel.hpp counter.hpp counter.cpp promise.hpp threadpool.hpp threadpool.cpp) | ||
add_library(concurrency_utils concurrency.h channel.hpp counter.hpp counter.cpp promise.hpp threadpool.hpp threadpool.cpp | ||
safelatch.h safelatch.cpp) | ||
cmake_path(GET CMAKE_CURRENT_SOURCE_DIR PARENT_PATH MY_PARENT_DIR) | ||
target_include_directories(concurrency_utils PUBLIC ${MY_PARENT_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "safelatch.h" | ||
|
||
namespace concurrency { | ||
void safelatch::count_down() { | ||
latch::count_down(); | ||
auto prev = safety.fetch_add(-1); | ||
if (prev <= 0) { | ||
throw std::runtime_error( | ||
"count_down:: latch's value is less than 0, this is a bug that can lead to deadlock!"); | ||
} | ||
} | ||
|
||
bool safelatch::done_waiting() { | ||
return safety.load() == 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include <latch> | ||
#include <atomic> | ||
|
||
namespace concurrency { | ||
|
||
class safelatch : public std::latch { | ||
std::atomic<int> safety; | ||
public: | ||
explicit safelatch(int count) : std::latch(count), safety(count) {}; | ||
|
||
bool done_waiting(); | ||
|
||
void count_down(); | ||
|
||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.