<p dir="ltr"><br>
On 13 Jul 2015 8:19 am, &quot;mah maz&quot; &lt;<a href="mailto:mahmaz71@gmail.com">mahmaz71@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; Dear users,<br>
&gt;<br>
&gt; How can I find out that a variable is local or global?</p>
<p dir="ltr">There are no global variables. There&#39;s no such concept when doing MPI programming. One must explicitly communicate if you want to coordinate agreement on a single value.</p>
<p dir="ltr">&gt; in state.h I see rvec *x and rvec *v, however I dont know if they are local or global.</p>
<p dir="ltr">They&#39;re fields in a struct, so neither. </p>
<p dir="ltr">&gt; In some subroutines I notice t_state * state and t_state_global *state_global. what&#39;s the difference between these two?</p>
<p dir="ltr">state_global is the one present on the master rank e.g. after reading the checkpoint or tpr, or writing the output trajectory. After domain decomposition, it is not useful until (partially) re-filled via MPI communication when it is time to do global operations like temperature coupling or various output. But confusingly state and state_global have the same value if one us using a single MPI rank (= domain).</p>
<p dir="ltr">&gt; is it possible to refer coordinates, forces and velocities to t_state_global or they are already defined in t_state?</p>
<p dir="ltr">Depends what you are doing.</p>
<p dir="ltr">Mark</p>
<p dir="ltr">&gt; thanks!<br>
&gt;<br>
&gt; --<br>
&gt; Gromacs Developers mailing list<br>
&gt;<br>
&gt; * Please search the archive at <a 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>
&gt;<br>
&gt; * Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists">http://www.gromacs.org/Support/Mailing_Lists</a><br>
&gt;<br>
&gt; * For (un)subscribe requests visit<br>
&gt; <a 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">gmx-developers-request@gromacs.org</a>.<br>
</p>