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

Giacomo Mulas gmulas at oa-cagliari.inaf.it
Fri May 30 07:42:07 CDT 2014


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

-- 
_________________________________________________________________

Giacomo Mulas <gmulas at oa-cagliari.inaf.it>
_________________________________________________________________

INAF - Osservatorio Astronomico di Cagliari
via della scienza 5 - 09047 Selargius (CA)

tel.   +39 070 71180244
mob. : +39 329  6603810
_________________________________________________________________

"When the storms are raging around you, stay right where you are"
                          (Freddy Mercury)
_________________________________________________________________


More information about the petsc-users mailing list