[petsc-users] portability question for reduce operations
Barry Smith
bsmith at mcs.anl.gov
Fri Apr 10 17:03:57 CDT 2015
> On Apr 10, 2015, at 4:31 PM, Jed Brown <jed at jedbrown.org> wrote:
>
> Ed Bueler <elbueler at alaska.edu> writes:
>> option 1. full use of MPIU_ types and ops:
>>
>> PetscReal x, xloc;
>> PetscInt n, nloc;
>> MPI_Allreduce(&xloc,&x,1,MPIU_REAL,MPIU_SUM,comm);
>> MPI_Allreduce(&nloc,&n,1,MPIU_INT,MPIU_SUM,comm);
>
> Use MPI_SUM for integer types. MPIU_SUM is for real/scalar types.
With Satish's cleanup of basic type names and organization we should fix this so users don't get bitten by the inconsistency.
It's a pity MPI didn't provide a way to incrementally add new types for already defined Op.
Barry
More information about the petsc-users
mailing list