<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 10, 2015 at 3:27 AM, TAY wee-beng <span dir="ltr"><<a href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Inside my subroutine, I need to access the DA variable cu_types_array frequently.<br>
<br>
So I need to call DMDAVecGetArrayF90 and DMDAVecRestoreArrayF90 before and after frequently.<br>
<br>
Is this necessary? Can I call DMDAVecGetArrayF90 at the start and only call DMDAVecRestoreArrayF90 towards the end, where I don't need to modify the values of cu_types_array anymore?<br>
<br>
Will this cause memory corruption?<br></blockquote><div><br></div><div>You cannot use any other vector operations before you have called Restore.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Also, must the array be restored using DMDAVecRestoreArrayF90 before calling DMLocalToLocalBegin,DMLocalToLocalEnd?</blockquote><div><br></div><div>Yes.</div><div><br></div><div>  Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888"><br>
-- <br>
Thank you.<br>
<br>
Yours sincerely,<br>
<br>
TAY wee-beng<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>