<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Ahh thanks!</div><div><br></div><div>Augustin</div><div><br></div><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;" data-mce-style="border-left: 2px solid #1010FF; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>De: </b>"Mark Abraham" &lt;mark.j.abraham@gmail.com&gt;<br><b>À: </b>gmx-developers@gromacs.org<br><b>Envoyé: </b>Lundi 21 Novembre 2016 18:47:18<br><b>Objet: </b>Re: [gmx-developers] Interfacing with gromacs to get potential energies/ forces<br><div><br></div><div dir="ltr">Hi,<div><br></div><div>The use of a pair list is a standard optimization in N-body codes. You search for pairs within an interaction radius, plus a buffer (sometimes called skin), make a list, and re-use the list for a number of successive evaluations, since particles don't move much between each evaluation. At each step you use the actual interaction radius to compute the interactions, including some that are out of range by design. Obviously rerun must make a new pair list for every evaluation, since that assumption does not apply. You need to understand your update process in order to decide whether you want this, and whether it can work well.</div><div><br></div><div>Mark</div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 21, 2016 at 3:46 PM Augustin Chevallier &lt;<a href="mailto:augustin.chevallier@inria.fr" target="_blank" data-mce-href="mailto:augustin.chevallier@inria.fr">augustin.chevallier@inria.fr</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><div class="gmail_msg">Thanks I didn't know about OpenMM, I'll take a look. <br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">What do you mean exactly by invalidating the pair list?<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Augustin<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><hr id="m_-6026113579320766189zwchr" class="gmail_msg"><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" class="gmail_msg" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"></blockquote></div></div><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" class="gmail_msg" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b class="gmail_msg">De: </b>"Mark Abraham" &lt;<a href="mailto:mark.j.abraham@gmail.com" class="gmail_msg" target="_blank" data-mce-href="mailto:mark.j.abraham@gmail.com">mark.j.abraham@gmail.com</a>&gt;<br class="gmail_msg"><b class="gmail_msg">À: </b><a href="mailto:gmx-developers@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br class="gmail_msg"></blockquote></div></div><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" class="gmail_msg" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b class="gmail_msg">Envoyé: </b>Lundi 21 Novembre 2016 15:39:23</blockquote></div></div><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" class="gmail_msg" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><br class="gmail_msg"><b class="gmail_msg">Objet: </b>Re: [gmx-developers] Interfacing with gromacs to get potential energies/ forces<br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" class="gmail_msg">Hi,<br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Nov 21, 2016 at 3:30 PM Augustin Chevallier &lt;<a href="mailto:augustin.chevallier@inria.fr" class="gmail_msg" target="_blank" data-mce-href="mailto:augustin.chevallier@inria.fr">augustin.chevallier@inria.fr</a>&gt; wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><div class="gmail_msg"><div style="padding-left:30px" class="gmail_msg" data-mce-style="padding-left: 30px;">mdrun -rerun already does this. If you can cast the implementation of your algorithm so that you have many sets of positions to be evaluated, then you should start by implementing that with rerun, not with writing code that you then have to prove still works correctly. Calling the API directly sounds like an optimization you should do only if you need it. You anyway want to be able to do it via rerun to be a way of proving you've done it correctly.</div><div style="padding-left:30px" class="gmail_msg" data-mce-style="padding-left: 30px;"><br class="gmail_msg"></div><div style="padding-left:30px" class="gmail_msg" data-mce-style="padding-left: 30px;">Using GROMACS because it's really fast, but then hacking away all the parallelism setup that makes it fast would be a bit inconsistent, and any performance advantage of GROMACS doesn't really matter unless you're already planning at least millions of potential evaluations.</div><div style="padding-left:30px" class="gmail_msg" data-mce-style="padding-left: 30px;"><br class="gmail_msg"></div></div></div></div><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><div class="gmail_msg"><div class="gmail_msg">I'm trying to implement a stochastic algorithm, so I'm generating new configurations on the fly, so I cannot (sadly) use the rerun functionality. To be honest I don't have that many choices. I either re-implement gromacs force fields to get the potential energies, which would take a lot of time and testing AND will most likely be much slower (and I'm not talking about MPI here, just plain SIMD) or I try to use gromacs directly.</div></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Also wanting plurality of force field support is a strong supporting reason for choosing GROMACS. Otherwise frameworks like OpenMM or TINKER (or others?) make some sense.</div><div class="gmail_msg">&nbsp;</div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><div class="gmail_msg">Thanks for your answers! So it seems that I have something which works :) &nbsp; (it's in practice almost like replacing the update_coords with something custom).<br class="gmail_msg"></div></div></div></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Yeah. I would also consider leaving GROMACS code mostly alone and having update_coords call your code instead. But you will have to consider the question of when your update will invalidate the pair list (e.g. nstlist = 1 is safe, but obviously slower)</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Mark</div><div class="gmail_msg"><br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;"><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">&nbsp;Cheers,<br class="gmail_msg"></div><div class="gmail_msg">Augustin<br class="gmail_msg"></div><hr id="m_-6026113579320766189m_-2211266943163203031zwchr" class="gmail_msg"><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" class="gmail_msg" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b class="gmail_msg">De: </b>"Mark Abraham" &lt;<a href="mailto:mark.j.abraham@gmail.com" class="gmail_msg" target="_blank" data-mce-href="mailto:mark.j.abraham@gmail.com">mark.j.abraham@gmail.com</a>&gt;<br class="gmail_msg"><b class="gmail_msg">À: </b><a href="mailto:gmx-developers@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br class="gmail_msg"><b class="gmail_msg">Envoyé: </b>Lundi 21 Novembre 2016 15:18:22</blockquote></div></div><div class="gmail_msg"><div style="font-family:times new roman,new york,times,serif;font-size:12pt;color:#000000" class="gmail_msg" data-mce-style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000;"><blockquote style="border-left:2px solid #1010ff;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt" class="gmail_msg" data-mce-style="border-left: 2px solid #1010ff; margin-left: 5px; padding-left: 5px; color: #000; font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><br class="gmail_msg"><b class="gmail_msg">Objet: </b>Re: [gmx-developers] Interfacing with gromacs to get potential energies/ forces<br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div dir="ltr" class="gmail_msg">Hi,<br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Mon, Nov 21, 2016 at 1:52 PM Augustin Chevallier &lt;<a href="mailto:augustin.chevallier@inria.fr" class="gmail_msg" target="_blank" data-mce-href="mailto:augustin.chevallier@inria.fr">augustin.chevallier@inria.fr</a>&gt; wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">Thank you for both of your answers!<br class="gmail_msg"> <br class="gmail_msg"> &nbsp;I've tried the code from David van der Spoel, however it crashes. Thus I have made my own (really messy) wrapper by taking the code from mdrun and modifying it.<br class="gmail_msg"> It seems to work however I would like to confirm a few things.<br class="gmail_msg"> 1/ the energy computed during do_forces<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">If you pass GMX_FORCE_ENERGY in the flags</div><div class="gmail_msg">&nbsp;</div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">2/ after calling do_forces, enerd-&gt;term[F_EPOT] gives the potential energy (without kinetic energy)<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Yes</div><div class="gmail_msg">&nbsp;</div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">3/ the units in enerd-&gt;term[F_EPOT]&nbsp; is kJ/mol<br class="gmail_msg"> Are these 3 points true?<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Yes</div><div class="gmail_msg">&nbsp;</div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">&gt;mdrun reads all of that from the .tpr and looks at your hardware and command-line options and sets up all of that complexity. I don't think you should want to try to simplify that - you need to satisfy &gt;the prerequisites of do_force() and those were never designed for this use. The important questions are "what will vary between evaluations?" and "why is GROMACS the right tool for the job?"<br class="gmail_msg"></blockquote><div class="gmail_msg">&nbsp;</div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">well the positions of the atoms will vary. I need gromacs because it implements the most common force fields and is really fast.<br class="gmail_msg"></blockquote><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">mdrun -rerun already does this. If you can cast the implementation of your algorithm so that you have many sets of positions to be evaluated, then you should start by implementing that with rerun, not with writing code that you then have to prove still works correctly. Calling the API directly sounds like an optimization you should do only if you need it. You anyway want to be able to do it via rerun to be a way of proving you've done it correctly.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Using GROMACS because it's really fast, but then hacking away all the parallelism setup that makes it fast would be a bit inconsistent, and any performance advantage of GROMACS doesn't really matter unless you're already planning at least millions of potential evaluations.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Mark</div><div class="gmail_msg"><br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex" data-mce-style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">&gt;Yes. We are in the process of designing an API that would be usable for what you want, but that's years away still.<br class="gmail_msg"> That's good to hear, just sad that it's still years away ;)<br class="gmail_msg"> <br class="gmail_msg"> Thanks!<br class="gmail_msg"> Augustin<br class="gmail_msg"> <br class="gmail_msg"> ----- Mail original -----<br class="gmail_msg"> &gt; De: "David van der Spoel" &lt;<a href="mailto:spoel@xray.bmc.uu.se" class="gmail_msg" target="_blank" data-mce-href="mailto:spoel@xray.bmc.uu.se">spoel@xray.bmc.uu.se</a>&gt;<br class="gmail_msg"> &gt; À: "gromacs org gmx-developers" &lt;<a href="mailto:gromacs.org_gmx-developers@maillist.sys.kth.se" class="gmail_msg" target="_blank" data-mce-href="mailto:gromacs.org_gmx-developers@maillist.sys.kth.se">gromacs.org_gmx-developers@maillist.sys.kth.se</a>&gt;<br class="gmail_msg"> &gt; Envoyé: Samedi 19 Novembre 2016 16:16:34<br class="gmail_msg"> &gt; Objet: Re: [gmx-developers] Interfacing with gromacs to get potential energies/ forces<br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt; On 19/11/16 14:48, Augustin Chevallier wrote:<br class="gmail_msg"> &gt; &gt; Thanks! This code is what I was looking for.<br class="gmail_msg"> &gt; &gt;<br class="gmail_msg"> &gt; &gt; As for the problem you mentioned, why will this code change? Is it because<br class="gmail_msg"> &gt; &gt; the code itself isn't mature or because gromacs 'core' code will change,<br class="gmail_msg"> &gt; &gt; making this code obsolete? Also about the license, is there any kind of<br class="gmail_msg"> &gt; &gt; restriction on the usage of this code?<br class="gmail_msg"> &gt; &gt;<br class="gmail_msg"> &gt; The gromacs core is planned to change, meaning routines called by this<br class="gmail_msg"> &gt; code will disappear (or be replaced by others in a non-trivial manner).<br class="gmail_msg"> &gt; The specialized code here is also not mature and up-to-date with the<br class="gmail_msg"> &gt; latest gromacs.<br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt; The code is under the same LGPL license as the rest of gromacs.<br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt; &gt; Augustin<br class="gmail_msg"> &gt; &gt;<br class="gmail_msg"> &gt; &gt; ----- Mail original -----<br class="gmail_msg"> &gt; &gt;&gt; De: "David van der Spoel" &lt;<a href="mailto:spoel@xray.bmc.uu.se" class="gmail_msg" target="_blank" data-mce-href="mailto:spoel@xray.bmc.uu.se">spoel@xray.bmc.uu.se</a>&gt;<br class="gmail_msg"> &gt; &gt;&gt; À: <a href="mailto:gmx-developers@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers@gromacs.org">gmx-developers@gromacs.org</a><br class="gmail_msg"> &gt; &gt;&gt; Envoyé: Vendredi 18 Novembre 2016 16:11:22<br class="gmail_msg"> &gt; &gt;&gt; Objet: Re: [gmx-developers] Interfacing with gromacs to get potential<br class="gmail_msg"> &gt; &gt;&gt; energies/ forces<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt; On 18/11/16 11:43, Augustin Chevallier wrote:<br class="gmail_msg"> &gt; &gt;&gt;&gt; Hello,<br class="gmail_msg"> &gt; &gt;&gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;&gt; first, I apologize if this is not the right mailing list, however it<br class="gmail_msg"> &gt; &gt;&gt;&gt; seemed more appropriate than user mailing list.<br class="gmail_msg"> &gt; &gt;&gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;&gt; I would like to get the potential energy computed by gromacs without<br class="gmail_msg"> &gt; &gt;&gt;&gt; having to use the command line and the overhead of writing/reading the<br class="gmail_msg"> &gt; &gt;&gt;&gt; result in files. I had a look at the code and indeed it seems possible<br class="gmail_msg"> &gt; &gt;&gt;&gt; using mdlib, however I'm a bit overwhelmed by the complexity of the code.<br class="gmail_msg"> &gt; &gt;&gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;&gt; From what I understood, I should call the function do_forces(), however<br class="gmail_msg"> &gt; &gt;&gt;&gt; it has many parameters, and after looking at do_md() ,mdrunner()&nbsp; and<br class="gmail_msg"> &gt; &gt;&gt;&gt; main() it seems there is quite a lot of things to set up before calling<br class="gmail_msg"> &gt; &gt;&gt;&gt; that function.<br class="gmail_msg"> &gt; &gt;&gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;&gt; So here are some more precise questions:<br class="gmail_msg"> &gt; &gt;&gt;&gt; *which initialization are required? should I just copy past some parts<br class="gmail_msg"> &gt; &gt;&gt;&gt; of mdrunner for that?<br class="gmail_msg"> &gt; &gt;&gt;&gt; *how do I load a gromacs topology file?<br class="gmail_msg"> &gt; &gt;&gt;&gt; *I guess I also need a forcerec, how do I create on too?<br class="gmail_msg"> &gt; &gt;&gt;&gt; *If I want to modify the atoms positions, can I do it in mdAtoms<br class="gmail_msg"> &gt; &gt;&gt;&gt; directly?<br class="gmail_msg"> &gt; &gt;&gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;&gt; I know these questions are rather vague, so if you could just point to<br class="gmail_msg"> &gt; &gt;&gt;&gt; which part of md_runner() and do_md() I should look at, it would greatly<br class="gmail_msg"> &gt; &gt;&gt;&gt; help!<br class="gmail_msg"> &gt; &gt;&gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt; If you check out the branch qmmm you will find there is an interface to<br class="gmail_msg"> &gt; &gt;&gt; gromacs in src/gromacs/mmslave.h. You can call a few functions to change<br class="gmail_msg"> &gt; &gt;&gt; coordinates and charges and then calculate energy and forces. If you<br class="gmail_msg"> &gt; &gt;&gt; link your code to gromacs and call these routines it should work.<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt; The problem with this code is that it will most likely disappear or<br class="gmail_msg"> &gt; &gt;&gt; change a lot before being taken up in regular gromacs.<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;&gt; Thanks!<br class="gmail_msg"> &gt; &gt;&gt;&gt; Augustin Chevallier<br class="gmail_msg"> &gt; &gt;&gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt; --<br class="gmail_msg"> &gt; &gt;&gt; David van der Spoel, Ph.D., Professor of Biology<br class="gmail_msg"> &gt; &gt;&gt; Dept. of Cell &amp; Molec. Biol., Uppsala University.<br class="gmail_msg"> &gt; &gt;&gt; Box 596, 75124 Uppsala, Sweden. Phone:&nbsp; &nbsp; &nbsp;<a href="tel:018-471%2042%2005" class="gmail_msg" target="_blank" data-mce-href="tel:018-471%2042%2005">+46184714205</a>.<br class="gmail_msg"> &gt; &gt;&gt; <a href="mailto:spoel@xray.bmc.uu.se" class="gmail_msg" target="_blank" data-mce-href="mailto:spoel@xray.bmc.uu.se">spoel@xray.bmc.uu.se</a>&nbsp; &nbsp; <a href="http://folding.bmc.uu.se" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://folding.bmc.uu.se">http://folding.bmc.uu.se</a><br class="gmail_msg"> &gt; &gt;&gt; --<br class="gmail_msg"> &gt; &gt;&gt; Gromacs Developers mailing list<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt; * Please search the archive at<br class="gmail_msg"> &gt; &gt;&gt; <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before<br class="gmail_msg"> &gt; &gt;&gt; posting!<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt; * Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt; &gt;&gt; * For (un)subscribe requests visit<br class="gmail_msg"> &gt; &gt;&gt; <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or<br class="gmail_msg"> &gt; &gt;&gt; send a mail to <a href="mailto:gmx-developers-request@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br class="gmail_msg"> &gt; &gt;&gt;<br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt; --<br class="gmail_msg"> &gt; David van der Spoel, Ph.D., Professor of Biology<br class="gmail_msg"> &gt; Dept. of Cell &amp; Molec. Biol., Uppsala University.<br class="gmail_msg"> &gt; Box 596, 75124 Uppsala, Sweden. Phone:&nbsp; &nbsp; &nbsp; &nbsp; <a href="tel:018-471%2042%2005" class="gmail_msg" target="_blank" data-mce-href="tel:018-471%2042%2005">+46184714205</a>.<br class="gmail_msg"> &gt; <a href="mailto:spoel@xray.bmc.uu.se" class="gmail_msg" target="_blank" data-mce-href="mailto:spoel@xray.bmc.uu.se">spoel@xray.bmc.uu.se</a>&nbsp; &nbsp; <a href="http://folding.bmc.uu.se" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://folding.bmc.uu.se">http://folding.bmc.uu.se</a><br class="gmail_msg"> &gt; --<br class="gmail_msg"> &gt; Gromacs Developers mailing list<br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt; * Please search the archive at<br class="gmail_msg"> &gt; <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before<br class="gmail_msg"> &gt; posting!<br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt; * Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt; * For (un)subscribe requests visit<br class="gmail_msg"> &gt; <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or<br class="gmail_msg"> &gt; send a mail to <a href="mailto:gmx-developers-request@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br class="gmail_msg"> &gt; Hi,<br class="gmail_msg"> <br class="gmail_msg"> &gt;On Fri, Nov 18, 2016 at 11:43 AM Augustin Chevallier &lt;<a href="mailto:augustin.chevallier@inria.fr" class="gmail_msg" target="_blank" data-mce-href="mailto:augustin.chevallier@inria.fr">augustin.chevallier@inria.fr</a>&gt; wrote:<br class="gmail_msg"> &gt;<br class="gmail_msg"> &gt;&nbsp; &nbsp; Hello<br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; first, I apologize if this is not the right mailing list, however it seemed more appropriate than user mailing list.<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> Sure, this is appropriate discussion here.<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; I would like to get the potential energy computed by gromacs without having to use the command line and the overhead of writing/reading the result in files.<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> If you don't need to change the model physics between computations of PE, then you should still consider mdrun -rerun, per <a href="http://www.gromacs.org/Documentation/How-tos/Single-Point_Energy" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Documentation/How-tos/Single-Point_Energy">http://www.gromacs.org/Documentation/How-tos/Single-Point_Energy</a>.<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; I had a look at the code and indeed it seems possible using mdlib, however I'm a bit overwhelmed by the complexity of the code.<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> Yes. We are in the process of designing an API that would be usable for what you want, but that's years away still.<br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; From what I understood, I should call the function do_forces(), however it has many parameters, and after looking at do_md() ,mdrunner()&nbsp; and main() it seems there is quite a lot of things to set up before calling that function.<br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; So here are some more precise questions:<br class="gmail_msg"> &nbsp; &nbsp; *which initialization are required? should I just copy past some parts of mdrunner for that?<br class="gmail_msg"> &nbsp; &nbsp; *how do I load a gromacs topology file?<br class="gmail_msg"> &nbsp; &nbsp; *I guess I also need a forcerec, how do I create on too?<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> mdrun reads all of that from the .tpr and looks at your hardware and command-line options and sets up all of that complexity. I don't think you should want to try to simplify that - you need to satisfy the prerequisites of do_force() and those were never designed for this use. The important questions are "what will vary between evaluations?" and "why is GROMACS the right tool for the job?"<br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; *If I want to modify the atoms positions, can I do it in mdAtoms directly?<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> No, they live in a variable of type t_state.<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; I know these questions are rather vague, so if you could just point to which part of md_runner() and do_md() I should look at, it would greatly help!<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> First let's see whether you can avoid it :-)<br class="gmail_msg"> <br class="gmail_msg"> Mark<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; Thanks!<br class="gmail_msg"> &nbsp; &nbsp; Augustin Chevallier<br class="gmail_msg"> &nbsp; &nbsp; --<br class="gmail_msg"> &nbsp; &nbsp; Gromacs Developers mailing list<br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; * Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; * Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br class="gmail_msg"> <br class="gmail_msg"> &nbsp; &nbsp; * For (un)subscribe requests visit<br class="gmail_msg"> &nbsp; &nbsp; <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> --<br class="gmail_msg"> Gromacs Developers mailing list<br class="gmail_msg"> <br class="gmail_msg"> * Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br class="gmail_msg"> <br class="gmail_msg"> * Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br class="gmail_msg"> <br class="gmail_msg"> * For (un)subscribe requests visit<br class="gmail_msg"> <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.<br class="gmail_msg"></blockquote></div></div><br class="gmail_msg">-- <br class="gmail_msg">Gromacs Developers mailing list<br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>* Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>* For (un)subscribe requests visit<br class="gmail_msg"><a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" class="gmail_msg" target="_blank" data-mce-href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.</blockquote></div></div>--<br class="gmail_msg"> Gromacs Developers mailing list<br class="gmail_msg"> <br class="gmail_msg"> * Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br class="gmail_msg"> <br class="gmail_msg"> * Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br class="gmail_msg"> <br class="gmail_msg"> * For (un)subscribe requests visit<br class="gmail_msg"> <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.</blockquote></div></div><br class="gmail_msg">-- <br class="gmail_msg">Gromacs Developers mailing list<br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>* Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>* For (un)subscribe requests visit<br class="gmail_msg"><a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" class="gmail_msg" target="_blank" data-mce-href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.</blockquote></div></div>--<br class="gmail_msg"> Gromacs Developers mailing list<br class="gmail_msg"> <br class="gmail_msg"> * Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br class="gmail_msg"> <br class="gmail_msg"> * Can't post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br class="gmail_msg"> <br class="gmail_msg"> * For (un)subscribe requests visit<br class="gmail_msg"> <a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" class="gmail_msg" target="_blank" data-mce-href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" class="gmail_msg" target="_blank" data-mce-href="mailto:gmx-developers-request@gromacs.org">gmx-developers-request@gromacs.org</a>.</blockquote></div><br>-- <br>Gromacs Developers mailing list<br><div><br></div>* Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List before posting!<br><div><br></div>* Can't post? Read http://www.gromacs.org/Support/Mailing_Lists<br><div><br></div>* For (un)subscribe requests visit<br>https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers or send a mail to gmx-developers-request@gromacs.org.</blockquote><div><br></div></div></body></html>