Hi Andrew,

If you use *one* machine with many cores then have a look at the standard Python module multiprocessing

https://docs.python.org/2/library/multiprocessing.html

This is what parallel does use. And it is not hard to get it works.

If you have access to a cluster with several nodes, then you need something else for communication between the nodes. mpi4py is one good option. Though installing it might be tricky and using it requires more attention. Installing the package is not advised, just use

  sage -pip install mpi4py

Vincent

On 10/05/16 22:59, William Stein wrote:
On Tue, May 10, 2016 at 7:39 PM, Andrew <andrew.mat...@sydney.edu.au> wrote:
I have access to a centos machine with many cores, so I want to start
writing parallelised code on it. This is probably naive, but is using the
code in sage.parallel the best way to write parallel code in sage?

It depends on what you are trying to do.  For some computations,
@parallel is the best possible way to do them, and for others it is
the worst possible way.

William


I started using the @parallel decorator but then I found the optional
packages openmpi and mpi4py and wondered if it would be better to use these
instead, except it seems that the packages are no longer maintained (and
hence not useful?) as "new style" packages for them don't seem to exist. I
am confused, however, because mp4py is the main topic of the thematic
tutorial
http://doc.sagemath.org/html/en/thematic_tutorials/numerical_sage/parallel_computation.html
which suggests that it is still being used.

Andrew

--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.




--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to