Re: [petsc-users] Using PETSc Data Types with Existing F90 Functions

2019-01-04 Thread Smith, Barry F. via petsc-users


   VecGetArrayF90()? Then a loop over the entries?

> On Jan 4, 2019, at 3:23 PM, Kevin Mattalo via petsc-users 
>  wrote:
> 
> Hello,
> 
> I am currently implementing an implicit discretization of a high-order
> DG method that uses a pseudo-transient continuation globalization
> procedure combined with an inexact Newton method. I am using GMRES for
> the linear solves with a preconditioner constructed from the exact
> analytic Jacobian.
> 
> In order to verify my Jacobian (mostly the linearization of the flux
> functions since I have already verified the linearization of the local
> volume terms) I was trying to implement the finite difference
> approximation (SNESComputeJacobianDefault()). However, since all of my
> functions for calculating the residual use intrinsic F90 arrays for
> the MPI and the actual computations, I was wondering if there is a way
> to extract the values from the PETSc data types (Vec, Mat etc.) and to
> input the extracted values into the F90 arrays to use in my F90
> functions. The reason I need to do this is because I am assuming the
> ComputeJacobianDefault() function perturbs the argument x (the current
> point) which is a Vec datatype. Therefore, in order to find the
> residual using my existing functions (which don't use PETSc data
> types) I have to copy the values in x into my existing F90 arrays in
> order to use my existing functions. I tried simply equating the
> vectors but I believe that only copied the address and not the actual
> values within the vector.
> 
> Thanks,
> 
> Kevin



Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Smith, Barry F. via petsc-users
 
   Looks like spack did not compile PETSc with the -g option; which is strange 
because in both debug and and --with-debugging=0 PETSc ./configure make uses 
debug symbols

#0  __muldc3 (a=-6.6364040265716871e-306, b=1.1689456061105587e-305, 
c=-0.0024992568840190117, d=0.024886737403015963)
at 
/raid/home/sajid/packages/spack/var/spack/stage/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/gcc-7.3.0/libgcc/libgcc2.c:1978
#1  0x7630fe87 in MatSolve_SeqAIJ_NaturalOrdering ()
   from 
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010

   Anyway the FPE occurs in MatSolve_SeqAIJ_NaturalOrdering which usually 
indicates a zero on the diagonal of the matrix. Is that possible?

   Barry


Satish,

  Does spack somehow turn off the -g ?

> On Jan 4, 2019, at 3:24 PM, Sajid Ali  
> wrote:
> 
> Trying it slightly differently, I do see it's a SIGFPE, arithmetic exception 
> but all it shows is that it's an error in TSSolve but no further than that. 
> 
> [sajid@xrm free_space]$ gdb ex_modify 
> 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 
> 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:
> ...
> Reading symbols from 
> /raid/home/sajid/packages/xwp_petsc/2d/free_space/ex_modify...done.
> (gdb) run -ts_type cn --args -fp_trap
> Starting program: /raid/home/sajid/packages/xwp_petsc/2d/free_space/ex_modify 
> -ts_type cn --args -fp_trap
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> warning: File 
> "/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/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 
> /raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/lib64/libstdc++.so.6.0.24-gdb.py
> line to your configuration file "/raid/home/sajid/.gdbinit".
> To completely disable this security protection add
> set auto-load safe-path /
> line to your configuration file "/raid/home/sajid/.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"
> Solving a linear TS problem on 1 processor
> mx : 512, my: 512 lambda : 1.239840e-10
> 
> Program received signal SIGFPE, Arithmetic exception.
> __muldc3 (a=-6.6364040265716871e-306, b=1.1689456061105587e-305, 
> c=-0.0024992568840190117, d=0.024886737403015963)
> at 
> /raid/home/sajid/packages/spack/var/spack/stage/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/gcc-7.3.0/libgcc/libgcc2.c:1978
> 1978
> /raid/home/sajid/packages/spack/var/spack/stage/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/gcc-7.3.0/libgcc/libgcc2.c:
>  No such file or directory.
> Missing separate debuginfos, use: debuginfo-install blas-3.4.2-8.el7.x86_64 
> bzip2-libs-1.0.6-13.el7.x86_64 elfutils-libelf-0.168-8.el7.x86_64 
> elfutils-libs-0.168-8.el7.x86_64 glibc-2.17-196.el7.x86_64 
> lapack-3.4.2-8.el7.x86_64 libattr-2.4.46-12.el7.x86_64 
> libcap-2.22-9.el7.x86_64 libgfortran-4.8.5-16.el7.x86_64 
> libxml2-2.9.1-6.el7_2.3.x86_64 systemd-libs-219-42.el7_4.4.x86_64 
> xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-17.el7.x86_64
> (gdb) bt
> #0  __muldc3 (a=-6.6364040265716871e-306, b=1.1689456061105587e-305, 
> c=-0.0024992568840190117, d=0.024886737403015963)
> at 
> /raid/home/sajid/packages/spack/var/spack/stage/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/gcc-7.3.0/libgcc/libgcc2.c:1978
> #1  0x7630fe87 in MatSolve_SeqAIJ_NaturalOrdering ()
>from 
> /raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
> #2  0x75ba61a8 in MatSolve ()
>from 
> /raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
> #3  0x76bc8a55 in PCApply_ILU ()
>from 
> /raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
> #4  0x76cde6eb in PCApply ()
>from 
> /raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
> #5  

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
Trying it slightly differently, I do see it's a SIGFPE, arithmetic
exception but all it shows is that it's an error in TSSolve but no further
than that.

