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

Shirts, Michael R. (mrs5pt) mrs5pt at eservices.virginia.edu
Fri Nov 28 14:43:39 CET 2014


Apparently me not noticing that at some point in the editing I deleted the line closing the file where I wrote the new mdp.  Sorry for the false alarm all .. .

Best,
~~~~~~~~~~~~
Michael Shirts
Associate Professor
Department of Chemical Engineering
University of Virginia
michael.shirts at virginia.edu
(434) 243-1821

From: Mark Abraham <mark.j.abraham at gmail.com<mailto:mark.j.abraham at gmail.com>>
Date: Friday, November 28, 2014 at 4:04 AM
To: Discussion list for GROMACS development <gmx-developers at gromacs.org<mailto:gmx-developers at gromacs.org>>, "michael.shirts at virginia.edu<mailto:michael.shirts at virginia.edu>" <michael.shirts at virginia.edu<mailto:michael.shirts at virginia.edu>>
Subject: Re: [gmx-developers] issues in calling python with subprocess in git master code

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<mailto: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<mailto: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<mailto: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/71baa13f/attachment.html>


More information about the gromacs.org_gmx-developers mailing list