[sage-support] is it possible to build sage with mpi support?

13 views
Skip to first unread message

dmitrey

unread,
May 10, 2010, 2:47:23 PM5/10/10
to sage-support
hi all,
is it possible to build sage with mpi support (openmpi), for to
perform things like
mpirun -np 4 sage myfile.py?

Thank you in advance, D.

--
To post to this group, send email to sage-s...@googlegroups.com
To unsubscribe from this group, send email to sage-support...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

William Stein

unread,
May 10, 2010, 11:44:08 PM5/10/10
to sage-s...@googlegroups.com
On Mon, May 10, 2010 at 1:47 PM, dmitrey <dmitrey...@scipy.org> wrote:
> hi all,
> is it possible to build sage with mpi support (openmpi), for to
> perform things like
> mpirun -np 4 sage myfile.py?
>
> Thank you in advance, D.

It's definitely possible. And if you care enough you'll surely succeed.

To get you started, you could try

sage -i openmpi-1.1.4 mpi4py-1.1.0

Maybe this will "just work".

William

>
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>



--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

dmitrey

unread,
May 11, 2010, 8:39:19 AM5/11/10
to sage-support
A teacher from NTTU KPI, one of two lead Ukrainian technical
university, tries to make it working on his home computer with no
success yet, so did I with installation of mpi4py 1.2.1 via
easy_install and trying "mpirun -np 4 sage myfile.py" with examples
from fipy and petsc4py. If it will work properly, it's very likely the
university will teach Sage.

Here's his email forwarded (translated from Ukrainian):
I have installed exactly those versions recommended in the post
(openmpi-1.1.4 mpi4py-1.1.0). In obvious way of start it doesn't work,
all processes are trying to listen at same port:

$ /home/nik/edu/sage/sage-4.3.3/sage -optional
Using SAGE Server http://www.sagemath.org//packages
http://www.sagemath.org//packages/optional/list --> /home/nik/edu/sage/
sage-4.3.3/tmp/list
***********************************
*** optional Packages ***
***********************************

INSTALLED:
database_cremona_ellcurve-20071019.p0
mpi4py-1.1.0
openmpi-1.1.4
openopt-0.24

$ /home/nik/edu/sage/sage-4.3.3/sage -n
----------------------------------------------------------------------
| Sage Version 4.3.3, Release Date: 2010-02-21 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

Please wait while the Sage Notebook server starts...
...
The notebook files are stored in: sage_notebook.sagenb
**************************************************
* *
* Open your web browser to http://localhost:8000 *
* *
**************************************************
2010-05-11 09:37:07+0300 [-] Log opened.
2010-05-11 09:37:07+0300 [-] twistd 8.2.0 (/home/nik/edu/sage/
sage-4.3.3/local/bin/python 2.6.4) starting up.
2010-05-11 09:37:07+0300 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2010-05-11 09:37:07+0300 [-] twisted.web2.channel.http.HTTPFactory
starting on 8000
2010-05-11 09:37:07+0300 [-] Starting factory
<twisted.web2.channel.http.HTTPFactory instance at 0xbe41a8c>
^C2010-05-11 09:37:18+0300 [-] Quitting all running worksheets...
2010-05-11 09:37:18+0300 [-] Saving notebook...
2010-05-11 09:37:18+0300 [-] Notebook cleanly saved.
2010-05-11 09:37:18+0300 [-] (Port 8000 Closed)
2010-05-11 09:37:18+0300 [-] Stopping factory
<twisted.web2.channel.http.HTTPFactory instance at 0xbe41a8c>
2010-05-11 09:37:18+0300 [-] Main loop terminated.
2010-05-11 09:37:18+0300 [-] Server Shut Down.

$ mpirun -np 2 /home/nik/edu/sage/sage-4.3.3/sage -n
----------------------------------------------------------------------
| Sage Version 4.3.3, Release Date: 2010-02-21 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

Please wait while the Sage Notebook server starts...
----------------------------------------------------------------------
| Sage Version 4.3.3, Release Date: 2010-02-21 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------

