[petsc-users] How to know the cpu rank that hold the minimum vec values

Barry Smith bsmith at mcs.anl.gov
Thu Mar 23 20:40:37 CDT 2017


> On Mar 23, 2017, at 8:31 PM, 丁老师 <ztdepyahoo at 163.com> wrote:
> 
> Dear professor:
>      I got the location and value of the minimum in a vec with VecMin, But how to know the rank of CPU which holds the minimum values.
> This rank should be known in the whole communicator.

 You can call VecGetOwnershipRanges() and then perform bisection on the resulting array to determine which process contains the vector location returned by VecMin().

   Barry

> 
> Regards
>  
> 
> 
>  



More information about the petsc-users mailing list