Re: multiprocessing module and matplotlib.pyplot/PdfPages

2015-04-23 Thread Oscar Benjamin
On 21 April 2015 at 16:53, Paulo da Silva wrote: > On 21-04-2015 11:26, Dave Angel wrote: >> On 04/20/2015 10:14 PM, Paulo da Silva wrote: >>> I have program that generates about 100 relatively complex graphics and >>> writes then to a pdf book. >>> It takes a while! >>> Is there any possibility o

Re: multiprocessing module and matplotlib.pyplot/PdfPages

2015-04-22 Thread Paulo da Silva
On 21-04-2015 03:14, Paulo da Silva wrote: > I have program that generates about 100 relatively complex graphics and > writes then to a pdf book. > It takes a while! > Is there any possibility of using multiprocessing to build the graphics > and then use several calls to savefig(), i.e. some kind o

Re: multiprocessing module and matplotlib.pyplot/PdfPages

2015-04-21 Thread Dave Angel
On 04/21/2015 07:54 PM, Dennis Lee Bieber wrote: On Tue, 21 Apr 2015 18:12:53 +0100, Paulo da Silva declaimed the following: Yes. fork will do that. I have just looked at it and it is the same as unix fork (module os). I am thinking of launching several forks that will produce .png images an

Re: multiprocessing module and matplotlib.pyplot/PdfPages

2015-04-21 Thread Rob Gaddi
On Tue, 21 Apr 2015 03:14:09 +0100, Paulo da Silva wrote: > I have program that generates about 100 relatively complex graphics and > writes then to a pdf book. > It takes a while! > Is there any possibility of using multiprocessing to build the graphics > and then use several calls to savefig(),

Re: multiprocessing module and matplotlib.pyplot/PdfPages

2015-04-21 Thread Paulo da Silva
On 21-04-2015 16:58, Chris Angelico wrote: > On Wed, Apr 22, 2015 at 1:53 AM, Paulo da Silva > wrote: >> Yes, I have 8 cores and the graphics' processes calculation are all >> independent. The problem I have is that if there is any way to generate >> independent figures in matplotlib. The logic se

Re: multiprocessing module and matplotlib.pyplot/PdfPages

2015-04-21 Thread Chris Angelico
On Wed, Apr 22, 2015 at 1:53 AM, Paulo da Silva wrote: > Yes, I have 8 cores and the graphics' processes calculation are all > independent. The problem I have is that if there is any way to generate > independent figures in matplotlib. The logic seems to be build the > graphic and save it. I was t

Re: multiprocessing module and matplotlib.pyplot/PdfPages

2015-04-21 Thread Paulo da Silva
On 21-04-2015 11:26, Dave Angel wrote: > On 04/20/2015 10:14 PM, Paulo da Silva wrote: >> I have program that generates about 100 relatively complex graphics and >> writes then to a pdf book. >> It takes a while! >> Is there any possibility of using multiprocessing to build the graphics >> and then

Re: multiprocessing module and matplotlib.pyplot/PdfPages

2015-04-21 Thread Dave Angel
On 04/20/2015 10:14 PM, Paulo da Silva wrote: I have program that generates about 100 relatively complex graphics and writes then to a pdf book. It takes a while! Is there any possibility of using multiprocessing to build the graphics and then use several calls to savefig(), i.e. some kind of gra

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-30 Thread Sturla Molden
On 30/01/15 23:25, Marko Rauhamaa wrote: Sturla Molden : Only a handful of POSIX functions are required to be "fork safe", i.e. callable on each side of a fork without an exec. That is a pretty surprising statement. Forking without an exec is a routine way to do multiprocessing. I understand

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-30 Thread Marko Rauhamaa
Sturla Molden : > Only a handful of POSIX functions are required to be "fork safe", i.e. > callable on each side of a fork without an exec. That is a pretty surprising statement. Forking without an exec is a routine way to do multiprocessing. I understand there are things to consider, but all sy

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-30 Thread Sturla Molden
Andres Riancho wrote: > Spawn, and I took that from the multiprocessing 3 documentation, will > create a new process without using fork(). > This means that no memory > is shared between the MainProcess and the spawn'ed sub-process created > by multiprocessing. If you memory map a segment with

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-30 Thread Sturla Molden
Skip Montanaro wrote: > Can you explain what you see as the difference between "spawn" and "fork" > in this context? Are you using Windows perhaps? I don't know anything > obviously different between the two terms on Unix systems. spawn is fork + exec. Only a handful of POSIX functions are requ

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-29 Thread Andres Riancho
On Wed, Jan 28, 2015 at 3:06 PM, Skip Montanaro wrote: > > On Wed, Jan 28, 2015 at 7:07 AM, Andres Riancho > wrote: >> >> The feature I'm specially interested in is the ability to spawn >> processes [1] instead of forking, which is not present in the 2.7 >> version of the module. > > > Can you ex

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-28 Thread Devin Jeanpierre
On Wed, Jan 28, 2015 at 10:06 AM, Skip Montanaro wrote: > On Wed, Jan 28, 2015 at 7:07 AM, Andres Riancho > wrote: >> The feature I'm specially interested in is the ability to spawn >> processes [1] instead of forking, which is not present in the 2.7 >> version of the module. > > Can you explain

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-28 Thread Skip Montanaro
On Wed, Jan 28, 2015 at 7:07 AM, Andres Riancho wrote: > The feature I'm specially interested in is the ability to spawn > processes [1] instead of forking, which is not present in the 2.7 > version of the module. > Can you explain what you see as the difference between "spawn" and "fork" in thi