Please wait while the Sage Notebook server starts...
...
...
The notebook files are stored in: sage_notebook.sagenb
The notebook files are stored in: sage_notebook.sagenb
**************************************************
* *
* Open your web browser to http://localhost:8000 *
* *
**************************************************
**************************************************
* *
* Open your web browser to http://localhost:8000 *
* *
**************************************************
2010-05-11 09:37:38+0300 [-] Log opened.
2010-05-11 09:37:38+0300 [-] twistd 8.2.0 (/home/nik/edu/sage/
sage-4.3.3/local/bin/python 2.6.4) starting up.
2010-05-11 09:37:38+0300 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2010-05-11 09:37:38+0300 [-] twisted.web2.channel.http.HTTPFactory
starting on 8000
2010-05-11 09:37:38+0300 [-] Starting factory
<twisted.web2.channel.http.HTTPFactory instance at 0xb5a1a8c>
/opt/google/chrome/google-chrome: /lib/libz.so.1: no version
information available (required by /opt/google/chrome/google-chrome)
2010-05-11 09:37:38+0300 [-] Log opened.
2010-05-11 09:37:38+0300 [-] twistd 8.2.0 (/home/nik/edu/sage/
sage-4.3.3/local/bin/python 2.6.4) starting up.
2010-05-11 09:37:38+0300 [-] reactor class:
twisted.internet.selectreactor.SelectReactor.
2010-05-11 09:37:38+0300 [-] Traceback (most recent call last):
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/bin/twistd", line 21, in <module>
2010-05-11 09:37:38+0300 [-] run()
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/scripts/twistd.py", line 27,
in run
2010-05-11 09:37:38+0300 [-] app.run(runApp, ServerOptions)
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/application/app.py", line
694, in run
2010-05-11 09:37:38+0300 [-] runApp(config)
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/scripts/twistd.py", line 23,
in runApp
2010-05-11 09:37:38+0300 [-] _SomeApplicationRunner(config).run()
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/application/app.py", line
423, in run
2010-05-11 09:37:38+0300 [-] self.postApplication()
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/scripts/_twistd_unix.py",
line 206, in postApplication
2010-05-11 09:37:38+0300 [-]
self.startApplication(self.application)
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/scripts/_twistd_unix.py",
line 311, in startApplication
2010-05-11 09:37:38+0300 [-]
service.IService(application).privilegedStartService()
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/application/service.py",
line 273, in privilegedStartService
2010-05-11 09:37:38+0300 [-] service.privilegedStartService()
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/application/internet.py",
line 85, in privilegedStartService
2010-05-11 09:37:38+0300 [-] self._port = self._getPort()
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/application/internet.py",
line 116, in _getPort
2010-05-11 09:37:38+0300 [-] *self.args, **self.kwargs)
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/internet/posixbase.py", line
356, in listenTCP
2010-05-11 09:37:38+0300 [-] p.startListening()
2010-05-11 09:37:38+0300 [-] File "/home/nik/edu/sage/sage-4.3.3/
local/lib/python2.6/site-packages/twisted/internet/tcp.py", line 858,
in startListening
2010-05-11 09:37:38+0300 [-] raise CannotListenError,
(self.interface, self.port, le)
2010-05-11 09:37:38+0300 [-] twisted.internet.error.CannotListenError:
Couldn't listen on localhost:8000: [Errno 98] Address already in use.
/opt/google/chrome/chrome: /lib/libz.so.1: no version information
available (required by /opt/google/chrome/chrome)
Traceback (most recent call last):
File "/home/nik/edu/sage/sage-4.3.3/local/bin/sage-notebook", line
36, in <module>
notebook(port=8000)
File "/home/nik/edu/sage/sage-4.3.3/local/lib/python2.6/site-
packages/sagenb-0.7.5.1-py2.6.egg/sagenb/notebook/notebook_object.py",
line 219, in __call__
return self.notebook(*args, **kwds)
File "/home/nik/edu/sage/sage-4.3.3/local/lib/python2.6/site-
packages/sagenb-0.7.5.1-py2.6.egg/sagenb/notebook/run_notebook.py",
line 404, in notebook_twisted
return run(port, subnets)
File "/home/nik/edu/sage/sage-4.3.3/local/lib/python2.6/site-
packages/sagenb-0.7.5.1-py2.6.egg/sagenb/notebook/run_notebook.py",
line 389, in run
raise socket.error
socket.error
2010-05-11 09:37:39+0300 [HTTPChannel,2,127.0.0.1] /home/nik/edu/sage/
sage-4.3.3/local/lib/python2.6/site-packages/twisted/internet/defer.py:
267: exceptions.DeprecationWarning: Don't pass strings (like 'Bad
token') to failure.Failure (replacing with a DefaultException).
2010-05-11 09:37:39+0300 [HTTPChannel,2,127.0.0.1] Exception
rendering:
2010-05-11 09:37:39+0300 [HTTPChannel,2,127.0.0.1] Unhandled Error
Traceback (most recent call last):
Failure: twisted.python.failure.DefaultException: Bad token
^Cmpirun: killing job...

--------------------------------------------------------------------------
mpirun noticed that process rank 1 with PID 4474 on node mozart.lan
exited on signal 0 (Unknown signal 0).
--------------------------------------------------------------------------
mpirun: clean termination accomplished

2010-05-11 09:37:44+0300 [-] Quitting all running worksheets...
2010-05-11 09:37:44+0300 [-] Saving notebook...


On May 11, 6:44 am, William Stein <wst...@gmail.com> wrote:
> On Mon, May 10, 2010 at 1:47 PM, dmitrey <dmitrey.kros...@scipy.org> wrote:
> > hi all,
> > is it possible to build sage with mpi support (openmpi), for to
> > perform things like
> > mpirun -np 4 sage myfile.py?
>
> > Thank you in advance, D.
>
> It's definitely possible.  And if you care enough you'll surely succeed.
>
> To get you started, you could try
>
>    sage -i openmpi-1.1.4 mpi4py-1.1.0
>
> Maybe this will "just work".
>
> William
>
>
>
> > --
> > To post to this group, send email to sage-s...@googlegroups.com
> > To unsubscribe from this group, send email to sage-support...@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/sage-support
> > URL:http://www.sagemath.org
>
> --
> William Stein
> Professor of Mathematics
> University of Washingtonhttp://wstein.org
>
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to sage-support...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/sage-support
Reply all
Reply to author
Forward
0 new messages