[sajid@xrm free_space]$ gdb ex_modify
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 
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:
...
Reading symbols from
/raid/home/sajid/packages/xwp_petsc/2d/free_space/ex_modify...done.
(gdb) run -ts_type cn --args -fp_trap
Starting program:
/raid/home/sajid/packages/xwp_petsc/2d/free_space/ex_modify -ts_type cn
--args -fp_trap
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: File
"/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/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
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/lib64/libstdc++.
so.6.0.24-gdb.py
line to your configuration file "/raid/home/sajid/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/raid/home/sajid/.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"
Solving a linear TS problem on 1 processor
mx : 512, my: 512 lambda : 1.239840e-10

Program received signal SIGFPE, Arithmetic exception.
__muldc3 (a=-6.6364040265716871e-306, b=1.1689456061105587e-305,
c=-0.0024992568840190117, d=0.024886737403015963)
at
/raid/home/sajid/packages/spack/var/spack/stage/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/gcc-7.3.0/libgcc/libgcc2.c:1978
1978
/raid/home/sajid/packages/spack/var/spack/stage/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/gcc-7.3.0/libgcc/libgcc2.c:
No such file or directory.
Missing separate debuginfos, use: debuginfo-install blas-3.4.2-8.el7.x86_64
bzip2-libs-1.0.6-13.el7.x86_64 elfutils-libelf-0.168-8.el7.x86_64
elfutils-libs-0.168-8.el7.x86_64 glibc-2.17-196.el7.x86_64
lapack-3.4.2-8.el7.x86_64 libattr-2.4.46-12.el7.x86_64
libcap-2.22-9.el7.x86_64 libgfortran-4.8.5-16.el7.x86_64
libxml2-2.9.1-6.el7_2.3.x86_64 systemd-libs-219-42.el7_4.4.x86_64
xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) bt
#0  __muldc3 (a=-6.6364040265716871e-306, b=1.1689456061105587e-305,
c=-0.0024992568840190117, d=0.024886737403015963)
at
/raid/home/sajid/packages/spack/var/spack/stage/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/gcc-7.3.0/libgcc/libgcc2.c:1978
#1  0x7630fe87 in MatSolve_SeqAIJ_NaturalOrdering ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#2  0x75ba61a8 in MatSolve ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#3  0x76bc8a55 in PCApply_ILU ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#4  0x76cde6eb in PCApply ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#5  0x76e3ad4a in KSP_PCApply ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#6  0x76e3bc36 in KSPInitialResidual ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#7  0x76dc0736 in KSPSolve_GMRES ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#8  0x76e1158e in KSPSolve ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#9  0x76fac311 in SNESSolve_KSPONLY ()
   from
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj/lib/libpetsc.so.3.010
#10 0x76f346c7 in SNESSolve ()
   from

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
Going by the advice given here : https://stackoverflow.com/a/2792735

