[petsc-users] Trying to run https://petsc.org/release/src/ksp/ksp/tutorials/ex72.c.html

neil liu liufield at gmail.com
Tue Jul 30 10:50:18 CDT 2024


Hi,
I am trying to use PCBDDC for the vector based FEM. (Complex system, double
precision )
My code can work well with *asm*,
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

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,

*   Mat J;*
*   MatConvert(A, MATIS, MAT_INITIAL_MATRIX, &J);*
*   KSPSetOperators(ksp, A, J);*
*   MatDestroy(&J);*
*   KSPSetInitialGuessNonzero(ksp, PETSC_TRUE);*
*   KSPSetFromOptions(ksp);*

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

Do you have any suggestions?

Thanks ,
Xiaodong


On Mon, Jul 29, 2024 at 6:19 PM neil liu <liufield at gmail.com> wrote:

> When I compile with real data,
> it shows the attached error.
>
> The data file is in binary format, right?
>
>
>
> On Mon, Jul 29, 2024 at 5:36 PM Stefano Zampini <stefano.zampini at gmail.com>
> wrote:
>
>> Your PETSc installation is for complex,  data is for real
>>
>> On Mon, Jul 29, 2024, 23:14 neil liu <liufield at gmail.com> wrote:
>>
>>> 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
>>> ZjQcmQRYFpfptBannerStart
>>> This Message Is From an External Sender
>>> This message came from outside your organization.
>>>
>>> ZjQcmQRYFpfptBannerEnd
>>> 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 at petsc.dev> wrote:
>>>
>>>>
>>>>    This can happen if the data was stored in single precision and PETSc
>>>> was built for double.
>>>>
>>>>
>>>> On Jul 29, 2024, at 3:55 PM, neil liu <liufield at gmail.com> wrote:
>>>>
>>>> This Message Is From an External Sender
>>>> This message came from outside your organization.
>>>> Dear Petsc developers,,
>>>>
>>>> I am trying to run
>>>> https://urldefense.us/v3/__https://petsc.org/release/src/ksp/ksp/tutorials/ex72.c.html__;!!G_uCfscf7eWS!f-0Lu-su_W4yzz3WY5WMTUfWrVt3g96PdhasAO6-CtYzQzHqw-HviyclvMgCjclVqn6LQ6joNJmKan04GFddJg$ 
>>>> <https://urldefense.us/v3/__https://petsc.org/release/src/ksp/ksp/tutorials/ex72.c.html__;!!G_uCfscf7eWS!ZG4gvmS6hQD8ymbvCUDfAatzRUJHzmWO-hOgp9m0xXuAXgIB-fxe_xspYs3WEPi_Ed0UFLMHKanYuYWrTlQGrA$>
>>>> with
>>>>
>>>> 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
>>>>
>>>> The file was downloaded and put in the directory PetscData.
>>>>
>>>> The error is shown as follows,
>>>>
>>>> 0]PETSC ERROR: --------------------- Error Message
>>>> --------------------------------------------------------------
>>>> [0]PETSC ERROR: Read from file failed
>>>> [0]PETSC ERROR: Read past end of file
>>>> [0]PETSC ERROR: WARNING! There are unused option(s) set! Could be the
>>>> program crashed before usage or a spelling mistake, etc!
>>>> [0]PETSC ERROR:   Option left: name:-ksp_error_if_not_converged (no
>>>> value) source: command line
>>>> [0]PETSC ERROR:   Option left: name:-ksp_norm_type value: natural
>>>> source: command line
>>>> [0]PETSC ERROR:   Option left: name:-ksp_type value: cg source: command
>>>> line
>>>> [0]PETSC ERROR:   Option left: name:-pc_type value: bddc source:
>>>> command line
>>>> [0]PETSC ERROR: See https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!f-0Lu-su_W4yzz3WY5WMTUfWrVt3g96PdhasAO6-CtYzQzHqw-HviyclvMgCjclVqn6LQ6joNJmKan22rsyOwQ$ 
>>>> <https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!ZG4gvmS6hQD8ymbvCUDfAatzRUJHzmWO-hOgp9m0xXuAXgIB-fxe_xspYs3WEPi_Ed0UFLMHKanYuYVR0x14Xg$>
>>>>  for trouble shooting.
>>>> [0]PETSC ERROR: Petsc Release Version 3.21.1, unknown
>>>> [0]PETSC ERROR: ./ex72 on a arch-linux-c-opt named
>>>>  Mon Jul 29 15:50:04 2024
>>>> [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
>>>> [0]PETSC ERROR: #1 PetscBinaryRead() at
>>>> /home/xxxxxx/Documents/petsc-3.21.1/petsc/src/sys/fileio/sysio.c:327
>>>> [0]PETSC ERROR: #2 PetscViewerBinaryWriteReadAll() at
>>>> /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/sys/classes/viewer/impls/binary/binv.c:1077
>>>> [0]PETSC ERROR: #3 PetscViewerBinaryReadAll() at
>>>> /home/xiaodong.liu/Documents/petsc-3.21.1/petsc/src/sys/classes/viewer/impls/binary/binv.c:1119
>>>> [0]PETSC ERROR: #4 MatLoad_MPIAIJ_Binary() at
>>>> Documents/petsc-3.21.1/petsc/src/mat/impls/aij/mpi/mpiaij.c:3093
>>>> [0]PETSC ERROR: #5 MatLoad_MPIAIJ() at
>>>> /Documents/petsc-3.21.1/petsc/src/mat/impls/aij/mpi/mpiaij.c:3035
>>>> [0]PETSC ERROR: #6 MatLoad() at
>>>> /Documents/petsc-3.21.1/petsc/src/mat/interface/matrix.c:1344
>>>> [0]PETSC ERROR: #7 MatLoad_IS() at
>>>> /Documents/petsc-3.21.1/petsc/src/mat/impls/is/matis.c:2575
>>>> [0]PETSC ERROR: #8 MatLoad() at
>>>> /home/Documents/petsc-3.21.1/petsc/src/mat/interface/matrix.c:1344
>>>> [0]PETSC ERROR: #9 main() at ex72.c:105
>>>> [0]PETSC ERROR: PETSc Option Table entries:
>>>> [0]PETSC ERROR: -f
>>>> /Documents/PetscData/poisson_DMPLEX_32x32_16.dat (source: command line)
>>>> [0]PETSC ERROR: -ksp_error_if_not_converged (source: command line)
>>>> [0]PETSC ERROR: -ksp_norm_type natural (source: command line)
>>>> [0]PETSC ERROR: -ksp_type cg (source: command line)
>>>> [0]PETSC ERROR: -mat_type is (source: command line)
>>>> [0]PETSC ERROR: -pc_type bddc (source: command line)
>>>> [0]PETSC ERROR: ----------------End of Error Message -------send entire
>>>> error message to petsc-maint at mcs.anl.gov----------
>>>> application called MPI_Abort(MPI_COMM_SELF, 66) - process 0
>>>>
>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240730/d6955940/attachment-0001.html>


More information about the petsc-users mailing list