[petsc-users] question about arbitrary eigenvector selection in SLEPC

Jose E. Roman jroman at dsic.upv.es
Sat May 31 04:46:50 CDT 2014

El 30/05/2014, a las 14:42, Giacomo Mulas escribió:

> On Fri, 30 May 2014, Matthew Knepley wrote:
>> I think its better to use the non-collective version:
>> VecGetOwnershipRange(xr, &low, &high);
>> if ((myindex >= low) && (myindex < high)) {
>>    VecGetArrayRead(xr,&a);
>>    val = a[myindex-low];
>>    VecRestoreArrayRead(xr, &a);
>> }
>> MPI_Allreduce(&val, &gval, 1, MPIU_SCALAR, MPI_SUM, PETSC_COMM_WORLD);
> I agree, and I used the above now. In any case, as it came out of this
> discussion, may I suggest that the man page of EPSSetArbitrarySelection()
> should document that the arbitrary selection user-defined function is
> collective, i.e.  it is called on all nodes in PETSC_COMM_WORLD (and is thus
> an implicit MPI syncronisation point)?  As it is now, if one just looks at
> the docs this is unclear, and it is consequently unclear also if one may use
> collective calls inside that user-defined function (the answer is yes, from
> this discussion).  One may argue that it must be so, since the user-defined
> function can use the eigenvectors which by definition may be nonlocal, but
> making this explicit would not hurt.
> Giacomo



More information about the petsc-users mailing list