I tried running the program, hoping to catch the FP exception and I got the
error I had before (which turned out to be due to an FP exception as per
previous petsc thread):

Missing separate debuginfos, use: debuginfo-install blas-3.4.2-8.el7.x86_64
bzip2-libs-1.0.6-13.el7.x86_64 elfutils-libelf-0.168-8.el7.x86_64
elfutils-libs-0.168-8.el7.x86_64 glibc-2.17-196.el7.x86_64
lapack-3.4.2-8.el7.x86_64 libattr-2.4.46-12.el7.x86_64
libcap-2.22-9.el7.x86_64 libgfortran-4.8.5-16.el7.x86_64
libxml2-2.9.1-6.el7_2.3.x86_64 systemd-libs-219-42.el7_4.4.x86_64
xz-libs-5.2.2-1.el7.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) run -ts_type cn
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Killed
[sajid@xrm free_space]$ Starting program:
/raid/home/sajid/packages/xwp_petsc/2d/free_space/./ex_modify -ts_type cn
[setting tty state failed in terminal_inferior: Input/output error]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
warning: File
"/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/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".
Solving a linear TS problem on 1 processor
mx : 512, my: 512 lambda : 1.239840e-10
[0]PETSC ERROR: - Error Message
--
[0]PETSC ERROR:
[0]PETSC ERROR: TSStep has failed due to DIVERGED_NONLINEAR_SOLVE, increase
-ts_max_snes_failures or make negative to attempt recovery
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Development GIT revision:
bd27d3f284687498e4c4678d234c0e308a5bc236  GIT Date: 2019-01-02 11:00:20
-0600
[0]PETSC ERROR:
/raid/home/sajid/packages/xwp_petsc/2d/free_space/./ex_modify on a  named
xrm by sajid Fri Jan  4 14:47:56 2019
[0]PETSC ERROR: Configure options
--prefix=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/petsc-develop-2u6vuwagkoczyvnpsubzrubmtmpfhhkj
--with-ssl=0 --download-c2html=0 --download-sowing=0 --download-hwloc=0
CFLAGS= FFLAGS= CXXFLAGS= COPTFLAGS= FOPTFLAGS= CXXOPTFLAGS=
--with-cc=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/mpich-3.3-z5uiwmx24jylnivuhlnqjjmm674ozj6x/bin/mpicc
--with-cxx=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/mpich-3.3-z5uiwmx24jylnivuhlnqjjmm674ozj6x/bin/mpic++
--with-fc=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/mpich-3.3-z5uiwmx24jylnivuhlnqjjmm674ozj6x/bin/mpif90
--with-precision=double --with-scalar-type=complex
--with-shared-libraries=1 --with-debugging=1 --with-64-bit-indices=0
--with-blaslapack-lib="/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/intel-mkl-2019.0.117-wzqlcijwx7odz2x5chembudo5leqpfh2/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64/libmkl_intel_lp64.so
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/intel-mkl-2019.0.117-wzqlcijwx7odz2x5chembudo5leqpfh2/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64/libmkl_sequential.so
/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/intel-mkl-2019.0.117-wzqlcijwx7odz2x5chembudo5leqpfh2/compilers_and_libraries_2019.0.117/linux/mkl/lib/intel64/libmkl_core.so
/lib64/libpthread.so /lib64/libm.so /lib64/libdl.so" --with-x=1
--with-clanguage=C --with-scalapack=0 --with-metis=1
--with-metis-dir=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/metis-5.1.0-nhgzn4kjskctzmzv35mstvd34nj2ugek
--with-hdf5=1
--with-hdf5-dir=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/hdf5-1.10.4-ltstvsxvyjue2gxfegi4nvr6c5xg3zww
--with-hypre=0 --with-parmetis=1
--with-parmetis-dir=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/parmetis-4.0.3-hw3j2ss7mjsc5x5f2gaflirnuufzptil
--with-mumps=0 --with-trilinos=0 --with-cxx-dialect=C++11
--with-superlu_dist-include=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/superlu-dist-develop-cpspq4ca2hnyvhx4mz7zsupbj3do6md3/include
--with-superlu_dist-lib=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/superlu-dist-develop-cpspq4ca2hnyvhx4mz7zsupbj3do6md3/lib/libsuperlu_dist.a
--with-superlu_dist=1 --with-suitesparse=0
--with-zlib-include=/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/zlib-1.2.11-ldu43taplg2nbkxtem346zq4ibhad64i/include
--with-zlib-lib="-L/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-7.3.0/zlib-1.2.11-ldu43taplg2nbkxtem346zq4ibhad64i/lib
-lz" --with-zlib=1
[0]PETSC ERROR: #1 TSStep() line 3673 in
/tmp/sajid/spack-stage/spack-stage-0boEG4/petsc/src/ts/interface/ts.c
[0]PETSC ERROR: #2 TSSolve() line 3847 in

Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Smith, Barry F. via petsc-users


  Why did you quit the debugger?

