<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Feb 8, 2015 at 11:43 AM, Gideon Simpson <span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">What should I make of the following warning, where I have used an MPI_Allreduce on a quantity computed on each processor.<div><br></div><div><div style="margin:0px;font-family:Menlo">include -I/opt/local/include -I/opt/local/include/mpich-gcc48  -I/opt/local/include   `pwd`/petsc_trapz1.c</div><div style="margin:0px;font-family:Menlo">In file included from /opt/local/lib/petsc/include/petscsys.h:1794:0,</div><div style="margin:0px;font-family:Menlo">                 from /opt/local/lib/petsc/include/petscis.h:7,</div><div style="margin:0px;font-family:Menlo">                 from /opt/local/lib/petsc/include/petscvec.h:9,</div><div style="margin:0px;font-family:Menlo">                 from /Users/gideon/code/trapz/petsc_trapz1.c:3:</div><div style="margin:0px;font-family:Menlo">/Users/gideon/code/trapz/petsc_trapz1.c: In function 'main':</div><div style="margin:0px;font-family:Menlo">/opt/local/lib/petsc/include/petsclog.h:370:57: warning: value computed is not used [-Wunused-value]</div><div style="margin:0px;font-family:Menlo">   ((petsc_allreduce_ct += PetscMPIParallelComm(comm),0) || MPI_Allreduce(sendbuf,recvbuf,count,datatype,op,comm))</div><div style="margin:0px;font-family:Menlo">                                                         ^</div><div style="margin:0px;font-family:Menlo">/Users/gideon/code/trapz/petsc_trapz1.c:110:3: note: in expansion of macro 'MPI_Allreduce'</div><div style="margin:0px;font-family:Menlo">   MPI_Allreduce(&local_trapz, &global_trapz, 1, MPI_DOUBLE, MPI_SUM, PETSC_COMM_WORLD);</div></div></div></blockquote><div><br></div><div>It looks like you are not checking the return code:</div><div><br></div><div>ierr = <span style="font-family:Menlo">MPI_Allreduce(&local_trapz, &global_trapz, 1, MPI_DOUBLE, MPI_SUM, PETSC_COMM_WORLD);CHKERRQ(ierr);</span></div><div><span style="font-family:Menlo"><br></span></div><div><span style="font-family:Menlo">   Matt</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br><div>
<span style="border-collapse:separate;border-spacing:0px">-gideon</span>

</div>
<br></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>