<div dir="ltr"><div style="color:rgb(0,0,0);font-family:Menlo,Monaco,"Courier New",monospace;font-size:14px;line-height:21px;white-space:pre"><div>It is triggered by</div><div> <span style="color:rgb(0,0,255)">PetscCheck</span>(mat->rmap->N == y->map->N, PetscObjectComm((PetscObject)mat), <span style="color:rgb(9,134,88)">PETSC_ERR_ARG_SIZ</span>, <span style="color:rgb(163,21,21)">"Mat mat,Vec y: global dim </span><span style="color:rgb(205,49,49)">%</span><span style="color:rgb(163,21,21)">"</span> <span style="color:rgb(0,0,255)">PetscInt_FMT</span> <span style="color:rgb(163,21,21)">" </span><span style="color:rgb(205,49,49)">%</span><span style="color:rgb(163,21,21)">"</span> <span style="color:rgb(0,0,255)">PetscInt_FMT</span>, mat->rmap->N, y->map->N);</div><div><br></div><div>The error says in your y = Ax, A has 40 rows but y has 25.</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:14.6667px;white-space:normal">Generally, VecDuplicate(par_xcoord,&par_</span><span style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:14.6667px;white-space:normal">xvec) is wrong since you assume x, y have the same size. </span><br></div><div><br></div></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">--Junchao Zhang</div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 5, 2024 at 4:20 PM Karthikeyan Chockalingam - STFC UKRI via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg3575820422181626103">
<div lang="EN-GB" style="overflow-wrap: break-word;">
<div class="m_3575820422181626103WordSection1">
<p class="MsoNormal"><span style="font-size:11pt">Hello,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">I am unsure why the program crashes even while running the code serially<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> petscErr = MatCreate(mesh.comm().get(), &par_G);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> petscErr = MatSetType(par_G, MATMPIAIJ);
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> petscErr = MatSetSizes(par_G, local_num_rows, local_num_cols, total_num_rows, total_num_cols);
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> PetscInt d_nz = 2;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> PetscInt o_nz = 2;<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> petscErr = MatMPIAIJSetPreallocation(par_G, d_nz, NULL, o_nz, NULL);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> petscErr = VecCreateMPI(mesh.comm().get(),local_num_cols,total_num_cols,&par_xcoord);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"> petscErr = VecDuplicate(par_xcoord,&par_xvec);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black"></span><span style="font-size:9pt;font-family:Menlo;color:rgb(0,16,128)">petscErr</span><span style="font-size:9pt;font-family:Menlo;color:black">
= </span><span style="font-size:9pt;font-family:Menlo;color:rgb(121,94,38)">MatMult</span><span style="font-size:9pt;font-family:Menlo;color:black">(</span><span style="font-size:9pt;font-family:Menlo;color:rgb(0,16,128)">par_G</span><span style="font-size:9pt;font-family:Menlo;color:black">,
</span><span style="font-size:9pt;font-family:Menlo;color:rgb(0,16,128)">par_xcoord</span><span style="font-size:9pt;font-family:Menlo;color:black">,
</span><span style="font-size:9pt;font-family:Menlo;color:rgb(0,16,128)">par_xvec</span><span style="font-size:9pt;font-family:Menlo;color:black">);<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: Nonconforming object sizes<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: Mat mat,Vec y: global dim 40 25<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: WARNING! There are unused option(s) set! Could be the program crashed
before usage or a spelling mistake, etc!<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: Option left: name:--keep-cout (no value) source: command line<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: See <a href="https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!eNf_b1At1lAvdYeAlplIXxQN9WwVYKe1gkVUZRvNkdF0V6JCbVOG_mYTuCQrp2rs8FMod_waFjX0LLNuAvMcHmdf7Hrzm4s3JaQT$" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: Petsc Release Version 3.20.3, unknown <u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: ./example-dbg on a arch-moose named HC20210312 by karthikeyan.chockalingam
Thu Sep 5 22:16:54 2024<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: Configure options --with-64-bit-indices --with-cxx-dialect=C++17 --with-debugging=no
--with-fortran-bindings=0 --with-mpi=1 --with-openmp=1 --with-shared-libraries=1 --with-sowing=0 --download-fblaslapack=1 --download-hypre=1 --download-metis=1 --download-mumps=1 --download-ptscotch=1 --download-parmetis=1 --download-scalapack=1 --download-slepc=1
--download-strumpack=1 --download-superlu_dist=1 --download-bison=1 --download-hdf5=1 --with-hdf5-fortran-bindings=0 --download-hdf5-configure-arguments="--with-zlib" --with-make-np=4 <u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">[0]PETSC ERROR: #1 MatMult() at /Users/karthikeyan.chockalingam/moose/petsc/src/mat/interface/matrix.c:2587<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black">Vec Object: 1 MPI process<u></u><u></u></span></p>
<p class="MsoNormal" style="line-height:13.5pt;background:white"><span style="font-size:9pt;font-family:Menlo;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">Many thanks for the help!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt">Karthik.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif">-- <u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><b><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(45,45,98)">Karthik Chockalingam, Ph.D.<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:black">Senior Research Software Engineer</span><span style="font-size:10.5pt;font-family:Calibri,sans-serif;color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:black">High Performance Systems Engineering Group</span><span style="font-size:10.5pt;font-family:Calibri,sans-serif;color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:black">Hartree Centre | Science and Technology Facilities Council</span><span style="font-size:10.5pt;font-family:Calibri,sans-serif;color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(33,33,33)"><a href="mailto:karthikeyan.chockalingam@stfc.ac.uk" target="_blank"><span style="color:rgb(5,99,193)">karthikeyan.chockalingam@stfc.ac.uk</span></a></span><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(33,33,33)"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Times New Roman",serif;color:black"> </span><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(65,65,65)"> </span><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(33,33,33)"><u></u><u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:10.5pt;font-family:Arial,sans-serif;color:rgb(65,65,65)"> </span></b><span style="font-family:"Times New Roman",serif;color:rgb(31,73,125)"><img border="0" width="254" height="116" style="width: 2.6458in; height: 1.2083in;" id="m_3575820422181626103Picture_x0020_1" src="cid:ii_191c43459764cff311" alt="signature_3970890138"></span><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(33,33,33)"><u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div></blockquote></div>