(gdb) quit  

Why didn't set the appropriate gdb option for catching floating point 
exceptions and then type cont ?

  Barry


> On Jan 4, 2019, at 10:24 AM, Sajid Ali  
> wrote:
> 
> Spack changes the configuration if debug variant is enabled as per this line :
> 
> '--with-debugging=%s' % ('1' if '+debug' in spec else '0'), 
> 
> I'm not sure what needs to be done to change this. 
> 
> In the meantime, I added -g to CFLAGS in the makefile and now I have this : 
> https://pastebin.com/wxf05BH0



Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
I asked in the spack-slack channel and was told to include the explicitly
link the gfortran associated with the gcc version I build petsc with.
Following that advice, I'm using gcc@7.3.0, linking gcc@7.3.0/lib64 in
FFLAGS and setting -g option to CFLAGS in my makefile.

Yet, somehow the executable still picks up the system gfortran (It picks
both libgfortran.so.4 and libgfortran.so.3). Anything else I missed trying?

PS: My makefile looks like this:

[sajid@xrm free_space]$ cat makefile

ALL:

CFLAGS  = -g
FFLAGS  =
-L/raid/home/sajid/packages/spack/opt/spack/linux-rhel7-x86_64/gcc-4.8.5/gcc-7.3.0-qrjpi76aeo4bysagruwwfii6oneh56lj/lib64/
CPPFLAGS=
FPPFLAGS=
CLEANFILES  = ex_matlab

include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules

# your targets if any

include ${PETSC_DIR}/lib/petsc/conf/test

I've looked into the superludist and can confirm that it is indeed linked
to the system gfortran due to it's build error and since it's a petsc
dependency, it might be that this is where the system gfortran is coming in
instead of the newer gfortran associated with gcc-7.3.0 but I'm not sure.


Re: [petsc-users] Installation error on macOS Mojave using GNU compiler

2019-01-04 Thread Danyang Su via petsc-users



On 2019-01-03, 4:59 PM, "Balay, Satish"  wrote:

On Thu, 3 Jan 2019, Matthew Knepley via petsc-users wrote:

> On Thu, Jan 3, 2019 at 7:02 PM Danyang Su via petsc-users <
> petsc-users@mcs.anl.gov> wrote:
> 
> > Hi All,
> >
> > I am trying to install PETSc on macOS Mojave using GNU compiler.
> > First, I tried the debug version using the following configuration and 
it
> > works fine.
> >
> > ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran
> > --download-mpich --download-scalapack --download-parmetis 
--download-metis
> > --download-ptscotch --download-fblaslapack --download-hypre
> > --download-superlu_dist --download-hdf5=yes --download-ctetgen
> >
> > After testing debug version, I reconfigured PETSc with optimization 
turned
> > on using the following configuration. However, I got error during this 
step.
> >
> 
> Your optimization flags are not right because the compiler is producing
> AVX-512, but your linker cannot handle it. However, it looks like
> it might be that your Fortran compiler can't handle it. Do you need
> Fortran? If not, turn it off (configure with --with-fc=0) and try again.

