Dear gromacs users and developers,<div>I have a question related to domain decomposition:</div><div><br></div><div>I have to tun multiple simulation and every step </div><div>1) In the sim X the state of simY (and simY need state from sim X)</div>
<div>2) getting the potential energy</div><div>3) continuing</div><div><br></div><div><br></div><div><br></div><div>right now I am testing the point1. In particular I exchange the state between simulation X and Y two times:</div>
<div>the first time this permit at simulation X to get the state of Y ( and vicecersa) while the second exchange</div><div>restore the original situatation.</div><div><br></div><div>I inserted the following code between lines</div>
<div><br></div><div><div> if ((repl_ex_nst > 0) && (step > 0) && !bLastStep &&</div><div> do_per_step(step,repl_ex_nst)) </div><div> {</div></div><div><br></div><div>and </div>
<div><br></div><div>bExchanged = replica_exchange(fplog, cr, repl_ex, state_global, enerd->term, state,step,t);</div><div><br></div><div><br></div><div>//Performing the first exchange</div><div><div> if (DOMAINDECOMP(cr))</div>
<div> {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span> dd_collect_state(cr->dd,state,state_global);</div></div><div><br></div><div> if (MASTER(cr))</div><div> {<span class="Apple-tab-span" style="white-space:pre">        </span> <span class="Apple-tab-span" style="white-space:pre">                </span> </div>
<div> exchange_state(cr->ms, Y, state_global);<span class="Apple-tab-span" style="white-space:pre">        </span> <span class="Apple-tab-span" style="white-space:pre">        </span> </div><div> }</div><div> </div>
<div><div> if (DOMAINDECOMP(cr)) </div><div> { <span class="Apple-tab-span" style="white-space:pre">                        </span> <span class="Apple-tab-span" style="white-space:pre">                                </span></div><div> dd_partition_system(fplog,step,cr,TRUE,1, </div>
<div> state_global,top_global,ir, </div><div> state,NULL,mdatoms,top,fr,</div><div> vsite,shellfc,constr,</div>
<div> nrnb,wcycle,FALSE); </div><div> }</div></div><div><br></div><div>//Now every node should have its part of the Y simulation</div><div>//Getting potential energy</div>
<div><br></div><div><br></div><div><br></div><div>//Performing the second exchange</div><div><div>if (MASTER(cr))</div><div> { </div><div> exchange_state(cr->ms, Y, state_global);<span class="Apple-tab-span" style="white-space:pre">        </span> // I don't need to call because nothing changed state_global dd_collect_state</div>
<div> }</div></div><div><br></div><div><div> if (DOMAINDECOMP(cr)) </div><div> { <span class="Apple-tab-span" style="white-space:pre">                        </span> <span class="Apple-tab-span" style="white-space:pre">                                </span></div>
<div> dd_partition_system(fplog,step,cr,TRUE,1, </div><div> state_global,top_global,ir, </div><div> state,NULL,mdatoms,top,fr,</div>
<div> vsite,shellfc,constr,</div><div> nrnb,wcycle,FALSE); </div><div> }</div></div><div><br>
</div><div>//Now state Y is back to simulation Y </div><div><br></div><div><br></div><div>The problem is that this simple code gives me problem, in particular it gives LINCS problem</div><div>in do_force the step after my code is executed.</div>
<div><br></div><div>Since forcing bNS=TRUE solves the problem, I guess there is some issue with neighbor list updating</div><div>but I dont understand why.</div><div><br></div><div>I observed that in, after the last dd_partition_system, syste->natoms had an other value compared with the value</div>
<div>it has at the before my code is executed.</div><div><br></div><div>What is my error?</div><div><br></div><div>Thank you in advance,</div><div><br></div><div> Francesco</div>