[gmx-developers] Python interface for Gromacs

Roland Schulz roland at utk.edu
Thu Sep 9 16:14:20 CEST 2010


one very useful way to utilize Python is for prototyping. I find it often
more efficient for my time, to first test out algorithms in Python and then
after I found a good algorithm, implement that in C, instead of
directly implementing an algorithm in C. And of course a good algorithm is
usually more important than a fast implementation. Thus some of the analysis
tools with a better implementation (e.g. using grids instead of N^2) could
run faster in Python than their current C implementation. Another case in
which Python would be very useful even if it would run much slower, are
analysis tools which would not be used very often. For those the developers
time is much more valuable than the CPU time.

In case you have trouble to compile NumPy you can always use the Entought
distribution which is free for academic use:
For analysis tools which can be formulated as Vector-Matrix problem, NumPy
allows one to get similar performance than comparable C implementation.


On Thu, Sep 9, 2010 at 8:26 AM, David van der Spoel <spoel at xray.bmc.uu.se>wrote:

> On 2010-09-09 13.13, Sébastien Buchoux wrote:
>> Hi,
>> On 09/09/2010 08:38 AM, David van der Spoel wrote:
>>> People in the Lindahl group are working on parallellizing analysis
>>> tools because they are quickly becoming the bottleneck. We run
>>> simulations of large systems on hundreds of processors, and due to
>>> checkpointing this can be done largely unattended. Analysis can take a
>>> lot of effort, both hardware (CPU, Disk) and organisational. I think
>>> the prime advantage of a scripting languagae like Python could be
>>> organisational.
>>  From my experience, Python is too slow to really make analysis tools
>> (or any heavy computational work) on its own. But it can use C/C++ libs
>> like a charm... hence a Python interface! :)
>>  @portability: I have tried compiling numpy a few times on mac & linux
>>> without success. As long as numpy is not in the main python
>>> distribution it will not be useful...
>> Numpy compilation can indeed be... troublesome. but I don't think it is
>> mandatory.
>>  From my experience, Numpy is great for pure Python programming so it
>> would be useful for a 100% Python analysis tool. But with the use of C
>> to do the hard work, the advantage a Numpy is pretty slim and I think
>> that new Python types defined within a C extension are more efficient
>> since they allow Python users to access C objects directly (given the
>> use of a descent interface).
>> This is specially true when dealing with already written C objects that
>> are very different from C numarrays (i.e. they would need to be
>> "translated" to Numpy arrays prior to use any of the Numpy routines).
>> IMHO, the #1 priority of Numpy is much more to ease life of pure Python
>> programmers than to be useful to C extension programmers.
>> Sébastien
>>  One more option is to work with Konrad Hinsen's suite MMTK
> http://dirac.cnrs-orleans.fr/MMTK/. It is very flexible and why not use it
> to interface to gromacs? First thing to do would be to open up the
> trajectory reading code (for which there is a stand-alone library already).
> --
> David van der Spoel, Ph.D., Professor of Biology
> Dept. of Cell & Molec. Biol., Uppsala University.
> Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205.
> spoel at xray.bmc.uu.se    http://folding.bmc.uu.se
> --
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://lists.gromacs.org/mailman/listinfo/gmx-developers
> Please don't post (un)subscribe requests to the list. Use the www interface
> or send it to gmx-developers-request at gromacs.org.

ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20100909/590208db/attachment.html>

More information about the gromacs.org_gmx-developers mailing list