Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #4082
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <drsalists@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.003 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'received:209.85.212.46': 0.03; 'received:mail-vw0-f46.google.com': 0.03; 'assign': 0.05; 'avoiding': 0.05; 'python?': 0.07; 'python': 0.07; 'can.': 0.09; 'hosts': 0.09; 'libraries.': 0.09; 'pieces': 0.09; 'tasks,': 0.09; 'pm,': 0.11; 'output': 0.12; 'wrote:': 0.14; '4-5': 0.16; 'identifier': 0.16; 'subject:server': 0.16; '\xa0what': 0.16; 'libraries': 0.16; 'protocol': 0.16; 'fine': 0.18; 'input': 0.18; 'tue,': 0.20; 'cc:no real name:2**0': 0.20; 'cc:2**0': 0.20; 'work,': 0.20; 'seems': 0.21; 'header:In-Reply-To:1': 0.22; 'cc:addr:python-list': 0.22; 'connections': 0.22; 'similar,': 0.23; 'objects': 0.24; 'wonder': 0.24; 'received:209.85.212': 0.25; 'somebody': 0.25; 'detect': 0.25; 'expect': 0.26; 'tasks': 0.26; 'tried': 0.27; 'message-id:@mail.gmail.com': 0.28; 'remote': 0.28; 'server': 0.29; 'probably': 0.30; 'least': 0.30; 'implement': 0.30; 'cc:addr:python.org': 0.31; 'effectively.': 0.31; 'queue': 0.31; 'seemingly': 0.31; 'threads.': 0.31; 'url:2007': 0.31; 'anyone': 0.31; '...': 0.32; 'using': 0.34; 'got': 0.34; 'overhead': 0.35; 'running': 0.36; 'rather': 0.36; 'missing': 0.36; 'processing': 0.37; 'two': 0.37; 'some': 0.37; 'should': 0.37; 'received:209.85': 0.37; 'apr': 0.38; 'helped': 0.38; 'lab': 0.38; 'subject:skip:p 10': 0.38; 'thread': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'reasonable': 0.38; 'set': 0.39; 'could': 0.39; 'received:209': 0.39; 'basic': 0.40; 'solution': 0.40; 'student': 0.40; 'would': 0.40; 'header:Received:5': 0.40; 'factor': 0.60; 'simple': 0.60; 'best': 0.60; 'networking': 0.60; 'url:blogspot': 0.61; 'give': 0.61; '2011': 0.62; 'addition': 0.62; 'upon': 0.63; 'unique': 0.63; 'piece': 0.63; '26,': 0.68; 'roughly': 0.68; 'details,': 0.68; 'clients.': 0.69; '100': 0.70; 'lost': 0.71; 'serious': 0.78; 'lose': 0.84; 'average.': 0.84; 'disconnects': 0.84 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=6oXN69DXkQy649VzL75Xg+kpZEnZKLpXzttbEoFfGEs=; b=i2dS8aSR8QKZ4/Rm08X0R/bADtMaWoVf6mn+NflROdR43uY07lgNPB+JNf1EJKw0xA Y1wbPmdz9ic3480LAd20YOJ4uFabqv77oiZI8vGc7hiWfhN6ro0uljKJvuV/xxiNEuYb KCULiq8A93bnsqcvax3v9I7U4w7dN3imYxyjI= |
| DomainKey-Signature | a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=t8IU0RK3jfAiyZPZEjy8elBJgKSOx+9SEM2raotj8TInNbSdRoweAvukmQSs0MMBpC gs+oj5M5QvCgSFc6eobBURAQVPUmjs9bKOYLINvGIqKxGBeNrvOCdER9z19IOGDGp8is 5Gk86Ei9MJ1MP5WpkixAS66Atg+s9IduCKRJs= |
| MIME-Version | 1.0 |
| In-Reply-To | <8ikj88-bs1.ln1@svn.schaathun.net> |
| References | <8ikj88-bs1.ln1@svn.schaathun.net> |
| Date | Tue, 26 Apr 2011 13:31:02 -0700 |
| Subject | Re: client-server parallellised number crunching |
| From | Dan Stromberg <drsalists@gmail.com> |
| To | Hans Georg Schaathun <georg@schaathun.net> |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.873.1303849865.9059.python-list@python.org> (permalink) |
| Lines | 42 |
| NNTP-Posting-Host | 82.94.164.166 |
| X-Trace | 1303849865 news.xs4all.nl 65870 [::ffff:82.94.164.166]:55526 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:4082 |
Show key headers only | View raw
On Tue, Apr 26, 2011 at 12:55 PM, Hans Georg Schaathun <georg@schaathun.net> wrote: > I wonder if anyone has any experience with this ... > > I try to set up a simple client-server system to do some number > crunching, using a simple ad hoc protocol over TCP/IP. I use > two Queue objects on the server side to manage the input and the output > of the client process. A basic system running seemingly fine on a single > quad-core box was surprisingly simple to set up, and it seems to give > me a reasonable speed-up of a factor of around 3-3.5 using four client > processes in addition to the master process. (If anyone wants more > details, please ask.) > > Now, I would like to use remote hosts as well, more precisely, student > lab boxen which are rather unreliable. By experience I'd expect to > lose roughly 4-5 jobs in 100 CPU hours on average. Thus I need some > way of detecting lost connections and requeue unfinished tasks, > avoiding any serious delays in this detection. What is the best way to > do this in python? > > It is, of course, possible for the master thread upon processing the > results, to requeue the tasks for any missing results, but it seems > to me to be a cleaner solution if I could detect disconnects and > requeue the tasks from the networking threads. Is that possible > using python sockets? > > Somebody will probably ask why I am not using one of the multiprocessing > libraries. I have tried at least two, and got trapped by the overhead > of passing complex pickled objects across. Doing it myself has at least > helped me clarify what can be parallelised effectively. Now, > understanding the parallelisable subproblems better, I could try again, > if I can trust that these libraries can robustly handle lost clients. > That I don't know if I can. You probably should assign a unique identifier to each piece of work, and implement two timeouts - one on your socket, using select or poll or similar, and one for the pieces of work based on the identifier. http://gengnosis.blogspot.com/2007/01/level-triggered-and-edge-triggered.html
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar
client-server parallellised number crunching Hans Georg Schaathun <georg@schaathun.net> - 2011-04-26 20:55 +0100
Re: client-server parallellised number crunching Chris Angelico <rosuav@gmail.com> - 2011-04-27 06:20 +1000
Re: client-server parallellised number crunching Dan Stromberg <drsalists@gmail.com> - 2011-04-26 13:31 -0700
Re: client-server parallellised number crunching Dan Stromberg <drsalists@gmail.com> - 2011-04-26 13:33 -0700
Re: client-server parallellised number crunching Hans Georg Schaathun <hg@schaathun.net> - 2011-04-26 21:47 +0100
Re: client-server parallellised number crunching Chris Angelico <rosuav@gmail.com> - 2011-04-27 07:07 +1000
Re: client-server parallellised number crunching Chris Angelico <rosuav@gmail.com> - 2011-04-27 06:35 +1000
Re: client-server parallellised number crunching geremy condra <debatem1@gmail.com> - 2011-04-26 14:31 -0700
Re: client-server parallellised number crunching Hans Georg Schaathun <georg@schaathun.net> - 2011-04-27 06:58 +0100
Re: client-server parallellised number crunching geremy condra <debatem1@gmail.com> - 2011-04-26 23:54 -0700
Re: client-server parallellised number crunching Hans Georg Schaathun <georg@schaathun.net> - 2011-04-27 10:57 +0100
Re: client-server parallellised number crunching Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-27 11:35 +0200
Re: client-server parallellised number crunching Hans Georg Schaathun <hg@schaathun.net> - 2011-04-27 13:21 +0100
Re: client-server parallellised number crunching Chris Angelico <rosuav@gmail.com> - 2011-04-27 23:35 +1000
Re: client-server parallellised number crunching Hans Georg Schaathun <hg@schaathun.net> - 2011-04-27 15:15 +0100
Re: client-server parallellised number crunching Chris Angelico <rosuav@gmail.com> - 2011-04-28 00:58 +1000
Re: client-server parallellised number crunching Hans Georg Schaathun <hg@schaathun.net> - 2011-04-27 19:28 +0100
csiph-web