<div dir="ltr"><div><div><div>Btw, <br><br>If the vector X is created via a DMDA, then the vector localX and the pointer lx obtained via<br><br>
<div class="" title="Page 52">
<div class="">call DMGetLocalVector(da,localX,ierr)<br><div class="">call DMGlobalToLocalBegin(da,X,INSERT_VALUES,localX,ierr)<br>call DMGlobalToLocalEnd(da,X,INSERT_VALUES,localX,ierr)<br>call VecGetArrayReadF90(localX,lx,ierr)<br><span style="font-size:11pt;font-family:"NimbusRomNo9L""></span>
</div>
</div>
</div>
<br></div>are automatically ghosted, right ?<br><br></div>Thx<br><br></div>Timothee<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-02 10:00 GMT+09:00 Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Sorry, I could not control myself.<br>
<br>
So long as you pass vectors created with VecCreateGhost() to KSPSolve() the vectors passed to the multiply inside the solver will also be ghosted vectors.<br>
<br>
Send all output messages etc if it doesn't work for you<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> On Dec 1, 2015, at 6:47 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
><br>
>> On Dec 1, 2015, at 5:18 PM, Bikash Kanungo <<a href="mailto:bikash@umich.edu">bikash@umich.edu</a>> wrote:<br>
>><br>
>> Hi,<br>
>><br>
>> I want to implement a matrix-free KSP solve using user-defined MATOP_MULT and MATOP_MULT_TRANSPOSE. Each of these user-defined functions take in Mat A, Vec x and Vec y as arguments and store A*x in y. To perform A*x in the user defined fashion, each processor requires access to some non-local nodes of x. So, is there a way I can create these two vectors (x and y) using VecCreateGhost?<br>
><br>
> Yes, use VecCreateGhost().<br>
><br>
> Barry<br>
><br>
><br>
>><br>
>> Thanks,<br>
>> Bikash<br>
>><br>
>> --<br>
>> Bikash S. Kanungo<br>
>> PhD Student<br>
>> Computational Materials Physics Group<br>
>> Mechanical Engineering<br>
>> University of Michigan<br>
>><br>
><br>
<br>
</div></div></blockquote></div><br></div>