Re: multiprocessing module in async db query

2011-03-09 Thread Philip Semanchuk
On Mar 9, 2011, at 10:22 AM, Sheng wrote: > Hi Philip, > > multiprocessing.Queue is used to transfer data between processes, how > it could be helpful for solving my problem? Thanks! I misunderstood -- I thought transferring data between processes *was* your problem. If both of your functions

Re: multiprocessing module in async db query

2011-03-09 Thread Sheng
Hi Philip, multiprocessing.Queue is used to transfer data between processes, how it could be helpful for solving my problem? Thanks! Sheng On Mar 8, 6:34 pm, Philip Semanchuk wrote: > On Mar 8, 2011, at 3:25 PM, Sheng wrote: > > > This looks like a tornado problem, but trust me, it is almost al

Re: multiprocessing module in async db query

2011-03-08 Thread John Nagle
On 3/8/2011 3:34 PM, Philip Semanchuk wrote: On Mar 8, 2011, at 3:25 PM, Sheng wrote: This looks like a tornado problem, but trust me, it is almost all about the mechanism of multiprocessing module. [snip] So the workflow is like this, get() --> fork a subprocess to process the query re

Re: multiprocessing module in async db query

2011-03-08 Thread Philip Semanchuk
On Mar 8, 2011, at 3:25 PM, Sheng wrote: > This looks like a tornado problem, but trust me, it is almost all > about the mechanism of multiprocessing module. [snip] > So the workflow is like this, > > get() --> fork a subprocess to process the query request in > async_func() -> when async_fun

Re: multiprocessing module

2009-12-31 Thread Glazner
On Dec 15 2009, 10:56 am, makobu wrote: > I have a function that makes two subprocess.Popen() calls on a file. > > I have 8 cores. I need 8 instances of that function running in > parallel at any given time till all the files are worked on. > Can the multiprocessing module do this? If so, whats th

Re: multiprocessing module

2009-12-31 Thread Aahz
In article <79854c42-b2af-4adb-8967-3dc5e4ac0...@l13g2000yqb.googlegroups.com>, makobu wrote: > >I have a function that makes two subprocess.Popen() calls on a file. > >I have 8 cores. I need 8 instances of that function running in >parallel at any given time till all the files are worked on. >Ca

Re: Multiprocessing module

2009-04-11 Thread Gabriel Genellina
En Fri, 10 Apr 2009 06:46:47 -0300, Deepak Rokade escribió: Since this application is going to be commercial one I want to know at this stage if there are any known serious bugs (not limitations) in the multiprocessing module? Go to http://bugs.python.org/ click on Search on the left, and

Re: multiprocessing module - isn't it a bug?

2009-03-14 Thread Christian Heimes
dmitrey wrote: > This doesn't work for > costlyFunction2 = lambda x: 11 > as well; and it doesn't work for imap, apply_async as well (same > error). > So, isn't it a bug, or it can be somehow fixed? > Thank you in advance, D. It's not a bug but a limitation of the pickle protocol. Pickle can't han

Re: multiprocessing module - isn't it a bug?

2009-03-14 Thread Terry Reedy
dmitrey wrote: # THIS WORKS OK from multiprocessing import Pool N = 400 K = 800 processes = 2 def costlyFunction2(z): r = 0 for k in xrange(1, K+2): r += z ** (1 / k**1.5) return r class ABC: def __init__(self): pass def testParallel(self): po = Pool(processe

Re: multiprocessing module and os.close(sys.stdin.fileno())

2009-02-21 Thread Graham Dumpleton
On Feb 22, 12:52 pm, Joshua Judson Rosen wrote: > Graham Dumpleton writes: > > > On Feb 21, 4:20 pm, Joshua Judson Rosen wrote: > > > Jesse Noller writes: > > > > > On Tue, Feb 17, 2009 at 10:34 PM, Graham Dumpleton > > > > wrote: > > > > > Why is the multiprocessing module, ie., multiprocessi

Re: multiprocessing module and os.close(sys.stdin.fileno())

