Minimizing Communication/Running Time in Parallel Executions

35 views
Skip to first unread message

Doruk Gür

unread,
Aug 4, 2022, 1:02:57 PM8/4/22
to SPDZ/SCALE-MAMBA Discussion Group
Hello all, 

I am trying to minimize the running time for elementwise operations I am doing. Basically there are multiple arrays of n elements which do the same operation on each element. To sum up, the order of operations look something like this:

Array 3  = Array 1 >= 0
Array 4 = Array 1 + Array 2 >= 0 
Array 5 = Several multiplications and additions based on Arrays 1,2,3,4
Array 6 = Array 1 - Array 5

The immediate solution seems to be using vectorized operations, which I did and seems to be working fine, compiling without the "-n" flag and hence having constant number of rounds as expected. However I was wondering if this could be faster using multiple threads instead. I have tried to convert this into a simple multithread version using @for_range_multithread() however it doesn't seem to work without the "-n" flag, which slows down the execution in general. 

I have read somewhere that only thread 0 has IO capabilities since synchronizing different threads in different players would be a nightmare to deal with so it is best to use threads in local operations that do not require communication. But I have seen an example with multiplication of secret integers within the thread. 

So I am curious if there is a proper way to do elementwise comparisons and multiplications within different threads with constant number of rounds that I am not aware of or threading is useful for mostly local operations? Or alternatively, would the vectorized operations be as fast as it will get?

Best regards and thanks,  
Reply all
Reply to author
Forward
0 new messages