[petsc-users] Problem with MPI_Allreduce

Jed Brown jed at jedbrown.org
Tue Sep 18 09:42:24 CDT 2018


Which compiler version are you using?  This warning is harmless, but we
should still clean up these macros to avoid the warning.

Praveen C <cpraveen at gmail.com> writes:

> Dear all
>
> I use MPI_Allreduce in my petsc code and when compiling I see this type of messages
>
> /home/soft/include/petsclog.h:376:57: warning: value computed is not used [-Wunused-value]
>    ((petsc_allreduce_ct += PetscMPIParallelComm(comm),0) || MPI_Allreduce(sendbuf,recvbuf,count,datatype,op,comm))
>                                                          ^
> fdweno.c:564:4: note: in expansion of macro ‘MPI_Allreduce’
>     MPI_Allreduce(&lamx, &lambdax, 1, MPI_DOUBLE, MPI_MAX, PETSC_COMM_WORLD);
>     ^~~~~~~~~~~~~
>
> This is with petsc-3.8.3 on Linux. 
>
> My code crashes due to this error I think, 

This is certainly not why the code crashes.

> while I dont get this problem on my macbook which uses petsc-3.9.0
>
> Since the error is pointing to petsclog.h I thought I will ask here.
>
> Thanks
> praveen


More information about the petsc-users mailing list