<div dir="ltr">very clear., thank you Barry.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-10-29 23:30 GMT+01:00 Smith, Barry F. <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"><span class=""><br>
> On Oct 29, 2017, at 5:20 PM, Guido Giuntoli <<a href="mailto:giuntoli1991@gmail.com">giuntoli1991@gmail.com</a>> wrote:<br>
><br>
> I have a ghost vector "b" and I want to work with my local representation adding values in my local part and my ghost padding region. Is this possible or I have to use VecSetValues ?<br>
<br>
</span> What do you really want to do?<br>
<br>
put values into the local and ghosted part and then add up all the ghosted parts into the local parts or<br>
<br>
put values into the local parts and then have the vector fill up the ghosted locations based on the local parts?<br>
<span class=""><br>
><br>
> VecGhostGetLocalForm( b , &b_loc ); VecGetArray( b_loc, &b_arr );<br>
> ...<br>
> VecSetValues( b_loc, n , index, r_e, ADD_VALUES );<br>
> VecRestoreArray( b_loc, &b_arr ); // this communicate something in the ghost padding region ?<br>
<br>
</span>No, restore array communicates nothing. And you don't mix VecGetArray()/RestoreArray() with VecSetValues(). You either call VecSetValues() and then VecAssemblyBegin/End() to put values into a vector OR you use VecGetArray() put the values into the array and then call VecRestoreArray()<br>
<span class="">><br>
> I tried to see the code of VecRestoreArray but does not seem to be communicating anything. I am seeing some routines and I think that adding<br>
><br>
> VecGhostUpdateBegin(b, ADD_VALUES, SCATTER_REVERSE);<br>
> VecGhostUpdateEnd(b, ADD_VALUES, SCATTER_REVERSE);<br>
><br>
> can do what I want, i.e. adding the ghost padding regions on all the processes that correspond.Is this true ? Thank you, Guido.<br>
<br>
</span> This will take the values you put into the ghost locations and add them up and put them into the appropriate global (non-ghost) locations.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
Barry<br>
<br>
<br>
</font></span></blockquote></div><br></div>