[sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-06 Thread Gokhan Sever
On Mar 6, 11:23 pm, Gokhan Sever wrote: > Hello, > > I am executing this example in Sage Notebook v4.3.3 > > from timeit import default_timer as clock > from multiprocessing import Pool > > def f(x): >     return x**3 + x**2 + x > > if __name__ == '__main__': >     t1 = clock() >     pool = Pool

[sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-07 Thread jpc
I've tried with print pool.map(f, range(10)) instead of pool.map(f, range(10)) calling python file.py In the notebook, the output must be caughted and printed for user, I think. Pedro On Mar 7, 5:23 am, Gokhan Sever wrote: > Hello, > > I am executing this example in Sage Notebook

[sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-07 Thread Gokhan Sever
On Mar 7, 10:13 am, calcp...@aol.com wrote: > from multiprocessing import Pool > ... >     pool = Pool(processes=2)            # start 2 worker processes > << > > Wow, cool, is this part of parallel python?  Does this only work on a > multi-core PC or can this be made to work over a cluster as well

[sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-07 Thread Gokhan Sever
On Mar 7, 12:20 pm, jpc wrote: > I've tried with > >     print pool.map(f, range(10)) > > instead of > >     pool.map(f, range(10)) > > calling python file.py > > In the notebook, the output must be caughted and printed for user, I > think. > > Pedro I was trying with pool.map(f, range(10)); #

[sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-07 Thread Gokhan Sever
On Mar 7, 3:14 pm, calcp...@aol.com wrote: > pool sounds interesting! > > ipython is separate from parallel python? > > What about the @parallel decorator, is that parallel python? > > Its confusing in SAGE sometimes what needs importing and what doesn't. > > TIA, > A. Jorge Garciahttp://calcpage

[sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-07 Thread Gokhan Sever
On Mar 7, 8:45 pm, William Stein wrote: > On Sun, Mar 7, 2010 at 5:06 PM, Gokhan Sever wrote: > > Parallel Python is a separate module. IPython is the interactive > > Python interpreter that comes with Sage. However to use the IPython > > parallel features you need to install some additional pa

[sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-08 Thread Gokhan Sever
On Mar 7, 9:47 pm, William Stein wrote: > With a function as *trivial* as your f above, the overhead of > @parallel will kill your benchmark.  As I explained, for *every* > single call, an entire copy of Sage is forked off.  This is no problem > if evaluating f takes at least a second (say), but i

Re: [sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-06 Thread Pat LeSmithe
On 03/06/2010 09:36 PM, Gokhan Sever wrote: > On Mar 6, 11:23 pm, Gokhan Sever wrote: >> When I run the code in shell using "python file.py" I don't get any >> results from function mapping printed out however in Sage-Notebook I >> see a huge output with WARNING: Output truncated! >> >> Any ideas

Re: [sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-07 Thread calcpage
pool sounds interesting! ipython is separate from parallel python? What about the @parallel decorator, is that parallel python? Its confusing in SAGE sometimes what needs importing and what doesn't. TIA, A. Jorge Garcia http://calcpage.tripod.com Teacher & Professor Applied Mathematics, Physic

Re: [sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-07 Thread William Stein
On Sun, Mar 7, 2010 at 5:06 PM, Gokhan Sever wrote: > Parallel Python is a separate module. IPython is the interactive > Python interpreter that comes with Sage. However to use the IPython > parallel features you need to install some additional packages. I am > not sure if you could get it work fr

Re: [sage-support] Re: Simple multiprocessing example in Sage-Notebook

2010-03-07 Thread William Stein
On Sun, Mar 7, 2010 at 7:40 PM, Gokhan Sever wrote: > > > On Mar 7, 8:45 pm, William Stein wrote: >> On Sun, Mar 7, 2010 at 5:06 PM, Gokhan Sever wrote: >> > Parallel Python is a separate module. IPython is the interactive >> > Python interpreter that comes with Sage. However to use the IPython