Hello all,

I hope you are doing well.

Generally, I use gdb <the name of my exe.file> to debug the code.
 I got the attached error message.

I have tried to add the flag -start_in_debugger in the make file, but it didn't 
work, so it seems I was doing it in the wrong way

This is the link for the whole code: sshatanawi/SS_GWM 
(github.com)<https://github.com/sshatanawi/SS_GWM>
[https://opengraph.githubassets.com/9eb6cd14baf12f04848ed209b6f502415eb531bdd7b3a5f9696af68663b870c0/sshatanawi/SS_GWM]<https://github.com/sshatanawi/SS_GWM>
GitHub - sshatanawi/SS_GWM<https://github.com/sshatanawi/SS_GWM>
Contribute to sshatanawi/SS_GWM development by creating an account on GitHub.
github.com


You can read the description of the code in " Model Desprciption.pdf"
the compiling file is makefile_f90 where you can find the linked code files

I really appreciate your help

Bests,
Sawsan
________________________________
From: Mark Adams <[email protected]>
Sent: Friday, January 5, 2024 4:53 AM
To: Shatanawi, Sawsan Muhammad <[email protected]>
Cc: Matthew Knepley <[email protected]>; [email protected] 
<[email protected]>
Subject: Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater 
Flow Simulation Code


[EXTERNAL EMAIL]

This is a segv. As Matt said, you need to use a debugger for this or add print 
statements to narrow down the place where this happens.

You will need to learn how to use debuggers to do your project so you might as 
well start now.

If you have a machine with a GUI debugger that is easier but command line 
debuggers are good to learn anyway.

I tend to run debuggers directly (eg, lldb ./a.out -- program-args ...) and use 
a GUI debugger (eg, Totalview or DDT) if available.

Mark


On Wed, Dec 20, 2023 at 10:02 PM Shatanawi, Sawsan Muhammad via petsc-users 
<[email protected]<mailto:[email protected]>> wrote:
Hello Matthew,

Thank you for your help. I am sorry that I keep coming back with my error 
messages, but I reached a point that I don't know how to fix them, and I don't 
understand them easily.
The list of errors is getting shorter, now I am getting the attached error 
messages

Thank you again,

Sawsan
________________________________
From: Matthew Knepley <[email protected]<mailto:[email protected]>>
Sent: Wednesday, December 20, 2023 6:54 PM
To: Shatanawi, Sawsan Muhammad 
<[email protected]<mailto:[email protected]>>
Cc: Barry Smith <[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Subject: Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater 
Flow Simulation Code


[EXTERNAL EMAIL]

On Wed, Dec 20, 2023 at 9:49 PM Shatanawi, Sawsan Muhammad via petsc-users 
<[email protected]<mailto:[email protected]>> wrote:
Hello Barry,

Thank you a lot for your help, Now I am getting the attached error message.

Do not destroy the PC from KSPGetPC()

  THanks,

     Matt

Bests,
Sawsan
________________________________
From: Barry Smith <[email protected]<mailto:[email protected]>>
Sent: Wednesday, December 20, 2023 6:32 PM
To: Shatanawi, Sawsan Muhammad 
<[email protected]<mailto:[email protected]>>
Cc: Mark Adams <[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Subject: Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater 
Flow Simulation Code


[EXTERNAL EMAIL]

Instead of

    call PCCreate(PETSC_COMM_WORLD, pc, ierr)
    call PCSetType(pc, PCILU,ierr) ! Choose a preconditioner type (ILU)
    call KSPSetPC(ksp, pc,ierr)  ! Associate the preconditioner with the KSP 
solver

do

    call KSPGetPC(ksp,pc,ierr)
    call PCSetType(pc, PCILU,ierr)

Do not call KSPSetUp(). It will be taken care of automatically during the solve



On Dec 20, 2023, at 8:52 PM, Shatanawi, Sawsan Muhammad via petsc-users 
<[email protected]<mailto:[email protected]>> wrote:

Hello,
I don't think that I set preallocation values when I created the matrix, would 
you please have look at my code. It is just the petsc related part from my code.
I was able to fix some of the error messages. Now I have a new set of error 
messages related to the KSP solver (attached)

I appreciate your help

Sawsan
________________________________
From: Mark Adams <[email protected]<mailto:[email protected]>>
Sent: Wednesday, December 20, 2023 6:44 AM
To: Shatanawi, Sawsan Muhammad 
<[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Subject: Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater 
Flow Simulation Code

[EXTERNAL EMAIL]
Did you set preallocation values when you created the matrix?
Don't do that.

On Wed, Dec 20, 2023 at 9:36 AM Shatanawi, Sawsan Muhammad 
<[email protected]<mailto:[email protected]>> wrote:
Hello,

I am trying to create a sparse matrix( which is as I believe a zero matrix) 
then adding some nonzero elements to it over a loop, then assembling it

Get Outlook for 
iOS<https://urldefense.com/v3/__https://aka.ms/o0ukef__;!!JmPEgBY0HMszNaDT!uUJ_jeYf45gcXDGR_PeMjhU7hbd_fKcXJPn0pM9eb-YQihKNYuXMYM9x-hglsbXsCFIwNBWgHXdetHODupsOloE$>
________________________________
From: Mark Adams <[email protected]<mailto:[email protected]>>
Sent: Wednesday, December 20, 2023 2:48 AM
To: Shatanawi, Sawsan Muhammad 
<[email protected]<mailto:[email protected]>>
Cc: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>>
Subject: Re: [petsc-users] Help with Integrating PETSc into Fortran Groundwater 
Flow Simulation Code

[EXTERNAL EMAIL]
I am guessing that you are creating a matrix, adding to it, finalizing it 
("assembly"), and then adding to it again, which is fine, but you are adding 
new non-zeros to the sparsity pattern.
If this is what you want then you can tell the matrix to let you do that.
Otherwise you have a bug.

Mark

On Tue, Dec 19, 2023 at 9:50 PM Shatanawi, Sawsan Muhammad via petsc-users 
<[email protected]<mailto:[email protected]>> wrote:
Hello everyone,

I hope this email finds you well.

 My Name is Sawsan Shatanawi, and I am currently working on developing a 
Fortran code for simulating groundwater flow in a 3D system. The code involves 
solving a nonlinear system, and I have created the matrix to be solved using 
the PCG solver and Picard iteration. However, when I tried to assign it as a 
PETSc matrix I started getting a lot of error messages.

I am kindly asking if someone can help me, I would be happy to share my code 
with him/her.

Please find the attached file contains a list of errors I have gotten

Thank you in advance for your time and assistance.

Best regards,

 Sawsan

<Matrix_RHS.F90><out.txt><solver.F90>



--
What most experimenters take for granted before they begin their experiments is 
infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/<https://urldefense.com/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!JmPEgBY0HMszNaDT!uskvAyF0pMMWDbMIexr9g4qN46V7Rea17GQdNIVG2vH_HMaX7mXgie4ZYgusmPpss_DS7H1_8vn8arGQNSkC$>
[sawsan.shatanawi@login-p2n02 code_allocate]$ gdb GW.exe
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from 
/weka/data/lab/richey/sawsan/GW_CODE/code2024/code_allocate/GW.exe...done.
(gdb) run
Starting program: 
/weka/data/lab/richey/sawsan/GW_CODE/code2024/code_allocate/GW.exe
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: File "/weka/apps/gcc/7.3.0/lib64/libstdc++.so.6.0.24-gdb.py" 
auto-loading has been declined by your `auto-load safe-path' set to 
"$debugdir:$datadir/auto-load:/usr/bin/mono-gdb.py".
To enable execution of this file add
        add-auto-load-safe-path 
/weka/apps/gcc/7.3.0/lib64/libstdc++.so.6.0.24-gdb.py
line to your configuration file "/home/sawsan.shatanawi/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/home/sawsan.shatanawi/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
  5.2000000E-03
   50.00000
   10.00000
  0.0000000E+00
Abort(1091087) on node 0 (rank 0 in comm 0): Fatal error in PMPI_Init: Other 
MPI error, error stack:
MPIR_Init_thread(136):
MPID_Init(939).......:
MPIR_pmi_init(168)...: PMI2_Job_GetId returned 14
[Inferior 1 (process 6712) exited with code 01]
Missing separate debuginfos, use: debuginfo-install 
glibc-2.17-196.el7_4.2.x86_64 libX11-1.6.5-1.el7.x86_64 
libXau-1.0.8-2.1.el7.x86_64 libxcb-1.12-1.el7.x86_64 
numactl-devel-2.0.9-6.el7_2.x86_64
(gdb)

Reply via email to