Re: [viff-devel] Mystery of the quadratic running time solved?

2009-03-10 Thread Marcel Keller

Hi Ivan,

I just wanted to say that I think it would be great if you would 
implement a version of your proposed two-threaded solution. I do not 
have a firm grasp of all the programming details, but it does seem that 
the overall idea is converging, and that some time soon the best way to 
judge the idea is to go ahead and do it.


OK, i will start doing it next Monday.

Note that Alexandra is committed to using a non-trivial amount of 
resources on developing VIFF and related software. Although this may not 
mean that lots of man-hours are available just now, it might be possible 
that they could help you.
It may also be more efficient that one guy does it in the first 
iteration, I'll leave this up to you.


Since it doesn't seem that complicated to me, I will try it on my own 
first. But I keep that in mind for the case that I'm wrong.


Note that myself, Martin and Jakob will not be at the meeting Thursday. 
Maybe we should postpone the meeting until next week?


Me neither, I'm on holidays until the weekend. Therefore, I would agree 
to postpone the meeting.


Best regards,
Marcel

___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] Mystery of the quadratic running time solved?

2009-03-09 Thread Martin Geisler
Marcel Keller mkel...@cs.au.dk writes:

 You're talking about this two-threaded solution as if it is something
 that exists and will solve all our problems...

 No, for now, it's just an imagination in my mind, a proposal for the
 next meeting, and a strong feeling that it's the right way to do it.

Yeah, I think it would help too.

 But I still haven't seen it, and I would like to see how you can
 cleanly seperate the work of the two threads. I'm afraid that the
 threads will be alternating between working and waiting on the other
 thread in such a way that we could just as well use one thread.

 My idea is that the Twisted main loop runs in one thread and most of
 the VIFF code in the other. The Twisted thread only waits for I/O and
 the VIFF thread only waits if there is no work to be done.

It's funny -- then we'll have sort of two event loops.

 If the group decides to give this idea a try, I would be happy to
 implement it. I would claim that it can be done in one or two weeks.

So you'll have something when I get back from PKC? :) Seriously, I think
you're right, the code is fairly well partitioned already, so we should
be able to make this change without too much trouble.

 Also, threading in Python is unfortunately not optimal :-( The Python
 VM will use a single thread to execute the bytecode, even when using
 multiple thread in Python. It is only if the threads do things
 blocking for I/O that you will see a performance increase by using
 multiple threads.

 I'm aware that Python only runs on one CPU, a friend pointed that out
 to me today. However, the Twisted thread mentioned above would block
 on I/O.

Right, that should help us! Janus has been looking more into Python
threads, so be sure to discuss it with him too.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


pgpNe3r9JiJcA.pgp
Description: PGP signature
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] Mystery of the quadratic running time solved?

2009-03-08 Thread Marcel Keller

You're talking about this two-threaded solution as if it is something
that exists and will solve all our problems...


No, for now, it's just an imagination in my mind, a proposal for the 
next meeting, and a strong feeling that it's the right way to do it.



But I still haven't seen it, and I would like to see how you can cleanly
seperate the work of the two threads. I'm afraid that the threads will
be alternating between working and waiting on the other thread in such a
way that we could just as well use one thread.


My idea is that the Twisted main loop runs in one thread and most of the 
VIFF code in the other. The Twisted thread only waits for I/O and the 
VIFF thread only waits if there is no work to be done.


If the group decides to give this idea a try, I would be happy to 
implement it. I would claim that it can be done in one or two weeks.



Also, threading in Python is unfortunately not optimal :-( The Python VM
will use a single thread to execute the bytecode, even when using
multiple thread in Python. It is only if the threads do things blocking
for I/O that you will see a performance increase by using multiple
threads.


I'm aware that Python only runs on one CPU, a friend pointed that out to 
me today. However, the Twisted thread mentioned above would block on I/O.


___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] Mystery of the quadratic running time solved?

2009-03-07 Thread Martin Geisler
Marcel Keller mkel...@cs.au.dk writes:

 Indeed we did not know (well I didn't) back then that the data was
 not sent immediately by Twisted, and I was starting to think
 yesterday whether the hack would make a difference. Lucky for us, it
 apparently does :)

 That is not the only problem. To free the memory of the shares and to
 send out further shares, also the incoming shares must be processed as
 soon as possible. This is even trickier because incoming shares might
 trigger code that calls functions sending out data, which activates
 the Twisted reactor again and therefore leads to a possibly too deep
 recursion. I think I have a solution for that, it just wasn't
 necessary to implement it for now because the hack worked anyway.

I guess we could simply not recurse if the recursion depth is too big?

At some point we have to let the recursive calls finish in order to let
the local variables and stack frames be garbage collected.

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


pgpp6C0lL7dUL.pgp
Description: PGP signature
___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] Mystery of the quadratic running time solved?

2009-03-06 Thread Marcel Keller
Indeed we did not know 
(well I didn't) back then that the data was not sent immediately by 
Twisted, and I was starting to think yesterday whether the hack would 
make a difference. Lucky for us, it apparently does :)


That is not the only problem. To free the memory of the shares and to 
send out further shares, also the incoming shares must be processed as 
soon as possible. This is even trickier because incoming shares might 
trigger code that calls functions sending out data, which activates the 
Twisted reactor again and therefore leads to a possibly too deep 
recursion. I think I have a solution for that, it just wasn't necessary 
to implement it for now because the hack worked anyway.

___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk


Re: [viff-devel] Mystery of the quadratic running time solved?

2009-03-06 Thread Mikkel Krøigård

Citat af Marcel Keller mkel...@cs.au.dk:

Indeed we did not know (well I didn't) back then that the data was  
not sent immediately by Twisted, and I was starting to think  
yesterday whether the hack would make a difference. Lucky for us,  
it apparently does :)


That is not the only problem. To free the memory of the shares and  
to send out further shares, also the incoming shares must be  
processed as soon as possible. This is even trickier because  
incoming shares might trigger code that calls functions sending out  
data, which activates the Twisted reactor again and therefore leads  
to a possibly too deep recursion. I think I have a solution for  
that, it just wasn't necessary to implement it for now because the  
hack worked anyway.


Ah, but the numbers I had been shown did not indicate we were anywhere  
near running out of memory. That's not to say memory isn't important  
(it certainly will be in cases with huge amounts of operations), I  
just didn't think it had anything to do with our specific test cases  
for the paper.


___
viff-devel mailing list (http://viff.dk/)
viff-devel@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-devel-viff.dk