Yup, that cleared it. Thanks.
-gideon

> On Feb 8, 2015, at 12:51 PM, Matthew Knepley <[email protected]> wrote:
> 
> On Sun, Feb 8, 2015 at 11:43 AM, Gideon Simpson <[email protected] 
> <mailto:[email protected]>> wrote:
> What should I make of the following warning, where I have used an 
> MPI_Allreduce on a quantity computed on each processor.
> 
> include -I/opt/local/include -I/opt/local/include/mpich-gcc48  
> -I/opt/local/include   `pwd`/petsc_trapz1.c
> In file included from /opt/local/lib/petsc/include/petscsys.h:1794:0,
>                  from /opt/local/lib/petsc/include/petscis.h:7,
>                  from /opt/local/lib/petsc/include/petscvec.h:9,
>                  from /Users/gideon/code/trapz/petsc_trapz1.c:3:
> /Users/gideon/code/trapz/petsc_trapz1.c: In function 'main':
> /opt/local/lib/petsc/include/petsclog.h:370:57: warning: value computed is 
> not used [-Wunused-value]
>    ((petsc_allreduce_ct += PetscMPIParallelComm(comm),0) || 
> MPI_Allreduce(sendbuf,recvbuf,count,datatype,op,comm))
>                                                          ^
> /Users/gideon/code/trapz/petsc_trapz1.c:110:3: note: in expansion of macro 
> 'MPI_Allreduce'
>    MPI_Allreduce(&local_trapz, &global_trapz, 1, MPI_DOUBLE, MPI_SUM, 
> PETSC_COMM_WORLD);
> 
> It looks like you are not checking the return code:
> 
> ierr = MPI_Allreduce(&local_trapz, &global_trapz, 1, MPI_DOUBLE, MPI_SUM, 
> PETSC_COMM_WORLD);CHKERRQ(ierr);
> 
>    Matt
>  
> 
> -gideon
> 
> 
> 
> 
> -- 
> What most experimenters take for granted before they begin their experiments 
> is infinitely more interesting than any results to which their experiments 
> lead.
> -- Norbert Wiener

Reply via email to