[IPython-dev] Using IPython Parallel inside a class
Rafał Skolasiński
rjtskolasinski at gmail.com
Wed Dec 3 12:05:08 EST 2014
Hi Guys,
I hope this is the right place to ask this kind of question.
I would like to use IPython parallel in my physical simulation.
In my mind I've got class Simulation, which contain as a field object
hamiltonian of class Hamiltonian.
Method get_energy should call hamiltonian.get_matrix(momentum),
diagonalize it with scipy method and return energies.
I would like to execute it in parallel for a list of different momenta.
I tested it with a standard python 'map' function and it worked so I
thought that easiest way would be to use 'dview.map_sync' in the same way
but it doesn't looks like a proper way of doing it.
I am attaching my testing code. I would be very grateful for any help and
ideas how to do it in a nice and clean way.
Cheers,
Raphael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141203/21e7122d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parallel_class.py
Type: text/x-python
Size: 1481 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20141203/21e7122d/attachment.py>
More information about the IPython-dev
mailing list