Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Program gets killed during compilation time #1513

Open
kkc2894 opened this issue Oct 5, 2024 · 0 comments
Open

Program gets killed during compilation time #1513

kkc2894 opened this issue Oct 5, 2024 · 0 comments

Comments

@kkc2894
Copy link

kkc2894 commented Oct 5, 2024

I am using the machine based on "malicious-shamir-party reading" and trying to read a file with approx 100M numbers. After reading each element I am storing in an array of sint type. Further for a query, I am searching the count of elements equal to search query using a==b command. This setup work up to 1k element but after that program gets killed.

[1]+ Killed Scripts/compile-run.py -E mal-shamir python_test -- -N 3

I am using docker images to run the system. Could you please help?

The underlying code:

def read_numbers_from_file(filename):
with open(filename, 'r') as file:
num_rows = 1000
numbers = Array(num_rows, sint)
count = 0
while count < num_rows:
line = file.readline()
if line:
numbers[count] = sint(int(line.strip()))
count += 1 # Increment the counter
else:
break
return numbers

filename = 'data_1M.csv'
numbers = read_numbers_from_file(filename)

search_query=sint(1)
count = sint(0)
length=len(numbers)

def equality_test():
for i in range(len(numbers)):
count.iadd(numbers[i] == search_query)

equality_test()
print_ln('Count for %s is %s',search_query.reveal(), count.reveal())

I even tried the below version of the code:

program.use_edabit(True)
def read_numbers():
numbers=sint.get_input_from(0, size=1000000)
b = sint.get_input_from(1)
eq_bits = [x == b for x in numbers]
b_in_a = sum(eq_bits)
print_ln("Count of %s is %s",b.reveal(), b_in_a.reveal())

read_numbers()

Party 0 has 1M numbers in Input_P0_0 file under Player_Data folder
Party 1 has 1 number in Input_P1_0 file under Player_Data folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant