change parameter to be about sending instead of directly specifying bucket

This commit is contained in:
Andrew Morris
2025-01-29 09:17:40 +11:00
parent 60eddd343b
commit 85f65c34ba
2 changed files with 11 additions and 8 deletions

View File

@@ -39,11 +39,11 @@ class ABitMP { public:
for(int i = 1; i <= nP; ++i) for(int j = 1; j <= nP; ++j) if(i < j) {
if(i == party) {
abit1[j].emplace(io->get(j, false));
abit2[j].emplace(io->get(j, true));
abit1[j].emplace(io->get(j, false));
abit2[j].emplace(io->get(j, true));
} else if (j == party) {
abit2[i].emplace(io->get(i, false));
abit1[i].emplace(io->get(i, true));
abit2[i].emplace(io->get(i, true));
abit1[i].emplace(io->get(i, false));
}
}

View File

@@ -94,10 +94,13 @@ class NetIOMP { public:
else
ios2[src]->recv_data(data, len);
}
IOChannel& get(size_t idx, bool b = false){
if (b)
return *ios[idx];
else return *ios2[idx];
IOChannel& get(int party2, bool send) {
assert(party2 != 0);
assert(party2 != party);
bool firstBucket = send == (party < party2);
return firstBucket ? *ios[party2] : *ios2[party2];
}
void flush(int idx = 0) {