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 <[email protected]> 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(processes=2) # start 2 worker processes
> pool.map(f, range(1000000));
> t2 = clock()
> print "Elapsed time using two processes:", t2-t1
>
> 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 what might be causing this issue?
>
> Thanks.
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org