Thanks Jed,<br><br>I added your code into the petsc. I run my code with 10240 cores. I got the following error messages:<br><br>[6724]PETSC ERROR: --------------------- Error Message ------------------------------------<br>
[6724]PETSC ERROR: Petsc has generated inconsistent data!<br>[6724]PETSC ERROR: Negative MPI source: stash->nrecvs=8 i=11 MPI_SOURCE=-32766 MPI_TAG=-32766 MPI_ERROR=20613892!<br>[6724]PETSC ERROR: ------------------------------------------------------------------------<br>
[6724]PETSC ERROR: Petsc Release Version 3.4.1, unknown <br>[6724]PETSC ERROR: See docs/changes/index.html for recent updates.<br>[6724]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>[6724]PETSC ERROR: See docs/index.html for manual pages.<br>
[6724]PETSC ERROR: ------------------------------------------------------------------------<br>[6724]PETSC ERROR: ./linearElasticity on a arch-linux2-cxx-debug named ys4350 by fandek Sun Jun 23 02:58:23 2013<br>[6724]PETSC ERROR: Libraries linked from /glade/p/work/fandek/petsc/arch-linux2-cxx-debug/lib<br>
[6724]PETSC ERROR: Configure run at Sun Jun 23 00:46:05 2013<br>[6724]PETSC ERROR: Configure options --with-valgrind=1 --with-clanguage=cxx --with-shared-libraries=1 --with-dynamic-loading=1 --download-f-blas-lapack=1 --with-mpi=1 --d<br>
ownload-parmetis=1 --download-metis=1 --with-64-bit-indices=1 --download-netcdf=1 --download-exodusii=1 --download-ptscotch=1 --download-hdf5=1 --with-debugging=yes<br>[6724]PETSC ERROR: ------------------------------------------------------------------------<br>
[6724]PETSC ERROR: MatStashScatterGetMesg_Private() line 633 in /src/mat/utilsmatstash.c<br>[6724]PETSC ERROR: MatAssemblyEnd_MPIAIJ() line 676 in /src/mat/impls/aij/mpimpiaij.c<br>[6724]PETSC ERROR: MatAssemblyEnd() line 4939 in /src/mat/interfacematrix.c<br>
[6724]PETSC ERROR: SpmcsDMMeshCreatVertexMatrix() line 65 in meshreorder.cpp<br>[6724]PETSC ERROR: SpmcsDMMeshReOrderingMeshPoints() line 125 in meshreorder.cpp<br>[6724]PETSC ERROR: CreateProblem() line 59 in preProcessSetUp.cpp<br>
[6724]PETSC ERROR: DMmeshInitialize() line 78 in mgInitialize.cpp<br>[6724]PETSC ERROR: main() line 71 in linearElasticity3d.cpp<br>Abort(77) on node 6724 (rank 6724 in comm 1140850688): application called MPI_Abort(MPI_COMM_WORLD, 77) - process 6724<br>
[2921]PETSC ERROR: --------------------- Error Message ------------------------------------<br>[2921]PETSC ERROR: Petsc has generated inconsistent data!<br>[2921]PETSC ERROR: Negative MPI source: stash->nrecvs=15 i=3 MPI_SOURCE=-32766 MPI_TAG=-32766 MPI_ERROR=3825270!<br>
[2921]PETSC ERROR: ------------------------------------------------------------------------<br>[2921]PETSC ERROR: Petsc Release Version 3.4.1, unknown <br>[2921]PETSC ERROR: See docs/changes/index.html for recent updates.<br>
[2921]PETSC ERROR: See docs/faq.html for hints about trouble shooting.<br>[2921]PETSC ERROR: See docs/index.html for manual pages.<br>[2921]PETSC ERROR: ------------------------------------------------------------------------<br>
[2921]PETSC ERROR: ./linearElasticity on a arch-linux2-cxx-debug named ys0270 by fandek Sun Jun 23 02:58:23 2013<br>[2921]PETSC ERROR: Libraries linked from /glade/p/work/fandek/petsc/arch-linux2-cxx-debug/lib<br>[2921]PETSC ERROR: Configure run at Sun Jun 23 00:46:05 2013<br>
[2921]PETSC ERROR: Configure options --with-valgrind=1 --with-clanguage=cxx --with-shared-libraries=1 --with-dynamic-loading=1 --download-f-blas-lapack=1 --with-mpi=1 --download-parmetis=1 --download-metis=1 --with-64-bit-indices=1 --download-netcdf=1 --download-exodusii=1 --download-ptscotch=1 --download-hdf5=1 --with-debugging=yes<br>
[2921]PETSC ERROR: ------------------------------------------------------------------------<br>[2921]PETSC ERROR: MatStashScatterGetMesg_Private() line 633 in /src/mat/utilsmatstash.c<br>[2921]PETSC ERROR: MatAssemblyEnd_MPIAIJ() line 676 in /src/mat/impls/aij/mpimpiaij.c<br>
[2921]PETSC ERROR: MatAssemblyEnd() line 4939 in /src/mat/interfacematrix.c<br>[2921]PETSC ERROR: SpmcsDMMeshCreatVertexMatrix() line 65 in meshreorder.cpp<br>[2921]PETSC ERROR: SpmcsDMMeshReOrderingMeshPoints() line 125 in meshreorder.cpp<br>
[2921]PETSC ERROR: CreateProblem() line 59 in preProcessSetUp.cpp<br>[2921]PETSC ERROR: DMmeshInitialize() line 78 in mgInitialize.cpp<br>[2921]PETSC ERROR: main() line 71 in linearElasticity3d.cpp<br>:<br><br><div class="gmail_quote">
On Fri, Jun 21, 2013 at 4:33 AM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Fande Kong <<a href="mailto:fd.kong@siat.ac.cn">fd.kong@siat.ac.cn</a>> writes:<br>
<br>
> The code works well with less cores. And It also works well with<br>
> petsc-3.3-p7. But it does not work with petsc-3.4.1. Thus, If you can check<br>
> the differences between petsc-3.3-p7 and petsc-3.4.1, you can figure out<br>
> the reason.<br>
<br>
</div>That is one way to start debugging, but there are no changes to the core<br>
MatStash code, and many, many changes to PETSc in total.  The relevant<br>
snippet of code is here:<br>
<br>
    if (stash->reproduce) {<br>
      i    = stash->reproduce_count++;<br>
      ierr = MPI_Wait(stash->recv_waits+i,&recv_status);CHKERRQ(ierr);<br>
    } else {<br>
      ierr = MPI_Waitany(2*stash->nrecvs,stash->recv_waits,&i,&recv_status);CHKERRQ(ierr);<br>
    }<br>
    if (recv_status.MPI_SOURCE < 0) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Negative MPI source!");<br>
<br>
So MPI returns correctly (stash->reproduce will be FALSE unless you<br>
changed it).  You could change the line above to the following:<br>
<br>
  if (recv_status.MPI_SOURCE < 0) SETERRQ5(PETSC_COMM_SELF,PETSC_ERR_PLIB,"Negative MPI source: stash->nrecvs=%D i=%d MPI_SOURCE=%d MPI_TAG=%d MPI_ERROR=%d",<br>
                                          stash->nrecvs,i,recv_status.MPI_SOURCE,recv_status.MPI_TAG,recv_status.MPI_ERROR);<br>
<br>
<br>
It would help to debug --with-debugging=1, so that more checks for<br>
corrupt data are performed.  You can still make the compiler optimize if<br>
it takes a long time to reach the error condition.<br>
</blockquote></div><br><br clear="all"><br>-- <br><div style="line-height:21px;font-family:Verdana;font-size:14px;background-color:rgb(255,255,255)">Fande Kong</div><div style="line-height:21px;font-family:Verdana;font-size:14px;background-color:rgb(255,255,255)">
ShenZhen Institutes of Advanced Technology</div><div style="line-height:21px;font-family:Verdana;font-size:14px;background-color:rgb(255,255,255)">Chinese Academy of Sciences</div>