<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Sep 14, 2014 at 5:37 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Sun, Sep 14, 2014 at 4:16 PM, Pierre Jolivet <span dir="ltr"><<a href="mailto:jolivet@ann.jussieu.fr" target="_blank">jolivet@ann.jussieu.fr</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">Hello,<br>
Could you please explain to me why the following example is not working properly when <petsc.h> (from master, with OpenMPI 1.8.1) is included ?<br>
<br>
$ mpicxx in-place.cpp  -I$PETSC_DIR/include -I$PETSC_DIR/$PETSC_ARCH/include -L$PETSC_DIR/$PETSC_ARCH/lib -lpetsc<br>
$ mpirun -np 2 ./a.out<br>
Done with the scatter !<br>
0 0 0 0 (this line should be filled with 0)<br>
1 1 1 1 (this line should be filled with 1)<br>
Done with the gather !<br>
<br>
$ mpicxx in-place.cpp  -I$PETSC_DIR/include -I$PETSC_DIR/$PETSC_ARCH/include -L$PETSC_DIR/$PETSC_ARCH/lib -lpetsc -DPETSC_BUG<br>
$ mpirun -np 2 ./a.out<br>
[:3367] *** An error occurred in MPI_Type_size<br>
[:3367] *** reported by process [4819779585,140733193388032]<br>
[:3367] *** on communicator MPI_COMM_WORLD<br>
[:3367] *** MPI_ERR_TYPE: invalid datatype<br>
[:3367] *** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,<br>
[:3367] ***    and potentially your MPI job)<br></blockquote><div><br></div></div></div><div>I just built this with MPICH and it runs fine:</div><div><br></div><div><div>master:/PETSc3/petsc/petsc-pylith$ /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/bin/mpiexec -host localhost -n 2 /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/in-place-obj/in-place </div><span class=""><div>Done with the scatter !</div><div>0 0 0 0 (this line should be filled with 0)</div><div>1 1 1 1 (this line should be filled with 1)</div><div>Done with the gather !</div></span></div><div><br></div><div>Will valgrind.</div></div></div></div></blockquote><div><br></div><div>I think you have a size problem:</div><div><br></div><div><div>==43469== Syscall param writev(vector[...]) points to uninitialised byte(s)</div><div>==43469==    at 0x10297129E: writev (in /usr/lib/libSystem.B.dylib)</div><div>==43469==    by 0x1031F394B: MPIDI_CH3_iSendv (in /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/libmpich.10.dylib)</div><div>==43469==    by 0x1031E728D: MPIDI_CH3_PktHandler_RndvClrToSend (in /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/libmpich.10.dylib)</div><div>==43469==    by 0x1031F4BEC: MPIDI_CH3I_Progress_handle_sock_event (in /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/libmpich.10.dylib)</div><div>==43469==    by 0x1031F4E24: MPIDI_CH3I_Progress (in /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/libmpich.10.dylib)</div><div>==43469==    by 0x1031B51B6: MPIC_Wait (in /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/libmpich.10.dylib)</div><div>==43469==    by 0x1031B638B: MPIC_Send (in /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/libmpich.10.dylib)</div><div>==43469==    by 0x103219BFD: MPIR_Scatter_intra (in /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/libmpich.10.dylib)</div><div>==43469==    by 0x1030EE24C: MPI_Scatter (in /PETSc3/petsc/petsc-pylith/arch-pylith-cxx-debug/lib/libpmpich.10.dylib)</div><div>==43469==    by 0x100002252: main (in-place.cxx:23)</div><div>==43469==  Address 0x103582400 is 32 bytes inside a block of size 64 alloc'd</div><div>==43469==    at 0x10001CC16: malloc (vg_replace_malloc.c:274)</div><div>==43469==    by 0x10304EF04: operator new(unsigned long) (in /usr/lib/libstdc++.6.0.9.dylib)</div><div>==43469==    by 0x10304EF96: operator new[](unsigned long) (in /usr/lib/libstdc++.6.0.9.dylib)</div><div>==43469==    by 0x1000021C4: main (in-place.cxx:15)</div><div>==43469== </div><div>Done with the scatter !</div><div>0 0 0 0 (this line should be filled with 0)</div><div>1 1 1 1 (this line should be filled with 1)</div><div>Done with the gather !</div></div><div><br></div><div>   Matt</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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>   Matt</div><span class=""><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">
Thank you for looking,<br>
Pierre<br>
<br>
</blockquote></span></div><span class=""><font color="#888888"><br><br clear="all"><div><br></div>-- <br>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
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>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>