2009-02-21 Thread Joshua Judson Rosen
Graham Dumpleton writes: > > On Feb 21, 4:20 pm, Joshua Judson Rosen wrote: > > Jesse Noller writes: > > > > > On Tue, Feb 17, 2009 at 10:34 PM, Graham Dumpleton > > > wrote: > > > > Why is the multiprocessing module, ie., multiprocessing/process.py, in > > > > _bootstrap() doing: > > > > > >  

Re: multiprocessing module and os.close(sys.stdin.fileno())

2009-02-21 Thread Graham Dumpleton
On Feb 21, 4:20 pm, Joshua Judson Rosen wrote: > Jesse Noller writes: > > > On Tue, Feb 17, 2009 at 10:34 PM, Graham Dumpleton > > wrote: > > > Why is the multiprocessing module, ie., multiprocessing/process.py, in > > > _bootstrap() doing: > > > >  os.close(sys.stdin.fileno()) > > > > rather th

Re: multiprocessing module and os.close(sys.stdin.fileno())

2009-02-20 Thread Joshua Judson Rosen
Jesse Noller writes: > > On Tue, Feb 17, 2009 at 10:34 PM, Graham Dumpleton > wrote: > > Why is the multiprocessing module, ie., multiprocessing/process.py, in > > _bootstrap() doing: > > > > os.close(sys.stdin.fileno()) > > > > rather than: > > > > sys.stdin.close() > > > > Technically it is f

Re: multiprocessing module and os.close(sys.stdin.fileno())

2009-02-18 Thread Graham Dumpleton
On Feb 19, 1:16 pm, Jesse Noller wrote: > On Tue, Feb 17, 2009 at 10:34 PM, Graham Dumpleton > > > > wrote: > > Why is the multiprocessing module, ie., multiprocessing/process.py, in > > _bootstrap() doing: > > >  os.close(sys.stdin.fileno()) > > > rather than: > > >  sys.stdin.close() > > > Tech

Re: multiprocessing module and os.close(sys.stdin.fileno())

2009-02-18 Thread Jesse Noller
On Tue, Feb 17, 2009 at 10:34 PM, Graham Dumpleton wrote: > Why is the multiprocessing module, ie., multiprocessing/process.py, in > _bootstrap() doing: > > os.close(sys.stdin.fileno()) > > rather than: > > sys.stdin.close() > > Technically it is feasible that stdin could have been replaced with

Re: multiprocessing module (PEP 371)

2008-06-07 Thread John Nagle
sturlamolden wrote: On Jun 5, 11:02 am, pataphor <[EMAIL PROTECTED]> wrote: This is probably not very central to the main intention of your post, but I see a terminology problem coming up here. It is possible for python objects to share a reference to some other object. This has nothing to do w

Re: multiprocessing module (PEP 371)

2008-06-05 Thread sturlamolden
On Jun 5, 11:02 am, pataphor <[EMAIL PROTECTED]> wrote: > This is probably not very central to the main intention of your post, > but I see a terminology problem coming up here. It is possible for > python objects to share a reference to some other object. This has > nothing to do with threads or

Re: multiprocessing module (PEP 371)

2008-06-05 Thread pataphor
In article <877a5774-d3cc-49d3-bb64-5cab8505a419 @m3g2000hsc.googlegroups.com>, [EMAIL PROTECTED] says... > I don't see pyprocessing as a drop-in replacement for the threading > module. Multi-threading and multi-processing code tend to be > different, unless something like mutable objects in share

RE: multiprocessing module (PEP 371)

2008-06-04 Thread Delaney, Timothy (Tim)
Christian Heimes wrote: > Can you provide a C implementation that compiles under VS 2008? Python > 2.6 and 3.0 are using my new VS 2008 build system and we have dropped > support for 9x, ME and NT4. If you can provide us with an > implementation we *might* consider using it. You'd have to at leas

Re: multiprocessing module (PEP 371)

2008-06-04 Thread Christian Heimes
sturlamolden schrieb: > There is a well known C++ implementation of cow-fork on Windows, which > I have slightly modified and ported to C. But as the new WDK (Windows > driver kit) headers are full of syntax errors, the compiler choke on > it. :( I am seriously considering re-implementing the whole

Re: multiprocessing module (PEP 371)

2008-06-04 Thread sturlamolden
On Jun 4, 11:29 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > tested the executable on Windows. COW (copy-on-write, for those still > thinking that we're talking about dairy products) would be pretty > desirable if it's feasible, though. There is a well known C++ implementation of cow-fork on Wind

Re: multiprocessing module (PEP 371)

2008-06-04 Thread Paul Boddie
On 4 Jun, 20:06, sturlamolden <[EMAIL PROTECTED]> wrote: > > Even a non-COWfork > would be preferred. I will strongly suggest something is done to add > support for os.fork to Python on Windows. Either create a full cow > fork using ZwCreateProces