[email protected] writes:

> Dear Petsc developers,
>
> I have a vector object M, I need all the elements of it in all the
> processors.
>
> Here is a part of my code
>
> //////////////////////////////////////////////////////////////
> Vec M;
> VecScatterCreateToAll(M,&scatter_ctx,&N);
> VecScatterBegin(scatter_ctx,M,N,INSERT_VALUES,SCATTER_FORWARD);
> VecScatterEnd(scatter_ctx,M,N,INSERT_VALUES,SCATTER_FORWARD);
>
> VecGetArray(N, &aM);
>
> for(i=xs; i<xs+xm; i++)

What are xs and xm in this setting.  What do you intend?

> {
>    //within the loop, requires all the elements of aM
> }
> ////////////////////////////////////////////////////////////
>
> but this seems not working well. 

The phrase "not working" should never appear unqualified in polite
conversation.  Send steps to reproduce, what you expect, and what you
observe.

> Would you please suggest a more efficient way? Thank you.

Attachment: pgpWwmC0GbaTm.pgp
Description: PGP signature

Reply via email to