Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #2820
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!news-transit.tcx.org.uk!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.kpn.net!pfeed08.wxs.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <philip@semanchuk.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; 'wed,': 0.04; '-0700': 0.07; 'function,': 0.07; 'wrapper': 0.07; 'after,': 0.09; 'to:name:python list': 0.09; 'pm,': 0.11; 'def': 0.13; 'cc:': 0.14; 'modify': 0.14; 'wrote:': 0.14; 'guys,': 0.16; 'it).': 0.16; 'numpy': 0.16; 'objects?': 0.16; 'received:mindspring.com': 0.16; 'simplified': 0.16; 'object,': 0.19; 'header:In-Reply-To:1': 0.22; '(but': 0.22; 'matter,': 0.23; 'runs': 0.24; 'example': 0.24; 'checked': 0.25; "i'm": 0.26; '(in': 0.27; 'object': 0.27; 'url:mailman': 0.27; 'function': 0.27; 'date:': 0.28; "doesn't": 0.28; 'thanks': 0.29; 'shared': 0.29; 'hi,': 0.29; 'list': 0.30; 'do.': 0.31; 'extremely': 0.31; 'arrays': 0.31; 'basically,': 0.31; 'turns': 0.31; 'random': 0.31; 'sharing': 0.31; 'url:library': 0.31; 'import': 0.32; 'to:addr:python-list': 0.32; 'url:listinfo': 0.33; 'url:docs': 0.33; 'execution': 0.33; 'subject:': 0.33; 'several': 0.33; 'updated': 0.33; 'there': 0.35; 'print': 0.35; 'charset:us-ascii': 0.36; 'some': 0.37; 'however': 0.37; 'should': 0.37; 'url:python': 0.37; 'run': 0.37; 'apr': 0.38; 'parallel': 0.38; 'thread': 0.38; 'but': 0.38; 'url:org': 0.38; 'current': 0.38; 'to:addr:python.org': 0.39; 'from:': 0.39; 'header:Mime-Version:1': 0.39; 'received:24': 0.39; 'works': 0.40; 'would': 0.40; 'give': 0.61; 'order': 0.61; 'header:Message-Id:1': 0.62; '2011': 0.62; 'here': 0.65; 'response.': 0.67; 'email addr:hotmail.com': 0.71; 'received:69.73': 0.84 |
| Content-Type | text/plain; charset=us-ascii |
| Mime-Version | 1.0 (Apple Message framework v1082) |
| Subject | Re: multiprocessing |
| From | Philip Semanchuk <philip@semanchuk.com> |
| In-Reply-To | <COL113-W293751B1719D5A92C6FCBDDCA70@phx.gbl> |
| Date | Thu, 7 Apr 2011 21:05:23 -0400 |
| Content-Transfer-Encoding | quoted-printable |
| References | <BANLkTinjS8+dHt4eGDjjLfJogiJeaX7+qg@mail.gmail.com> <COL113-W293751B1719D5A92C6FCBDDCA70@phx.gbl> |
| To | Python list <python-list@python.org> |
| X-Mailer | Apple Mail (2.1082) |
| X-AntiAbuse | This header was added to track abuse, please include it with any abuse report |
| X-AntiAbuse | Primary Hostname - deimos.nocdirect.com |
| X-AntiAbuse | Original Domain - python.org |
| X-AntiAbuse | Originator/Caller UID/GID - [47 12] / [47 12] |
| X-AntiAbuse | Sender Address Domain - semanchuk.com |
| 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.127.1302224729.9059.python-list@python.org> (permalink) |
| Lines | 123 |
| NNTP-Posting-Host | 82.94.164.166 |
| X-Trace | 1302224730 news.xs4all.nl 34849 [::ffff:82.94.164.166]:33117 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:2820 |
Show key headers only | View raw
On Apr 7, 2011, at 8:57 PM, Kerensa McElroy wrote:
>
> Hi,
>
> thanks for your response.
>
> I checked out multiprocessing.value, however from what I can make out, it works with object of only a very limited type. Is there a way to do this for more complex objects? (In reality, my object is a large multi-dimensional numpy array).
Elsa,
Are you following the current thread in this list which is talking about sharing numpy arrays via multiprocessing?
http://mail.python.org/pipermail/python-list/2011-April/1269173.html
> Date: Wed, 6 Apr 2011 22:20:06 -0700
> Subject: Re: multiprocessing
> From: drsalists@gmail.com
> To: kerensaelise@hotmail.com
> CC: python-list@python.org
>
>
> On Wed, Apr 6, 2011 at 9:06 PM, elsa <kerensaelise@hotmail.com> wrote:
>
> Hi guys,
>
>
>
> I want to try out some pooling of processors, but I'm not sure if it
>
> is possible to do what I want to do. Basically, I want to have a
>
> global object, that is updated during the execution of a function, and
>
> I want to be able to run this function several times on parallel
>
> processors. The order in which the function runs doesn't matter, and
>
> the value of the object doesn't matter to the function, but I do want
>
> the processors to take turns 'nicely' when updating the object, so
>
> there are no collisions. Here is an extremely simplified and trivial
>
> example of what I have in mind:
>
>
>
> from multiprocessing import Pool
>
> import random
>
>
>
> p=Pool(4)
>
> myDict={}
>
>
>
> def update(value):
>
> global myDict
>
> index=random.random()
>
> myDict[index]+=value
>
>
>
> total=1000
>
>
>
> p.map(update,range(total))
>
>
>
>
>
> After, I would also like to be able to use several processors to
>
> access the global object (but not modify it). Again, order doesn't
>
> matter:
>
>
>
> p1=Pool(4)
>
>
>
> def getValues(index):
>
> global myDict
>
> print myDict[index]
>
>
>
> p1.map(getValues,keys.myDict)
>
>
>
> Is there a way to do this
> This should give you a synchronized wrapper around an object in shared memory:
>
> http://docs.python.org/library/multiprocessing.html#multiprocessing.Value
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar
multiprocessing elsa <kerensaelise@hotmail.com> - 2011-04-06 21:06 -0700 Re: multiprocessing Philip Semanchuk <philip@semanchuk.com> - 2011-04-07 21:05 -0400
csiph-web