Skip to content

Commit

Permalink
Send full integer values in client interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkskeller committed Feb 12, 2024
1 parent b9401ae commit 7c49142
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ExternalIO/bankers-bonus-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int main(int argc, char** argv)
int my_client_id;
int nparties;
double salary_value;
int finish;
size_t finish;
int port_base = 14000;

if (argc < 5) {
Expand Down
2 changes: 1 addition & 1 deletion ExternalIO/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def Receive(self, socket):
self.ptr = 0

def store(self, value):
self.buf += struct.pack('<i', value)
self.buf += struct.pack('<q', value)

def get_int(self, length):
buf = self.consume(length)
Expand Down
10 changes: 4 additions & 6 deletions Processor/Processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ void Processor<sint, sgf2n>::write_socket(const RegType reg_type,
}
else if (reg_type == INT)
{
// Send vector of 32-bit clear ints
socket_stream.store((int&) get_Ci_ref(registers[i] + j));
// Send vector of 64-bit clear ints
socket_stream.store(get_Ci_ref(registers[i] + j));
}
else
{
Expand Down Expand Up @@ -330,7 +330,7 @@ void Processor<sint, sgf2n>::write_socket(const RegType reg_type,
}


// Receive vector of 32-bit clear ints
// Receive vector of 64-bit clear ints
template<class sint, class sgf2n>
void Processor<sint, sgf2n>::read_socket_ints(int client_id,
const vector<int>& registers, int size)
Expand All @@ -344,9 +344,7 @@ void Processor<sint, sgf2n>::read_socket_ints(int client_id,
for (int j = 0; j < size; j++)
for (int i = 0; i < m; i++)
{
int val;
socket_stream.get(val);
write_Ci(registers[i] + j, (long) val);
write_Ci(registers[i] + j, socket_stream.get_int(8));
}
}

Expand Down

0 comments on commit 7c49142

Please sign in to comment.