[gmx-developers] issues in calling python with subprocess in git master code

Mark Abraham mark.j.abraham at gmail.com
Fri Nov 28 10:04:35 CET 2014


Hi,

Can you use the generated .mdp files if you issue gmx grompp directly? Does
subprocess.call(['cat', newmdp]) work as expected?

Mark

On Fri, Nov 28, 2014 at 5:59 AM, Shirts, Michael R. (mrs5pt) <
mrs5pt at eservices.virginia.edu> wrote:

> Hi, all-
>
> I'm trying to write a python script using subprocess to call grompp. It
> works perfectly fine when called from the command line or when debugging;
> this only occurs with python (Anaconda, Python 2.7).
>
> For example, my code looks like:
>
> subprocess.call(['gmx_d','grompp','-f',newmdp,'-c',gro,'-p',top,'-o',tpr,'-
> maxwarn','5'])
>
>
>
> It produces to stdout:
>
> GROMACS: gmx grompp, VERSION 5.1-dev-20141126-f367cf6 (double precision)
> Executable: grompp
> Library dir:
> /Users/mrshirts/work/gromacs_allv/git/gromacs_official/install_gromacs_noit
> er/share/gromacs/top
> Command line:
> grompp -f r0000.noiter.mdp -c trpo.gro -p trpo.top -o r0000.noiter.tpr
> -maxwarn 5
>
>
> However, the errors that it then gives and mdout.mdp indicate that the mdp
> is not actually being read in, and the default values are being used
> instead. It even reports that the errors are in the mdp file I fed in,
> even though the mdp does not contain those commands.
>
> All files work perfectly well when called from the command line.
>
> The problems also occur the same way when calling as:
>
> subprocess.call(['grompp','-f',newmdp,'-c',gro,'-p',top,'-o',tpr,'-maxwarn'
> ,'5'])
>
> So that's not the issue. Same thing happened with os.system.
>
>
>
> I've tried a bunch of different ways of calling it in python, and all fail
> to have the mdp read in.  All other files are read in, and it doesn't
> matter what order they are in.
>
> I'm just wondering if other people have experienced this sort of problem
> calling gromacs with Python, or if there is something weird I'm doing.
>
>
> Best,
> ~~~~~~~~~~~~
> Michael Shirts
> Associate Professor
> Department of Chemical Engineering
> University of Virginia
> michael.shirts at virginia.edu
> (434) 243-1821
>
> --
> Gromacs Developers mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
> or send a mail to gmx-developers-request at gromacs.org.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-developers/attachments/20141128/b9ce3043/attachment.html>


More information about the gromacs.org_gmx-developers mailing list