Or use 'FOPTFLAGS=-O3' [if its indeed fortran sources causing grief]

If '-march=native -mtune=native' gives compiler/linker errors - don't use 
them.

Satish

Hi Satish,

After removing "-march=native -mtune=native", it works now.

Thanks,

Danyang

> 
>   Thanks,
> 
> Matt
> 
> 
> > ./configure --with-cc=gcc --with-cxx=g++ --with-fc=gfortran
> > --with-cxx-dialect=C++11 --download-mpich --download-scalapack
> > --download-parmetis --download-metis --download-ptscotch
> > --download-fblaslapack --download-hypre --download-superlu_dist
> > --download-hdf5=yes --download-ctetgen --with-debugging=0 COPTFLAGS="-O3
> > -march=native -mtune=native" CXXOPTFLAGS="-O3 -march=native 
-mtune=native"
> > FOPTFLAGS="-O3 -march=native -mtune=native"
> >
> > The error information is
> >
> > ctoolchain/usr/bin/ranlib: file: .libs/libmpl.a(mpl_dbg.o) has no 
symbols
> > 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
> > file: .libs/libmpl.a(mpl_dbg.o) has no symbols
> > 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib:
> > file: .libs/libmpl.a(mpl_dbg.o) has no symbols
> > /var/folders/jm/wcm4mv8s3v1gqz383tcf_4c0gp/T//ccrlfFuo.s:14:2: 
error:
> > instruction requires: AVX-512 ISA AVX-512 VL ISA
> > vmovdqu64   (%rdi), %xmm0
> > ^
> > make[2]: *** [src/binding/fortran/use_mpi/mpi_constants.mod-stamp] 
Error 1
> > make[2]: *** Waiting for unfinished jobs
> > make[1]: *** [all-recursive] Error 1
> > make: *** [all] Error 2
> >
> >
> > Thanks,
> >
> > Danyang
> >
> 
> 
> 






Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
Should gdb : https://spack.readthedocs.io/en/latest/package_list.html#gdb
be listed as an explicit dependency ?

Also, why is the error message asking me to re-install my system
blas/lapack ? I installed petsc with intel-mkl as blas/lapack provider and
the linking failed for superlu-dist. Is that carrying over here ?


Re: [petsc-users] Question about correctly catching fp_trap

2019-01-04 Thread Sajid Ali via petsc-users
Spack changes the configuration if debug variant is enabled as per this
line :

'--with-debugging=%s' % ('1' if '+debug' in spec else '0'),

I'm not sure what needs to be done to change this.

In the meantime, I added -g to CFLAGS in the makefile and now I have this :
https://pastebin.com/wxf05BH0


Re: [petsc-users] Problems about Picard and NolinearGS

2019-01-04 Thread Jed Brown via petsc-users
Yingjie Wu  writes:

> Thank you very much for your answer.
> I tried to use the quasi-Newton method to solve some examples, except
> ex48(in src/snes/example/tutorial), the ex3 and the ex19 will produce the
> same error information. The error information is as follows. Is there
> anything I should pay attention to when using the quasi-Newton method?
> args: -snes_type qn -snes_qn_restart_type periodic -snes_qn_scale_type
> jacobian
>
> In ex3, it has a routine about Jacobian, while in ex19 without a Jacobian
> routine.
> Is the quasi-Newton method use the inverse of the initial Jacobian matrix
> by finite difference ?
>
> Error information in ex3:
> mpiexec -n 2 ./ex3 -snes_type qn -snes_qn_restart_type periodic
> -snes_qn_scale_type jacobian -snes_view
> atol=1e-50, rtol=1e-08, stol=1e-08, maxit=1, maxf=3
> iter = 0,SNES Function norm 5.41468
> iter = 1,SNES Function norm 0.806152
> iter = 2,SNES Function norm 0.459274
> iter = 3,SNES Function norm 0.0562937
> iter = 4,SNES Function norm 0.00756409
> iter = 5,SNES Function norm 0.00153315
> iter = 6,SNES Function norm 0.000108099
> iter = 7,SNES Function norm 2.8e-06
> iter = 8,SNES Function norm 5.56429e-08
> iter = 9,SNES Function norm 5.56429e-08
> [0]PETSC ERROR: - Error Message
> --
> [0]PETSC ERROR: Floating point exception

