Using mpi4py in sage 'online' notebook (atsagenb.org)

78 vues
Accéder directement au premier message non lu

ravine

non lue,
16 mars 2012, 18:06:1816/03/2012
à sage-support
Hi,

I just started using sage and am loving it! However, I was wondering,
is there a way to use the mpi4py package in the online (sagenb.org)
notebook ?

I was hoping to do so, but am stuck due to the following two issues:

1) The documentation at Sage (http://www.sagemath.org/doc/
numerical_sage/mpi4py.html) says that one can execute this code by
running "./local/bin/mpirun -np 5 ./sage -python filename.py" from
command line of the system. However, I do not know how to do the same
in the online notebook.

2) I tried to simply evaluate the sample program given in the
documentation page for mpi4py in sage:
from mpi4py import MPI
import numpy
rank=MPI.rank
size=MPI.size
v=numpy.array([rank]*5,dtype=float)
MPI.COMM_WORLD.Send(v,dest=(rank+1)%size)
data=MPI.COMM_WORLD.Recv(source=(rank-1)%size)
print(``my rank is %d"%n)
print(``I received this:'')
print(data)

However, it throws the error: "ImportError: No module named mpi4py"

It also does not allow me to install the "optional" mpi4py package on
its own server using "install_package" (since I obviously don't have
the required permissions).

So, is there a way that i can use mpi4py in the online notebook ?

Thanks a lot !
Ravi

Volker Braun

non lue,
16 mars 2012, 20:28:1916/03/2012
à sage-s...@googlegroups.com
You can't install MPI on the public Sage server without administrative privileges.

Also, unless you want to learn MPI for educational purposes your are using the wrong tool to run stuff on a single machine. For tightly coupled problems you can't beat threads that way, and for very parallel problems you should just go with fork and the @parallel decorator.

Simon King

non lue,
19 mars 2012, 01:57:1619/03/2012
à sage-s...@googlegroups.com
Why has the original post been marked as spam?

Anton Sherwood

non lue,
19 mars 2012, 03:42:5419/03/2012
à sage-s...@googlegroups.com
On 2012-3-18 22:57, Simon King wrote:
> Why has the original post been marked as spam?

Possibly the phrase "I just started using **** and am loving it!" is a
red flag. (I didn't see it marked as spam.)

--
Anton Sherwood *\\* www.bendwavy.org *\\* www.zazzle.com/tamfang

Harald Schilly

non lue,
19 mars 2012, 06:57:4119/03/2012
à sage-s...@googlegroups.com


On Monday, March 19, 2012 6:57:16 AM UTC+1, Simon King wrote:
Why has the original post been marked as spam?

I guess someone clicked on the "mark spam" button. I also found the setting to revert this... :-)

Simon King

non lue,
19 mars 2012, 08:55:5719/03/2012
à sage-s...@googlegroups.com
Hi Harald,

Harald Schilly <harald.schilly <at> gmail.com> writes:
> I guess someone clicked on the "mark spam" button. I also found the setting to
revert this...

I also clicked on the "not spam" button...

Cheers,
Simon

Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message