| 11 | const static int length = 1; |
| 12 | |
| 13 | int main(int argc, char** argv) { |
| 14 | |
| 15 | parse_party_and_port(argv, &party, &port); |
| 16 | printf("party:%d port:%d\n",party,port); |
| 17 | if(party > nP)return 0; |
| 18 | |
| 19 | NetIOMP<nP> io(party, port); |
| 20 | ThreadPool pool(4); |
| 21 | PRG prg; |
| 22 | |
| 23 | |
| 24 | int64_t* r_value = new int64_t[length]; |
| 25 | memset(r_value, 0, length * sizeof(int64_t)); |
| 26 | int64_t mask_input = 0; |
| 27 | prg.random_data(r_value,length*sizeof(int64_t)); |
| 28 | |
| 29 | GMWprotocolA<nP>* gmw = new GMWprotocolA<nP>(&io,&pool,party); |
| 30 | |
| 31 | |
| 32 | |
| 33 | #ifdef ReLU_comm |
| 34 | if (party != 1) { |
| 35 | io.recv_data(1, &mask_input, 64*sizeof(bool)); |
| 36 | io.flush(1); |
| 37 | } |
| 38 | else { |
| 39 | vector<future<void>> res; |
| 40 | for(int i = 2; i <= nP; ++i) { |
| 41 | int party2 = i; |
| 42 | res.push_back(pool.enqueue([&io, mask_input, party2]() { |
| 43 | io.send_data(party2, &mask_input, 64*sizeof(bool)); |
| 44 | io.flush(party2); |
| 45 | })); |
| 46 | } |
| 47 | joinNclean(res); |
| 48 | } |
| 49 | |
| 50 | mpc->GMW_A->open(r_value,r_value); |
| 51 | |
| 52 | |
| 53 | if (party == 2) |
| 54 | { |
| 55 | uint64_t band2 = io.count(); |
| 56 | cout <<"ReLU bandwidth\t"<<party<<"\t"<<band2<<endl; |
| 57 | } |
| 58 | #endif |
| 59 | |
| 60 | #ifdef EMPDM_ReLU_comm |
| 61 | |
| 62 | |
| 63 | auto start2 = clock_start(); |
| 64 | gmw->open_vec(r_value,r_value,length); |
| 65 | |
| 66 | |
| 67 | // gmw->open_vec(r_value+length/2,r_value+length/2,length/2); |
| 68 | double timeused2 = time_from(start2); |
| 69 | cout << "Parallel time used: " << timeused2 / 1000 << " ms" << endl; |
| 70 |
nothing calls this directly
no test coverage detected