-snes_qn_type broyden may help.  The default (BFGS) is for symmetric
problems and this formulation (with boundary conditions) is not
symmetric.

> [0]PETSC ERROR: Vec entry at local location 0 is not-a-number or infinite
> at beginning of function: Parameter number 2
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
> trouble shooting.
> [0]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
> [0]PETSC ERROR: ./ex3 on a arch-linux2-c-debug named yjwu-XPS-8910 by yjwu
> Fri Jan  4 09:11:00 2019
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
> --with-fc=gfortran --download-mpich --download-fblaslapack
> [0]PETSC ERROR: #1 VecValidValues() line 26 in
> /home/yjwu/petsc-3.10.1/src/vec/vec/interface/rvector.c
> [0]PETSC ERROR: #2 SNESComputeFunction() line 2234 in
> /home/yjwu/petsc-3.10.1/src/snes/interface/snes.c
> [1]PETSC ERROR: - Error Message
> --
> [1]PETSC ERROR: Floating point exception
> [1]PETSC ERROR: Vec entry at local location 0 is not-a-number or infinite
> at beginning of function: Parameter number 2
> [1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
> trouble shooting.
> [1]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
> [1]PETSC ERROR: ./ex3 on a arch-linux2-c-debug named yjwu-XPS-8910 by yjwu
> Fri Jan  4 09:11:00 2019
> [1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
> --with-fc=gfortran --download-mpich --download-fblaslapack
> [1]PETSC ERROR: #1 VecValidValues() line 26 in
> /home/yjwu/petsc-3.10.1/src/vec/vec/interface/rvector.c
> [1]PETSC ERROR: #2 SNESComputeFunction() line 2234 in
> /home/yjwu/petsc-3.10.1/src/snes/interface/snes.c
> [1]PETSC ERROR: #3 SNESLineSearchApply_CP() line 48 in
> /home/yjwu/petsc-3.10.1/src/snes/linesearch/impls/cp/linesearchcp.c
> [1]PETSC ERROR: #4 SNESLineSearchApply() line 648 in
> /home/yjwu/petsc-3.10.1/src/snes/linesearch/interface/linesearch.c
> [0]PETSC ERROR: #3 SNESLineSearchApply_CP() line 48 in
> /home/yjwu/petsc-3.10.1/src/snes/linesearch/impls/cp/linesearchcp.c
> [0]PETSC ERROR: #4 SNESLineSearchApply() line 648 in
> /home/yjwu/petsc-3.10.1/src/snes/linesearch/interface/linesearch.c
> [0]PETSC ERROR: #5 SNESSolve_QN() line 403 in
> /home/yjwu/petsc-3.10.1/src/snes/impls/qn/qn.c
> [0]PETSC ERROR: [1]PETSC ERROR: #5 SNESSolve_QN() line 403 in
> /home/yjwu/petsc-3.10.1/src/snes/impls/qn/qn.c
> [1]PETSC ERROR: #6 SNESSolve() line 4396 in
> /home/yjwu/petsc-3.10.1/src/snes/interface/snes.c
> #6 SNESSolve() line 4396 in
> /home/yjwu/petsc-3.10.1/src/snes/interface/snes.c
> [0]PETSC ERROR: [1]PETSC ERROR: #7 main() line 277 in
> /home/yjwu/petsc-3.10.1/src/snes/examples/tutorials/ex3.c
> #7 main() line 277 in
> /home/yjwu/petsc-3.10.1/src/snes/examples/tutorials/ex3.c
> [0]PETSC ERROR: PETSc Option Table entries:
> [1]PETSC ERROR: PETSc Option Table entries:
> [1]PETSC ERROR: [0]PETSC ERROR: -snes_qn_restart_type periodic
> [0]PETSC ERROR: -snes_qn_restart_type periodic
> [1]PETSC ERROR: -snes_qn_scale_type jacobian
> [1]PETSC ERROR: -snes_qn_scale_type jacobian
> [0]PETSC ERROR: -snes_type qn
> [0]PETSC ERROR: -snes_type qn
> [1]PETSC ERROR: -snes_view
> -snes_view
> [0]PETSC ERROR: End of Error Message ---send entire
> error message to petsc-ma...@mcs.anl.gov--
> [1]PETSC ERROR: End of Error Message ---send entire
> error message to petsc-ma...@mcs.anl.gov--
> application called MPI_Abort(MPI_COMM_WORLD, 72) - process 0
> application called 

[petsc-users] DMPlex H27 elements

2019-01-04 Thread Yann Jobic via petsc-users

Dear Petsc Users,

I'm using DMPlexCreateFromCellList to create my DM. I would like to have 
an order 2 geometry.


It's working fine in 2D for elements of type Q9.

I checked that it's working correctly by using 
DMPlexComputeCellGeometryFEM, and compute the value of the determinant 
(CheckMeshGeometry of dm/impls/plex/examples/tutorials/ex2.c)


I can import H8 elements, it's working fine.

But for H27 element, it's not working. I really don't know how to order 
my vertex in the cells array. So far, the determinant is zero...


I don't know where to look in order to find this information. I tried 
the function DMPlexGetRawFaces_Internal of the file


https://www.mcs.anl.gov/petsc/petsc-current/src/dm/impls/plex/plexinterpolate.c.html#DMPlexGetRawFaces_Internal

but it didn't help me.

Could you please point me where to look ?

Thanks, and happy new year !

Yann



Re: [petsc-users] Problems about Picard and NolinearGS

2019-01-04 Thread Yingjie Wu via petsc-users
Thank you very much for your answer.
I tried to use the quasi-Newton method to solve some examples, except
ex48(in src/snes/example/tutorial), the ex3 and the ex19 will produce the
same error information. The error information is as follows. Is there
anything I should pay attention to when using the quasi-Newton method?
args: -snes_type qn -snes_qn_restart_type periodic -snes_qn_scale_type
jacobian

In ex3, it has a routine about Jacobian, while in ex19 without a Jacobian
routine.
Is the quasi-Newton method use the inverse of the initial Jacobian matrix
by finite difference ?

Error information in ex3:
mpiexec -n 2 ./ex3 -snes_type qn -snes_qn_restart_type periodic
-snes_qn_scale_type jacobian -snes_view
atol=1e-50, rtol=1e-08, stol=1e-08, maxit=1, maxf=3
iter = 0,SNES Function norm 5.41468
iter = 1,SNES Function norm 0.806152
iter = 2,SNES Function norm 0.459274
iter = 3,SNES Function norm 0.0562937
iter = 4,SNES Function norm 0.00756409
iter = 5,SNES Function norm 0.00153315
iter = 6,SNES Function norm 0.000108099
iter = 7,SNES Function norm 2.8e-06
iter = 8,SNES Function norm 5.56429e-08
iter = 9,SNES Function norm 5.56429e-08
[0]PETSC ERROR: - Error Message
--
[0]PETSC ERROR: Floating point exception
[0]PETSC ERROR: Vec entry at local location 0 is not-a-number or infinite
at beginning of function: Parameter number 2
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
[0]PETSC ERROR: ./ex3 on a arch-linux2-c-debug named yjwu-XPS-8910 by yjwu
Fri Jan  4 09:11:00 2019
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --download-mpich --download-fblaslapack
[0]PETSC ERROR: #1 VecValidValues() line 26 in
/home/yjwu/petsc-3.10.1/src/vec/vec/interface/rvector.c
[0]PETSC ERROR: #2 SNESComputeFunction() line 2234 in
/home/yjwu/petsc-3.10.1/src/snes/interface/snes.c
[1]PETSC ERROR: - Error Message
--
[1]PETSC ERROR: Floating point exception
[1]PETSC ERROR: Vec entry at local location 0 is not-a-number or infinite
at beginning of function: Parameter number 2
[1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[1]PETSC ERROR: Petsc Release Version 3.10.1, Sep, 26, 2018
[1]PETSC ERROR: ./ex3 on a arch-linux2-c-debug named yjwu-XPS-8910 by yjwu
Fri Jan  4 09:11:00 2019
[1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --download-mpich --download-fblaslapack
[1]PETSC ERROR: #1 VecValidValues() line 26 in
/home/yjwu/petsc-3.10.1/src/vec/vec/interface/rvector.c
[1]PETSC ERROR: #2 SNESComputeFunction() line 2234 in
/home/yjwu/petsc-3.10.1/src/snes/interface/snes.c
[1]PETSC ERROR: #3 SNESLineSearchApply_CP() line 48 in
/home/yjwu/petsc-3.10.1/src/snes/linesearch/impls/cp/linesearchcp.c
[1]PETSC ERROR: #4 SNESLineSearchApply() line 648 in
/home/yjwu/petsc-3.10.1/src/snes/linesearch/interface/linesearch.c
[0]PETSC ERROR: #3 SNESLineSearchApply_CP() line 48 in
/home/yjwu/petsc-3.10.1/src/snes/linesearch/impls/cp/linesearchcp.c
[0]PETSC ERROR: #4 SNESLineSearchApply() line 648 in
/home/yjwu/petsc-3.10.1/src/snes/linesearch/interface/linesearch.c
[0]PETSC ERROR: #5 SNESSolve_QN() line 403 in
/home/yjwu/petsc-3.10.1/src/snes/impls/qn/qn.c
[0]PETSC ERROR: [1]PETSC ERROR: #5 SNESSolve_QN() line 403 in
/home/yjwu/petsc-3.10.1/src/snes/impls/qn/qn.c
[1]PETSC ERROR: #6 SNESSolve() line 4396 in
/home/yjwu/petsc-3.10.1/src/snes/interface/snes.c
#6 SNESSolve() line 4396 in
/home/yjwu/petsc-3.10.1/src/snes/interface/snes.c
[0]PETSC ERROR: [1]PETSC ERROR: #7 main() line 277 in
/home/yjwu/petsc-3.10.1/src/snes/examples/tutorials/ex3.c
#7 main() line 277 in
/home/yjwu/petsc-3.10.1/src/snes/examples/tutorials/ex3.c
[0]PETSC ERROR: PETSc Option Table entries:
[1]PETSC ERROR: PETSc Option Table entries:
[1]PETSC ERROR: [0]PETSC ERROR: -snes_qn_restart_type periodic
[0]PETSC ERROR: -snes_qn_restart_type periodic
[1]PETSC ERROR: -snes_qn_scale_type jacobian
[1]PETSC ERROR: -snes_qn_scale_type jacobian
[0]PETSC ERROR: -snes_type qn
[0]PETSC ERROR: -snes_type qn
[1]PETSC ERROR: -snes_view
-snes_view
[0]PETSC ERROR: End of Error Message ---send entire
error message to petsc-ma...@mcs.anl.gov--
[1]PETSC ERROR: End of Error Message ---send entire
error message to petsc-ma...@mcs.anl.gov--
application called MPI_Abort(MPI_COMM_WORLD, 72) - process 0
application called MPI_Abort(MPI_COMM_WORLD, 72) - process 1

Error information in ex19
mpiexec -n 2 ./ex19 -snes_type qn -snes_qn_restart_type periodic
-snes_qn_scale_type jacobian -snes_view
lid velocity = 0.0625, prandtl # = 1., grashof # = 1.
[0]PETSC ERROR: - Error Message
--
[0]PETSC ERROR: