running parallel escript using Sage calculator

Asked by Dmitrey

hi all,
our university is thinking about teaching students Escript, and we have 2 questions -
1) what is the best way (e.g. Python file from source) to demonstrate parallel solving of a PDE using Escript?
2) (main) has anyone successful experience of running *parallel* PDE from Sage calculator?
As for me I would prefer mere using pure Python without Sage, but due to some organization issues other staff want strictly insist on using Sage.

Regards, D.

Question information

Language:
English Edit question
Status:
Answered
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Joel Fenwick (j-fenwick1) said :
#1

Re question1.

If I haven't actually answered the question let me know and I will have another go.

If your version of escript is compiled with support for OpenMP or MPI, then parallelism is controlled by the parameters you launch escript with. You don't need to do anything different on the python side.

We typically use usersguide/poisson.py from the examples bundle for quick tests.
If you are looking at the source bundle, then you can find this at:

doc/examples/usersguide/poisson.py

For example (assuming you are running on Mac or some species of Linux):

run-escript -t 4 doc/examples/usersguide/poisson.py

Would run the poisson script using four threads. The man page for run-escript and the users guide have more information.

Revision history for this message
Joel Fenwick (j-fenwick1) said :
#2

Re question2.

"Has anyone successful experience of running *parallel* PDE from Sage calculator?"

Are you asking about running escript within sage?

Revision history for this message
Dmitrey (dmitrey15) said :
#3

Sorry, I mean running parallel escript from Sage notebook, i.e. the the
Sage web API tool, e.g.
https://sage.openopt.org:8000/
I think the idea is quite silly, but unfortunately other university
staff (that is responsible of taking decisions) says "you want
programming? use C/Fortran Petsc as we do for now and don't bother us.
Want using RAD? Use MATLAB we have paid money for recently, or C# ". It
is only Sage with it web API that could force our university government
to use Python language in education, but we have to demonstrate parallel
PDE on a cluster. We have tried Petsc4py and fipy with PyTrillinos
before, but with no success in parallel run from Sage notebook. Using
something like mpirun -np 2 sage -notebook fails, because both processes
listen to same port 8000, and error is shown. I guess maybe something
like starting one Sage instance with notebook and another one without
could be helpful, but I have no enough experience on using mpi. I had
asked some mail lists without success, e.g.
http://groups.google.com/group/mpi4py/browse_thread/thread/358a9c49a7276b1a/73375c54fdc62c3c
http://groups.google.com/group/sage-support/browse_thread/thread/cc2f196f94902c16/daae33567a82fbf4

Regards, D.

On 01/02/2011 12:22 AM, Joel Fenwick wrote:
> Your question #139825 on Escript changed:
> https://answers.launchpad.net/escript-finley/+question/139825
>
> Joel Fenwick requested for more information:
>
> Re question2.
>
> "Has anyone successful experience of running *parallel* PDE from Sage
> calculator?"
>
> Are you asking about running escript within sage?
>

Revision history for this message
Joel Fenwick (j-fenwick1) said :
#4

What implementation of MPI are you using?
intel? MPICH? ....

Revision history for this message
Dmitrey (dmitrey15) said :
#5

usually we use MPICH, but openmpi would be OK as well. I don't know
about others (I guess it doesn't matter), but we have to adjust at least
with one.
D.

On 01/02/2011 11:48 PM, Joel Fenwick wrote:
> Your question #139825 on Escript changed:
> https://answers.launchpad.net/escript-finley/+question/139825
>
> Status: Open => Needs information
>
> Joel Fenwick requested for more information:
>
> What implementation of MPI are you using?
> intel? MPICH? ....
>

Revision history for this message
Joel Fenwick (j-fenwick1) said :
#6

You need to consider the following:

1) MPI needs to be initialised - in escript we do this by running a wrapper binary (effectively just python with some MPI calls).
    If escript is to be loaded inside something else (sage) then that would need to be taken care of.
2) We don't currently support running escript interactively using MPI.
3) I think you need to separate the issues of parallel escript and parallel sage.

#1 could be solved fairly easily with a simple patch to the source.

#2 arises because escript is not written as a client server system - all MPI ranks are peers. This means that all nodes have to be executing the same MPI communication instructions. If you are running a script, this is no problem since all ranks can read the script. If you are running one rank interactively and the others non-interactively this won't be possible.
- Our typical model is to develop scripts interactively on a single machine (using small data sets) then run in parallel once the script is working.

#3 MPI requires code to be written with it in mind unless the other sage modules are written that way they won't work in parallel anyway.

Can you help with this problem?

Provide an answer of your own, or ask Dmitrey for more information if necessary.

To post a message you must log in.