<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
  #pfptBanneraztcbmm { all: revert !important; display: block !important; 
    visibility: visible !important; opacity: 1 !important; 
    background-color: #D0D8DC !important; 
    max-width: none !important; max-height: none !important }
  .pfptPrimaryButtonaztcbmm:hover, .pfptPrimaryButtonaztcbmm:focus {
    background-color: #b4c1c7 !important; }
  .pfptPrimaryButtonaztcbmm:active {
    background-color: #90a4ae !important; }
</style>

<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">
 Thanks a lot, Berry. It works now. Very interesting. I will explore what MatSetBlockSize is doing. Have a good night. On Wed, Jul 31, 2024 at 6: 21 PM Barry Smith <bsmith@ petsc. dev> wrote: Take a look at src/ksp/ksp/tutorials/ex71. c To
</div>
<!-- Preheader Text : END -->

<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>

<!--[if ((ie)|(mso))]>
  <table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 16px 0px 16px 0px; direction: ltr" ><tr><td>
    <table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 10px 5px 6px; width: 100%; border-radius:4px; border-top:4px solid #90a4ae;background-color:#D0D8DC;"><tr><td valign="top">
      <table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 4px 8px 4px 8px">
        <tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; direction: ltr">
          This Message Is From an External Sender
        </td></tr>
        <tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
          This message came from outside your organization.
        </td></tr>

      </table>

    </td></tr></table>
  </td></tr></table>
<![endif]-->

<![if !((ie)|(mso))]>
  <div dir="ltr"  id="pfptBanneraztcbmm" style="all: revert !important; display:block !important; text-align: left !important; margin:16px 0px 16px 0px !important; padding:8px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #D0D8DC !important; background-color: #D0D8DC; border-top: 4px solid #90a4ae !important; border-top: 4px solid #90a4ae;">
    <div id="pfptBanneraztcbmm" style="all: unset !important; float:left !important; display:block !important; margin: 0px 0px 1px 0px !important; max-width: 600px !important;">
      <div id="pfptBanneraztcbmm" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:18px !important; line-height:18px">
        This Message Is From an External Sender
      </div>
      <div id="pfptBanneraztcbmm" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #D0D8DC !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:18px !important; line-height:18px; margin-top:2px !important;">
This message came from outside your organization.
      </div>

    </div>

    <div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
  </div>
<![endif]>

<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->

<!-- BaNnErBlUrFlE-BoDy-end -->
<div dir="ltr">Thanks a lot, Berry. It works now. <div>Very interesting. I will explore what MatSetBlockSize is doing. </div><div><br></div><div>Have a good night. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 31, 2024 at 6:21 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</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><div><br></div><div>  Take a look at <span style="font-family:Menlo;font-size:14px">src/ksp/ksp/tutorials/ex71.c</span></div><div><br></div>  To have your code below not crash at this point call MatSetBlockSize(A,2) before MatSetUp()<div><br id="m_-2239856327965962259lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jul 31, 2024, at 6:01 PM, neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div dir="ltr">Hi, all, <div>Following Stefano's advice, my code is reorganized as follows, </div><div><br></div><div>  <b>MatCreate(PETSC_COMM_WORLD, &A);</b><br><b>  MatSetType(A, MATIS);<br>  MatSetSizes(A, PETSC_DECIDE, PETSC_DECIDE, numberDof_global, numberDof_global);<br>  MatSetUp(A);<br>  ISLocalToGlobalMapping ltogm;<br>  DMGetLocalToGlobalMapping(dm, &ltogm);<br>  MatSetLocalToGlobalMapping(A, ltogm, ltogm);</b><br></div><div><b><br></b></div><div><div>Then I just ran the above code snippet, which gave me some errors as following. (Local size 67 not compatible with block size 2).</div><div><div>It doesn't seems it is actually calling my routine, but I could be wrong about this.<br></div><div></div></div><div>Can anyone give me some ideas to debug this issue?</div><div>I am just coding vector FEM, assigning 2 dofs each edge and 2 dofs each face. </div></div><div><b><br></b></div><div>The ltogm seems normal. </div><div>ISLocalToGlobalMapping Object: 2 MPI processes<br>  type not yet set<br>[0] 0:2 0:2<br>[0] 2:4 2:4<br>[0] 4:6 54:56<br>[0] 6:8 4:6<br>[0] 8:10 6:8<br>[0] 10:12 8:10<br>[0] 12:14 10:12<br>[0] 14:16 56:58<br>[0] 16:18 12:14<br>[0] 18:20 14:16<br>[0] 20:22 16:18<br>[0] 22:24 58:60<br>[0] 24:26 18:20<br>[0] 26:28 20:22<br>[0] 28:30 22:24<br>[0] 30:32 24:26<br>[0] 32:34 60:62<br>[0] 34:36 26:28<br>[0] 36:38 28:30<br>[0] 38:40 30:32<br>[0] 40:42 32:34<br>[0] 42:44 92:94<br>[0] 44:46 94:96<br>[0] 46:48 34:36<br>[0] 48:50 96:98<br>[0] 50:52 36:38<br>[0] 52:54 98:100<br>[0] 54:56 38:40<br>[0] 56:58 40:42<br>[0] 58:60 100:102<br>[0] 60:62 42:44<br>[0] 62:64 102:104<br>[0] 64:66 44:46<br>[0] 66:68 104:106<br>[0] 68:70 46:48<br>[0] 70:72 106:108<br>[0] 72:74 48:50<br>[0] 74:76 50:52<br>[0] 76:78 108:110<br>[0] 78:80 52:54<br>[1] 0:2 54:56<br>[1] 2:4 56:58<br>[1] 4:6 58:60<br>[1] 6:8 60:62<br>[1] 8:10 62:64<br>[1] 10:12 64:66<br>[1] 12:14 66:68<br>[1] 14:16 68:70<br>[1] 16:18 70:72<br>[1] 18:20 72:74<br>[1] 20:22 74:76<br>[1] 22:24 76:78<br>[1] 24:26 78:80<br>[1] 26:28 80:82<br>[1] 28:30 82:84<br>[1] 30:32 84:86<br>[1] 32:34 86:88<br>[1] 34:36 88:90<br>[1] 36:38 90:92<br>[1] 38:40 92:94<br>[1] 40:42 94:96<br>[1] 42:44 96:98<br>[1] 44:46 98:100<br>[1] 46:48 100:102<br>[1] 48:50 102:104<br>[1] 50:52 104:106<br>[1] 52:54 106:108<br>[1] 54:56 108:110<br>[1] 56:58 110:112<br>[1] 58:60 112:114<br>[1] 60:62 114:116<br>[1] 62:64 116:118<br>[1] 64:66 118:120<br>[1] 66:68 120:122<br>[1] 68:70 122:124<br>[1] 70:72 124:126<br>[1] 72:74 126:128<br>[1] 74:76 128:130<br>[1] 76:78 130:132<br>[1] 78:80 132:134<br></div><div><br></div><div>[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>[0]PETSC ERROR: Arguments are incompatible<br>[0]PETSC ERROR: [1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>Local size 67 not compatible with block size 2<br>[0]PETSC ERROR: See <a href="https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!ezBBwLu_ohCVxEbEjF9KAyHOajlCzLcFYsXr_HXTqn0SGLkTERqqi0jm5qKxXga1bLCySC2Jmm_e5lFYstYzVw$" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.21.1, unknown<br>[0]PETSC ERROR: [1]PETSC ERROR: Arguments are incompatible<br>[1]PETSC ERROR: Local size 67 not compatible with block size 2<br>[1]PETSC ERROR: ./app on a arch-linux-c-debug by xiaodong.liu Wed Jul 31 17:43:28 2024<br>[0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=gfortran --with-cxx=g++ --download-fblaslapack --download-mpich --with-scalar-type=complex --download-triangle<br>[0]PETSC ERROR: See <a href="https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!ezBBwLu_ohCVxEbEjF9KAyHOajlCzLcFYsXr_HXTqn0SGLkTERqqi0jm5qKxXga1bLCySC2Jmm_e5lFYstYzVw$" target="_blank">https://petsc.org/release/faq/</a> for trouble shooting.<br>[1]PETSC ERROR: Petsc Release Version 3.21.1, unknown<br>[1]PETSC ERROR: ./app on a arch-linux-c-debug  by xiaodong.liu Wed Jul 31 17:43:28 2024<br>[1]PETSC ERROR: #1 PetscLayoutSetBlockSize() at /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/vec/is/utils/pmap.c:473<br>[0]PETSC ERROR: #2 MatSetLocalToGlobalMapping_IS() at /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/mat/impls/is/matis.c:2831<br>[0]PETSC ERROR: #3 MatSetLocalToGlobalMapping() at /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/mat/interface/matrix.c:2252<br>Configure options --with-cc=gcc --with-fc=gfortran --with-cxx=g++ --download-fblaslapack --download-mpich --with-scalar-type=complex --download-triangle<br>[1]PETSC ERROR: #1 PetscLayoutSetBlockSize() at /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/vec/is/utils/pmap.c:473<br>[1]PETSC ERROR: After Mat set local to global mapping!<br>#2 MatSetLocalToGlobalMapping_IS() at /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/mat/impls/is/matis.c:2831<br>[1]PETSC ERROR: #3 MatSetLocalToGlobalMapping() at /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/mat/interface/matrix.c:2252<br>After Mat set local to global mapping!<b><br></b></div><div><b><br></b></div><div>Thanks,</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 30, 2024 at 2:51 PM neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</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 dir="ltr">Hi, Stefano,<div><br></div><div>I am trying to understand the example there you mentioned. I have a question, </div><div>the example always use DMDA there. Does BDDC also work for DMPLEX? </div><div><br></div><div>Thanks ,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 30, 2024 at 1:47 PM neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</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 dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Thanks,  Stefano, <div><br></div><div>I am trying to modify the code as follows, </div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;line-height:19px"><div><div><span style="color:rgb(220,220,170)">MatCreate</span>(PETSC_COMM_WORLD, &A);</div><div>  <span style="color:rgb(220,220,170)">MatSetSizes</span>(A, PETSC_DECIDE, PETSC_DECIDE, numberDof_global, numberDof_global);</div><div>  <span style="color:rgb(220,220,170)">MatSetType</span>(A, MATIS);</div><div>  <span style="color:rgb(220,220,170)">MatSetUp</span>(A);</div><div>  <span style="color:rgb(220,220,170)">MatZeroEntries</span>(A);</div><div>  <span style="color:rgb(220,220,170)">VecCreate</span>(PETSC_COMM_WORLD, &b);</div><div>  <span style="color:rgb(220,220,170)">VecSetSizes</span>(b, PETSC_DECIDE,  numberDof_global);</div><div>  <span style="color:rgb(220,220,170)">VecSetUp</span>(b);</div><div>  <span style="color:rgb(220,220,170)">VecSet</span>(b,<span style="color:rgb(181,206,168)">0.0</span>);</div><div>  <span style="color:rgb(220,220,170)">VecDuplicate</span>(b, &x);</div></div><div><br></div><div><span style="color:rgb(86,156,214)">const</span> PetscInt        *g_idx;</div><div>ISLocalToGlobalMapping ltogm;</div><div><span style="color:rgb(220,220,170)">DMGetLocalToGlobalMapping</span>(dm, &ltogm);</div><div><span style="color:rgb(220,220,170)">ISLocalToGlobalMappingGetIndices</span>(ltogm, &g_idx);<br></div><div><br></div><div>//Build idxm_global and Set LHS</div><div><div><span style="color:rgb(156,220,254)">idxm_Global</span>[ idxDofLocal ] = <span style="color:rgb(156,220,254)">g_idx</span>[  numdofPerFace*<span style="color:rgb(156,220,254)">idxm</span>[idxDofLocal]];</div><div><div style="line-height:19px"><div><span style="color:rgb(220,220,170)">MatSetValues</span>(A, numberDof_local, <span style="color:rgb(156,220,254)">idxm_Global</span>.<span style="color:rgb(220,220,170)">data</span>(), numberDof_local, <span style="color:rgb(156,220,254)">idxm_Global</span>.<span style="color:rgb(220,220,170)">data</span>(), <span style="color:rgb(156,220,254)">MatrixLocal</span>.<span style="color:rgb(220,220,170)">data</span>(), ADD_VALUES);</div><div></div></div></div></div><div><br></div><div>//Set RHS</div><div><div>PetscScalar valueDiag = <span style="color:rgb(181,206,168)">1.0</span> ;</div><div>  <span style="color:rgb(220,220,170)">MatZeroRows</span>(A, <span style="color:rgb(156,220,254)">objGeometryInfo</span>.<span style="color:rgb(156,220,254)">numberDof_Dirichlet</span>, (<span style="color:rgb(156,220,254)">objGeometryInfo</span>.<span style="color:rgb(156,220,254)">arrayDofSeqGlobal_Dirichlet</span>).<span style="color:rgb(220,220,170)">data</span>(), valueDiag, <span style="color:rgb(181,206,168)">0</span>, <span style="color:rgb(181,206,168)">0</span>);</div><br><div>  <span style="color:rgb(220,220,170)">VecSetValues</span>(b, <span style="color:rgb(156,220,254)">objGeometryInfo</span>.<span style="color:rgb(156,220,254)">numberDof_Dirichlet</span>, (<span style="color:rgb(156,220,254)">objGeometryInfo</span>.<span style="color:rgb(156,220,254)">arrayDofSeqGlobal_Dirichlet</span>).<span style="color:rgb(220,220,170)">data</span>(), (<span style="color:rgb(156,220,254)">objGeometryInfo</span>.<span style="color:rgb(156,220,254)">dof_Dirichlet</span>).<span style="color:rgb(220,220,170)">data</span>(), INSERT_VALUES);</div><div>  <span style="color:rgb(220,220,170)">VecSetValues</span>(x, <span style="color:rgb(156,220,254)">objGeometryInfo</span>.<span style="color:rgb(156,220,254)">numberDof_Dirichlet</span>, (<span style="color:rgb(156,220,254)">objGeometryInfo</span>.<span style="color:rgb(156,220,254)">arrayDofSeqGlobal_Dirichlet</span>).<span style="color:rgb(220,220,170)">data</span>(), (<span style="color:rgb(156,220,254)">objGeometryInfo</span>.<span style="color:rgb(156,220,254)">dof_Dirichlet</span>).<span style="color:rgb(220,220,170)">data</span>(), INSERT_VALUES);</div><div>  <span style="color:rgb(220,220,170)">ISLocalToGlobalMappingRestoreIndices</span>(ltogm, &g_idx);</div><div>  <span style="color:rgb(220,220,170)">VecAssemblyBegin</span>(b);</div><div>  <span style="color:rgb(220,220,170)">VecAssemblyEnd</span>(b);</div><div>  <span style="color:rgb(220,220,170)">VecAssemblyBegin</span>(x);</div><div>  <span style="color:rgb(220,220,170)">VecAssemblyEnd</span>(x);</div></div></div></div><div>It shows the attached error when I run the code. It seems something wrong is with setting RHS.</div><div>Could you please help me double check my above code to setup the RHS? </div><div>Thanks,</div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 30, 2024 at 11:56 AM Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</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 dir="ltr">BDDC needs the matrix in MATIS format. Using MatConvert will give you back the right format, but the subdomain matrices are wrong. You need to assemble directly in MATIS format, something like<div><br></div><div>MatCreate(comm,&A)</div><div>MatSetType(A,MATIS)</div><div>MatSetLocalToGlobalMapping(A,l2gmap, l2gmap)</div><div>for e in local_elements:</div><div>   E = compute_element_matrix(e)</div><div>   MatSetValues(A,local_element_dofs,local_element_dofs,....)</div><div><br></div><div>l2gmap is an ISLocalToGlobalMapping that stores the global dof number of the dofs that are local to the mesh</div><div><br></div><div>See e.g.  <a href="https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/ksp/tutorials/ex59.c?ref_type=heads__;!!G_uCfscf7eWS!ezBBwLu_ohCVxEbEjF9KAyHOajlCzLcFYsXr_HXTqn0SGLkTERqqi0jm5qKxXga1bLCySC2Jmm_e5lFLn1UiNw$" target="_blank">https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/ksp/tutorials/ex59.c?ref_type=heads</a> or <a href="https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/ksp/tutorials/ex71.c?ref_type=heads__;!!G_uCfscf7eWS!ezBBwLu_ohCVxEbEjF9KAyHOajlCzLcFYsXr_HXTqn0SGLkTERqqi0jm5qKxXga1bLCySC2Jmm_e5lFhsK-8Zg$" target="_blank">https://gitlab.com/petsc/petsc/-/blob/main/src/ksp/ksp/tutorials/ex71.c?ref_type=heads</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno mar 30 lug 2024 alle ore 17:50 neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</a>> ha scritto:<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 dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi, <div>I am trying to use PCBDDC for the vector based FEM. (Complex system, double precision )</div><div>My code can work well with <b>asm</b>, </div><div><div>petsc-3.21.1/petsc/arch-linux-c-opt/bin/mpirun -n 8 ./app -pc_type asm -pc_asm_overlap 6  -ksp_converged_reason -ksp_view -ksp_gmres_modifiedgramschmidt  -ksp_gmres_restart 1500 -ksp_rtol 1e-8 -ksp_monitor -ksp_max_it 100000</div></div><div><br></div><div>When I tried BDDC, it was stuck for solving the linear system (it can not print anything for ksp_monitor). I did the conversion for matrix, </div><div><br></div><div><div><b>   Mat J;</b></div><div><b>   MatConvert(A, MATIS, MAT_INITIAL_MATRIX, &J);</b></div><div><b>   KSPSetOperators(ksp, A, J);</b></div><div><b>   MatDestroy(&J);</b></div><div><b>   KSPSetInitialGuessNonzero(ksp, PETSC_TRUE);</b></div><div><b>   KSPSetFromOptions(ksp);</b></div></div><div><br></div><div>petsc-3.21.1/petsc/arch-linux-c-debug/bin/mpirun -n 2 ./app -ksp_type cg -pc_type bddc -ksp_monitor  -mat_type is </div><div><br></div><div>Do you have any suggestions? </div><div><br></div><div>Thanks ,</div><div>Xiaodong </div><div><br></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2024 at 6:19 PM neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</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 dir="ltr">When I compile with real data, <div>it shows the attached error.</div><div><br></div><div>The data file is in binary format, right? </div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2024 at 5:36 PM Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com" target="_blank">stefano.zampini@gmail.com</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 dir="auto">Your PETSc installation is for complex,  data is for real</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2024, 23:14 neil liu <<a href="mailto:liufield@gmail.com" target="_blank">liufield@gmail.com</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 style="font-size:1px;color:rgb(255,255,255);line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;display:none">
 I compiled Petsc with single precision. However, it is not converged with the data. Please see the attached file. On Mon, Jul 29, 2024 at 4: 25 PM Barry Smith <bsmith@ petsc. dev> wrote: This can happen if the data was stored in single precision
</div>



<div style="font-size:1px;color:rgb(255,255,255);line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;display:none">ZjQcmQRYFpfptBannerStart</div>



<u></u>
  <div dir="ltr" id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406pfptBannerjh3984n" style="display:block;text-align:left;margin:16px 0px;padding:8px 16px;border-radius:4px;min-width:200px;background-color:rgb(208,216,220);border-top:4px solid rgb(144,164,174)">
    <div id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406pfptBannerjh3984n" style="float:left;display:block;margin:0px 0px 1px;max-width:600px">
      <div id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406pfptBannerjh3984n" style="display:block;background-color:rgb(208,216,220);font-family:Arial,sans-serif;font-weight:bold;font-size:14px;line-height:18px">
        This Message Is From an External Sender
      </div>
      <div id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406pfptBannerjh3984n" style="font-weight:normal;display:block;background-color:rgb(208,216,220);font-family:Arial,sans-serif;font-size:12px;line-height:18px;margin-top:2px">
This message came from outside your organization.
      </div>

    </div>

    <div style="height:0px;clear:both;display:block;line-height:0;font-size:0.01px"> </div>
  </div>
<u></u>

<div style="font-size:1px;color:rgb(255,255,255);line-height:1px;height:0px;max-height:0px;opacity:0;overflow:hidden;display:none">ZjQcmQRYFpfptBannerEnd</div>



<div dir="ltr">I compiled Petsc with single precision. However, it is not converged with the data. <div><br></div><div>Please see the attached file. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 29, 2024 at 4:25 PM Barry Smith <<a href="mailto:bsmith@petsc.dev" rel="noreferrer" target="_blank">bsmith@petsc.dev</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><div><br></div>   This can happen if the data was stored in single precision and PETSc was built for double.<div><br id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406m_1119809984899598126lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On Jul 29, 2024, at 3:55 PM, neil liu <<a href="mailto:liufield@gmail.com" rel="noreferrer" target="_blank">liufield@gmail.com</a>> wrote:</div><br><div><div dir="ltr" id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406m_1119809984899598126pfptBanner977okag" style="writing-mode:revert;color:revert;font-family:revert;font-feature-settings:revert;font-kerning:revert;font-size:revert;font-stretch:revert;font-variant-alternates:revert;font-variant-caps:revert;font-variant-east-asian:revert;font-variant-ligatures:revert;font-variant-numeric:revert;font-weight:revert;text-orientation:revert;zoom:revert;letter-spacing:revert;background-blend-mode:revert;background-image:revert;background-position:revert;background-repeat:revert;background-size:revert;border-collapse:revert;box-sizing:revert;break-after:revert;break-before:revert;break-inside:revert;caption-side:revert;clear:revert;columns:revert;column-fill:revert;column-gap:revert;column-rule:revert;column-span:revert;empty-cells:revert;float:revert;image-orientation:revert;isolation:revert;line-break:revert;line-height:revert;list-style:revert;mix-blend-mode:revert;object-fit:revert;object-position:revert;outline:revert;overflow:revert;quotes:revert;table-layout:revert;text-align:left;text-align-last:revert;text-decoration:revert;text-emphasis:revert;text-indent:revert;text-overflow:revert;text-transform:revert;text-underline-position:revert;vertical-align:revert;white-space:revert;word-break:revert;border-spacing:revert;word-spacing:revert;background-clip:revert;background-origin:revert;text-combine-upright:revert;display:block;opacity:revert;background-color:rgb(208,216,220);border-bottom:revert;border-left:revert;border-right:revert;height:revert;max-height:revert;max-width:revert;min-height:revert;width:revert;margin:16px 0px;padding:8px 16px;border-radius:4px;min-width:200px;border-top:4px solid rgb(144,164,174)"><div id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406m_1119809984899598126pfptBanner977okag" style="writing-mode:unset;color:unset;font-family:unset;font-feature-settings:unset;font-kerning:unset;font-size:unset;font-stretch:unset;font-variant-alternates:unset;font-variant-caps:unset;font-variant-east-asian:unset;font-variant-ligatures:unset;font-variant-numeric:unset;font-weight:unset;text-orientation:unset;zoom:unset;letter-spacing:unset;background:unset;background-blend-mode:unset;border-collapse:unset;border:unset;box-sizing:unset;break-after:unset;break-before:unset;break-inside:unset;caption-side:unset;clear:unset;columns:unset;column-fill:unset;column-gap:unset;column-rule:unset;column-span:unset;empty-cells:unset;float:left;image-orientation:unset;isolation:unset;line-break:unset;line-height:unset;list-style:unset;mix-blend-mode:unset;object-fit:unset;object-position:unset;outline:unset;overflow:unset;quotes:unset;table-layout:unset;text-align:unset;text-align-last:unset;text-decoration:unset;text-emphasis:unset;text-indent:unset;text-overflow:unset;text-transform:unset;text-underline-position:unset;vertical-align:unset;white-space:unset;word-break:unset;border-spacing:unset;word-spacing:unset;text-combine-upright:unset;display:block;opacity:unset;border-radius:unset;height:unset;max-height:unset;min-height:unset;min-width:unset;padding:unset;width:unset;margin:0px 0px 1px;max-width:600px"><div id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406m_1119809984899598126pfptBanner977okag" style="writing-mode:unset;font-family:Arial,sans-serif;font-feature-settings:unset;font-kerning:unset;font-size:14px;font-stretch:unset;font-variant-alternates:unset;font-variant-caps:unset;font-variant-east-asian:unset;font-variant-ligatures:unset;font-variant-numeric:unset;font-weight:bold;text-orientation:unset;zoom:unset;letter-spacing:unset;background-blend-mode:unset;background-image:unset;background-position:unset;background-repeat:unset;background-size:unset;border-collapse:unset;border:unset;box-sizing:unset;break-after:unset;break-before:unset;break-inside:unset;caption-side:unset;clear:unset;columns:unset;column-fill:unset;column-gap:unset;column-rule:unset;column-span:unset;empty-cells:unset;float:unset;image-orientation:unset;isolation:unset;line-break:unset;line-height:18px;list-style:unset;mix-blend-mode:unset;object-fit:unset;object-position:unset;outline:unset;overflow:unset;quotes:unset;table-layout:unset;text-align:unset;text-align-last:unset;text-decoration:unset;text-emphasis:unset;text-indent:unset;text-overflow:unset;text-transform:unset;text-underline-position:unset;vertical-align:unset;white-space:unset;word-break:unset;border-spacing:unset;word-spacing:unset;background-clip:unset;background-origin:unset;text-combine-upright:unset;display:block;opacity:unset;background-color:rgb(208,216,220);border-radius:unset;height:unset;margin:unset;max-height:unset;max-width:unset;min-height:unset;min-width:unset;padding:unset;width:unset">This Message Is From an External Sender</div><div id="m_-2239856327965962259m_-2933746583518044767m_1039448764346947703m_8328480842401277584m_-4396857026391268921m_6884232443723312085m_-6590455808610094212m_7732474076351893m_-5300983367603411026m_-4830749107460118727m_7814453640049424406m_1119809984899598126pfptBanner977okag" style="writing-mode:unset;font-family:Arial,sans-serif;font-feature-settings:unset;font-kerning:unset;font-size:12px;font-stretch:unset;font-variant-alternates:unset;font-variant-caps:unset;font-variant-east-asian:unset;font-variant-ligatures:unset;font-variant-numeric:unset;font-weight:unset;text-orientation:unset;zoom:unset;letter-spacing:unset;background-blend-mode:unset;background-image:unset;background-position:unset;background-repeat:unset;background-size:unset;border-collapse:unset;border:unset;box-sizing:unset;break-after:unset;break-before:unset;break-inside:unset;caption-side:unset;clear:unset;columns:unset;column-fill:unset;column-gap:unset;column-rule:unset;column-span:unset;empty-cells:unset;float:unset;image-orientation:unset;isolation:unset;line-break:unset;line-height:18px;list-style:unset;mix-blend-mode:unset;object-fit:unset;object-position:unset;outline:unset;overflow:unset;quotes:unset;table-layout:unset;text-align:unset;text-align-last:unset;text-decoration:unset;text-emphasis:unset;text-indent:unset;text-overflow:unset;text-transform:unset;text-underline-position:unset;vertical-align:unset;white-space:unset;word-break:unset;border-spacing:unset;word-spacing:unset;background-clip:unset;background-origin:unset;text-combine-upright:unset;display:block;opacity:unset;background-color:rgb(208,216,220);border-radius:unset;height:unset;margin-bottom:unset;margin-left:unset;margin-right:unset;max-height:unset;max-width:unset;min-height:unset;min-width:unset;padding:unset;width:unset;margin-top:2px">This message came from outside your organization.</div></div><div style="height:0px;clear:both;display:block;line-height:0;font-size:0.01px"></div></div><div dir="ltr" style="font-family:Helvetica;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear Petsc developers,,<br><div><br></div><div>I am trying to run </div><div><a href="https://urldefense.us/v3/__https://petsc.org/release/src/ksp/ksp/tutorials/ex72.c.html__;!!G_uCfscf7eWS!ZG4gvmS6hQD8ymbvCUDfAatzRUJHzmWO-hOgp9m0xXuAXgIB-fxe_xspYs3WEPi_Ed0UFLMHKanYuYWrTlQGrA$" rel="noreferrer" target="_blank">https://petsc.org/release/src/ksp/ksp/tutorials/ex72.c.html</a><br></div><div>with </div><div><br></div><div><div>petsc-3.21.1/petsc/arch-linux-c-opt/bin/mpirun -n 2 ./ex72  -f /Documents/PetscData/poisson_DMPLEX_32x32_16.dat -pc_type bddc -ksp_type cg -ksp_norm_type natural -ksp_error_if_not_converged -mat_type is</div></div><div><br></div><div>The file was downloaded and put in the directory PetscData. </div><div><br></div><div>The error is shown as follows,</div><div><br></div><div><div>0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------</div><div>[0]PETSC ERROR: Read from file failed</div><div>[0]PETSC ERROR: Read past end of file</div><div>[0]PETSC ERROR: WARNING! There are unused option(s) set! Could be the program crashed before usage or a spelling mistake, etc!</div><div>[0]PETSC ERROR:   Option left: name:-ksp_error_if_not_converged (no value) source: command line</div><div>[0]PETSC ERROR:   Option left: name:-ksp_norm_type value: natural source: command line</div><div>[0]PETSC ERROR:   Option left: name:-ksp_type value: cg source: command line</div><div>[0]PETSC ERROR:   Option left: name:-pc_type value: bddc source: command line</div><div>[0]PETSC ERROR: See<span> </span><a href="https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!ZG4gvmS6hQD8ymbvCUDfAatzRUJHzmWO-hOgp9m0xXuAXgIB-fxe_xspYs3WEPi_Ed0UFLMHKanYuYVR0x14Xg$" rel="noreferrer" target="_blank">https://petsc.org/release/faq/</a><span> </span>for trouble shooting.</div><div>[0]PETSC ERROR: Petsc Release Version 3.21.1, unknown </div><div>[0]PETSC ERROR: ./ex72 on a arch-linux-c-opt named</div><div> Mon Jul 29 15:50:04 2024</div><div>[0]PETSC ERROR: Configure options --with-cc=gcc --with-fc=gfortran --with-cxx=g++ --download-fblaslapack --download-mpich --with-scalar-type=complex --download-triangle --with-debugging=no</div><div>[0]PETSC ERROR: #1 PetscBinaryRead() at /home/xxxxxx/Documents/petsc-3.21.1/petsc/src/sys/fileio/sysio.c:327</div><div>[0]PETSC ERROR: #2 PetscViewerBinaryWriteReadAll() at /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/sys/classes/viewer/impls/binary/binv.c:1077</div><div>[0]PETSC ERROR: #3 PetscViewerBinaryReadAll() at /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/sys/classes/viewer/impls/binary/binv.c:1119</div><div>[0]PETSC ERROR: #4 MatLoad_MPIAIJ_Binary() at Documents/petsc-3.21.1/petsc/src/mat/impls/aij/mpi/mpiaij.c:3093</div><div>[0]PETSC ERROR: #5 MatLoad_MPIAIJ() at /Documents/petsc-3.21.1/petsc/src/mat/impls/aij/mpi/mpiaij.c:3035</div><div>[0]PETSC ERROR: #6 MatLoad() at /Documents/petsc-3.21.1/petsc/src/mat/interface/matrix.c:1344</div><div>[0]PETSC ERROR: #7 MatLoad_IS() at /Documents/petsc-3.21.1/petsc/src/mat/impls/is/matis.c:2575</div><div>[0]PETSC ERROR: #8 MatLoad() at /home/Documents/petsc-3.21.1/petsc/src/mat/interface/matrix.c:1344</div><div>[0]PETSC ERROR: #9 main() at ex72.c:105</div><div>[0]PETSC ERROR: PETSc Option Table entries:</div><div>[0]PETSC ERROR: -f </div><div>/Documents/PetscData/poisson_DMPLEX_32x32_16.dat (source: command line)</div><div>[0]PETSC ERROR: -ksp_error_if_not_converged (source: command line)</div><div>[0]PETSC ERROR: -ksp_norm_type natural (source: command line)</div><div>[0]PETSC ERROR: -ksp_type cg (source: command line)</div><div>[0]PETSC ERROR: -mat_type is (source: command line)</div><div>[0]PETSC ERROR: -pc_type bddc (source: command line)</div><div>[0]PETSC ERROR: ----------------End of Error Message -------send entire error message to<span> </span><a href="mailto:petsc-maint@mcs.anl.gov" rel="noreferrer" target="_blank">petsc-maint@mcs.anl.gov</a>----------</div><div>application called MPI_Abort(MPI_COMM_SELF, 66) - process 0</div></div></div></div></div></div></div></div></blockquote></div><br></div></div></blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature">Stefano</div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>