Re: [petsc-users] Finding nonzero indices

2019-02-25 Thread Eda Oktay via petsc-users
Okay, but here is another silly question:

>From MatGetRow(), I get number of nonzeros in row, column indices and
values right? Also, PetscBinaryWrite() needs a buffer p and the number of
items to write n.

I need both row,column indices and values. So, what should I write into
PetscBinaryWrite? Does this for loop give me these 3 arrays (arrays consist
of row indices,column indices and values)?

Eda

Matthew Knepley , 25 Şub 2019 Pzt, 18:37 tarihinde şunu
yazdı:

> On Mon, Feb 25, 2019 at 10:20 AM Eda Oktay  wrote:
>
>> Thank you for your answer Matt, but I have some questions about
>>> PetscBinaryWrite() since I am a new user.
>>>
>>> Since I am going to use this function, I guess I have to open a new
>>> binary file with PetscViewerBinaryOpen
>>> 
>>>  and  PetscViewerBinaryGetDescriptor
>>> ,
>>> and destroy viewer by  PetscViewerDestroy
>>> .
>>> Do I write these functions into for loop or not?
>>>
>>
> No, they go outside.
>
>   Thanks,
>
> Matt
>
>
>> Eda
>>>
>>> Matthew Knepley , 25 Şub 2019 Pzt, 17:31 tarihinde
>>> şunu yazdı:
>>>
 On Mon, Feb 25, 2019 at 5:25 AM Eda Oktay via petsc-users <
 petsc-users@mcs.anl.gov> wrote:

> Hello,
>
> I am trying to find the indices (both row and column separately) of
> nonzero entries of a sparse matrix in Petsc Binary Format. I found
> MatGetSeqNonzeroStructure but it gives me a struct and I don't know 
> whether
> this is what I want or not.
>

 I would not do it that way, since it is fragile. I would write a loop
 like this:

 MAtGetOwnershipRange();
 for (row = rStart; row < rEnd; ++row) {
   MatGetRow()
   PetscBinaryWrite()
   MatRestoreRow()
 }

 This will work for any matrix.

 Matt


> Best regards,
>
> Eda
>


 --
 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/
 

>>>
>
> --
> 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/
> 
>


Re: [petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
Please find attached the error output from petsc and the valgrind output. I could not reporduce the actual error in an MWE as it stops before calling MatLUFactorNumeric with the error at MatAXPY complaining that Mat type elemental is not supported, why it continues in my original code despite a nonzero error I don't know. 

 



 


We need a stacktrace or an MWE to understand what is going on
 

On Feb 25, 2019, at 9:51 PM, Marius Buerkle  wrote:
 




I checked the problem further. I am not sure if this is the cause but what happens is that I use MatAXPY with Y = MATELEMENTAL and X= MATMPIAIJ before calling MatLUFactorNumeric, it turns out that MatAXPY fails but did not raise an exception and I did not check the error code returned from MatAXPY. In my code it give error code 60 in a MWE I actually get error code 56, with 

 

[1]PETSC ERROR: - Error Message --
[1]PETSC ERROR: No support for this operation for this object type
[1]PETSC ERROR: Mat type elemental

 

 

Prior to 646531bb84 MatAXPY worked with  Y = MATELEMENTAL and X= MATMPIAIJ  not raising a nonzero error code. 



 


I don't see any issue with the commit.
Did you recompile petsc ? Can you send us a MWE to reproduce the error? Have you checked under valgrind?

 


Il Lun 25 Feb 2019, 06:58 Marius Buerkle via petsc-users  ha scritto:




No excatly same source on my side. It works with commits prior to 646531bb84  and fails starting from 646531bb84.

 


 



On Mon, Feb 25, 2019 at 9:00 AM Marius Buerkle via petsc-users  wrote:





Hi,

 

After commit 646531bb84 I get the following error message when calling MatLUFactorNumeric. It worked without a problem before.

 

[6]PETSC ERROR: - Error Message --
[6]PETSC ERROR: Nonconforming object sizes
[6]PETSC ERROR: Non conforming matrix add: local sizes 51 x 54, 51 x 54




 

This seems impossible since it reports above that the sizes are the same, but the error says they are different. Is it possible you source

got accidentally changed?

 

  Matt

 




[6]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[6]PETSC ERROR: Petsc Development GIT revision: v3.10.3-1412-g646531bb84  GIT Date: 2019-02-07 21:47:41 +0300
[6]PETSC ERROR: /home/marius/prog/ownstuff/fortran/programs/transomat_dev/transomat/transomat on a  named tono-hpc1 by marius Mon Feb 25 22:43:23 2019
[6]PETSC ERROR: Configure options --prefix=/home/marius/prog/petsc/intel_openmpi_openmp_mkl_opt_with_slepc --with-fortran-kernels=1 --with-64-bit-indices=0 --CC=mpi
cc --COPTFLAGS="-g -O0  -std=c11" --CXX=mpicxx --CXXOPTFLAGS="-g -O0  -std=c++14" --FC=mpif90 --FOPTFLAGS="-g -O0  -traceback " --with-mpi=1 --with-x=0 --download-p
armetis=1 --download-metis=1 --download-superlu_dist=1 --download-superlu_dist-commit=93a9aa53142253f2a56891e09c6f950d250ae251 --download-hwloc=1 --download-sowing=
1 --with-openmp=0 --with-pthread=0 --download-elemental=1 --download-elemental-commit=de7b5bea1abf5f626b91582f742cf99e2e551bff --with-cxx-dialect=c++11 --with-scala
r-type=complex --with-debugging=1 --with-valgrind=0 --with-blaslapack-lib=" -L/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scal
apack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -ldl" --with-scalapack-lib=" -L/home/marius/intel/compilers
_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -
ldl" --with-mkl_pardiso-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_cpardiso-dir=/home/marius/intel/compilers_and_libraries_2019.
1.144/linux/mkl --with-mkl_sparse-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_sparse_optimize-dir=/home/marius/intel/compilers_an
d_libraries_2019.1.144/linux/mkl
[6]PETSC ERROR: #1 MatAXPY() line 39 in /home/marius/prog/petsc/git/petsc/src/mat/utils/axpy.c

 

best,

Marus




 

 
--







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/




























error_output.tar.gz
Description: Binary data


Re: [petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
I checked the problem further. I am not sure if this is the cause but what happens is that I use MatAXPY with Y = MATELEMENTAL and X= MATMPIAIJ before calling MatLUFactorNumeric, it turns out that MatAXPY fails but did not raise an exception and I did not check the error code returned from MatAXPY. In my code it give error code 60 in a MWE I actually get error code 56, with 

 

[1]PETSC ERROR: - Error Message --
[1]PETSC ERROR: No support for this operation for this object type
[1]PETSC ERROR: Mat type elemental

 

 

Prior to 646531bb84 MatAXPY worked with  Y = MATELEMENTAL and X= MATMPIAIJ  not raising a nonzero error code. 



 


I don't see any issue with the commit.
Did you recompile petsc ? Can you send us a MWE to reproduce the error? Have you checked under valgrind?

 


Il Lun 25 Feb 2019, 06:58 Marius Buerkle via petsc-users  ha scritto:




No excatly same source on my side. It works with commits prior to 646531bb84  and fails starting from 646531bb84.

 


 



On Mon, Feb 25, 2019 at 9:00 AM Marius Buerkle via petsc-users  wrote:





Hi,

 

After commit 646531bb84 I get the following error message when calling MatLUFactorNumeric. It worked without a problem before.

 

[6]PETSC ERROR: - Error Message --
[6]PETSC ERROR: Nonconforming object sizes
[6]PETSC ERROR: Non conforming matrix add: local sizes 51 x 54, 51 x 54




 

This seems impossible since it reports above that the sizes are the same, but the error says they are different. Is it possible you source

got accidentally changed?

 

  Matt

 




[6]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[6]PETSC ERROR: Petsc Development GIT revision: v3.10.3-1412-g646531bb84  GIT Date: 2019-02-07 21:47:41 +0300
[6]PETSC ERROR: /home/marius/prog/ownstuff/fortran/programs/transomat_dev/transomat/transomat on a  named tono-hpc1 by marius Mon Feb 25 22:43:23 2019
[6]PETSC ERROR: Configure options --prefix=/home/marius/prog/petsc/intel_openmpi_openmp_mkl_opt_with_slepc --with-fortran-kernels=1 --with-64-bit-indices=0 --CC=mpi
cc --COPTFLAGS="-g -O0  -std=c11" --CXX=mpicxx --CXXOPTFLAGS="-g -O0  -std=c++14" --FC=mpif90 --FOPTFLAGS="-g -O0  -traceback " --with-mpi=1 --with-x=0 --download-p
armetis=1 --download-metis=1 --download-superlu_dist=1 --download-superlu_dist-commit=93a9aa53142253f2a56891e09c6f950d250ae251 --download-hwloc=1 --download-sowing=
1 --with-openmp=0 --with-pthread=0 --download-elemental=1 --download-elemental-commit=de7b5bea1abf5f626b91582f742cf99e2e551bff --with-cxx-dialect=c++11 --with-scala
r-type=complex --with-debugging=1 --with-valgrind=0 --with-blaslapack-lib=" -L/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scal
apack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -ldl" --with-scalapack-lib=" -L/home/marius/intel/compilers
_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -
ldl" --with-mkl_pardiso-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_cpardiso-dir=/home/marius/intel/compilers_and_libraries_2019.
1.144/linux/mkl --with-mkl_sparse-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_sparse_optimize-dir=/home/marius/intel/compilers_an
d_libraries_2019.1.144/linux/mkl
[6]PETSC ERROR: #1 MatAXPY() line 39 in /home/marius/prog/petsc/git/petsc/src/mat/utils/axpy.c

 

best,

Marus




 

 
--







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/




















Re: [petsc-users] Error Norm_2

2019-02-25 Thread Smith, Barry F. via petsc-users


   How are you computing the error norm? 

   You need to use the L2 norm in the computations, not the l2 norm. 

   Also you need to make sure the convergence criteria you use for the 
algebraic system is smaller than the descritzation error 


   Barry


> On Feb 25, 2019, at 1:55 PM, Fazlul Huq via petsc-users 
>  wrote:
> 
> Hello PETSc Developers,
> 
> I have solved a very simple poisson problem with different matrix sizes (10 
> to 10^7).
> But when I have compared error norm_2 for the solution, I got the attached 
> curve.
> It looks like error norm_2 increases with increasing matrix size. Shouldn't 
> it decrease rather with increasing matrix size?
> 
> Thanks.
> 
> Sincerely,
> Huq
> -- 
> 
> Fazlul Huq
> Graduate Research Assistant
> Department of Nuclear, Plasma & Radiological Engineering (NPRE)
> University of Illinois at Urbana-Champaign (UIUC)
> E-mail: huq2...@gmail.com
> 



[petsc-users] Kronecker product

2019-02-25 Thread Yuyun Yang via petsc-users
Hello team,

I'd like to ask whether PETSc has a function to compute the Kronecker product 
of a sparse matrix with an identity matrix? A Google search didn't lead me to a 
manual page (like most of the other PETSc functions), so I'm wondering if this 
has been implemented yet.

Thanks very much!

Best,
Yuyun


Re: [petsc-users] Kronecker product

2019-02-25 Thread Jed Brown via petsc-users
MatCreateMAIJ does that (implicitly).

https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatCreateMAIJ.html

If you want a Kronecker product with a non-identity matrix, this PR may
be of interest.

https://bitbucket.org/petsc/petsc/pull-requests/1334/rmills-mat-kaij/diff

Yuyun Yang via petsc-users  writes:

> Hello team,
>
> I'd like to ask whether PETSc has a function to compute the Kronecker product 
> of a sparse matrix with an identity matrix? A Google search didn't lead me to 
> a manual page (like most of the other PETSc functions), so I'm wondering if 
> this has been implemented yet.
>
> Thanks very much!
>
> Best,
> Yuyun


Re: [petsc-users] Wrong Global Vector size when default section is built after dmdistribute?

2019-02-25 Thread Blaise A Bourdin via petsc-users
Of course, you are right.
In retrospect, trying to create the natural to global SF during distribution 
does not seem to be the smartest idea…
Would you have time to take a pass at distributing the constrains?
On our side, we will work on patch that separates the creation of the 
Naturaltoglobal SF from distribution, and works when the default section was 
created on the sequential or distributed DM.
It would just be noce to have both cases working

Regards,
Blaise



On Feb 23, 2019, at 2:39 PM, Matthew Knepley 
mailto:knep...@gmail.com>> wrote:

On Sat, Feb 23, 2019 at 10:48 AM Blaise A Bourdin via petsc-users 
mailto:petsc-users@mcs.anl.gov>> wrote:
Hi,

My student Alex and I are trying to build an example combining natural to 
global ordering and constraints.
Constraints information do not seem to be distributed,

Well dang. That is true. I never considered doing it the other way since all my 
specifications come from compact things
like an FEM discretization and BC labels, which get distributed. But yes, this 
is a big hole. I think it could be fixed without
too much work since the constraints are just another section+IS to distribute, 
and the IS does not even have to be renumbered.
I think we can just call 
https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/DMPLEX/DMPlexDistributeFieldIS.html
 on it.

so the most rational thing to do seems to be creating the default section after 
distribution, then figuring out a way to reconstruct the natural to global 
stuff.

That is what I do, but we could do it the other way.

In the example attached, we do this, then create a global vector, but for some 
reason that I do not understand, the global vector size is 0 (should be 18) 
when run on more than 1 CPU. If we make 2 calls to DMGetGlobalVector, we get a 
vector of the proper size. What are we doing wrong?

At the beginning, you turn on

  DMSetUseNatural(dm, PETSC_TRUE);

so during Distribute() it tries to make the mapping. This process creates a 
global vector, which has size 0, because
the Section is empty. The reason it works when you call it again is that it 
creates a new vector this time, now with
the new Section. So, to do it this way, don't set this flag at the beginning. 
You have to setup the GlobalToNatural() afterwards.

Also, this shows that I should probably invalidate the global/local vector 
cache after a new Section is set.

  Thanks,

Matt

Regards,
Blaise


--
Department of Mathematics and Center for Computation & Technology
Louisiana State University, Baton Rouge, LA 70803, USA
Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin









--
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/

--
Department of Mathematics and Center for Computation & Technology
Louisiana State University, Baton Rouge, LA 70803, USA
Tel. +1 (225) 578 1612, Fax  +1 (225) 578 4276 http://www.math.lsu.edu/~bourdin









Re: [petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
Yes, I recompiled petsc. I will try to get a MWE. I am using ELEMENTAL mattype if this may cause the problem. I will try to run it through valgrind and report back.

 


I don't see any issue with the commit.
Did you recompile petsc ? Can you send us a MWE to reproduce the error? Have you checked under valgrind?

 


Il Lun 25 Feb 2019, 06:58 Marius Buerkle via petsc-users  ha scritto:




No excatly same source on my side. It works with commits prior to 646531bb84  and fails starting from 646531bb84.

 


 



On Mon, Feb 25, 2019 at 9:00 AM Marius Buerkle via petsc-users  wrote:





Hi,

 

After commit 646531bb84 I get the following error message when calling MatLUFactorNumeric. It worked without a problem before.

 

[6]PETSC ERROR: - Error Message --
[6]PETSC ERROR: Nonconforming object sizes
[6]PETSC ERROR: Non conforming matrix add: local sizes 51 x 54, 51 x 54




 

This seems impossible since it reports above that the sizes are the same, but the error says they are different. Is it possible you source

got accidentally changed?

 

  Matt

 




[6]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[6]PETSC ERROR: Petsc Development GIT revision: v3.10.3-1412-g646531bb84  GIT Date: 2019-02-07 21:47:41 +0300
[6]PETSC ERROR: /home/marius/prog/ownstuff/fortran/programs/transomat_dev/transomat/transomat on a  named tono-hpc1 by marius Mon Feb 25 22:43:23 2019
[6]PETSC ERROR: Configure options --prefix=/home/marius/prog/petsc/intel_openmpi_openmp_mkl_opt_with_slepc --with-fortran-kernels=1 --with-64-bit-indices=0 --CC=mpi
cc --COPTFLAGS="-g -O0  -std=c11" --CXX=mpicxx --CXXOPTFLAGS="-g -O0  -std=c++14" --FC=mpif90 --FOPTFLAGS="-g -O0  -traceback " --with-mpi=1 --with-x=0 --download-p
armetis=1 --download-metis=1 --download-superlu_dist=1 --download-superlu_dist-commit=93a9aa53142253f2a56891e09c6f950d250ae251 --download-hwloc=1 --download-sowing=
1 --with-openmp=0 --with-pthread=0 --download-elemental=1 --download-elemental-commit=de7b5bea1abf5f626b91582f742cf99e2e551bff --with-cxx-dialect=c++11 --with-scala
r-type=complex --with-debugging=1 --with-valgrind=0 --with-blaslapack-lib=" -L/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scal
apack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -ldl" --with-scalapack-lib=" -L/home/marius/intel/compilers
_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -
ldl" --with-mkl_pardiso-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_cpardiso-dir=/home/marius/intel/compilers_and_libraries_2019.
1.144/linux/mkl --with-mkl_sparse-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_sparse_optimize-dir=/home/marius/intel/compilers_an
d_libraries_2019.1.144/linux/mkl
[6]PETSC ERROR: #1 MatAXPY() line 39 in /home/marius/prog/petsc/git/petsc/src/mat/utils/axpy.c

 

best,

Marus




 

 
--







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/




















Re: [petsc-users] Finding nonzero indices

2019-02-25 Thread Eda Oktay via petsc-users
>
> Thank you for your answer Matt, but I have some questions about
> PetscBinaryWrite() since I am a new user.
>
> Since I am going to use this function, I guess I have to open a new binary
> file with PetscViewerBinaryOpen
> 
>  and  PetscViewerBinaryGetDescriptor
> ,
> and destroy viewer by  PetscViewerDestroy
> .
> Do I write these functions into for loop or not?
>
> Eda
>
> Matthew Knepley , 25 Şub 2019 Pzt, 17:31 tarihinde
> şunu yazdı:
>
>> On Mon, Feb 25, 2019 at 5:25 AM Eda Oktay via petsc-users <
>> petsc-users@mcs.anl.gov> wrote:
>>
>>> Hello,
>>>
>>> I am trying to find the indices (both row and column separately) of
>>> nonzero entries of a sparse matrix in Petsc Binary Format. I found
>>> MatGetSeqNonzeroStructure but it gives me a struct and I don't know whether
>>> this is what I want or not.
>>>
>>
>> I would not do it that way, since it is fragile. I would write a loop
>> like this:
>>
>> MAtGetOwnershipRange();
>> for (row = rStart; row < rEnd; ++row) {
>>   MatGetRow()
>>   PetscBinaryWrite()
>>   MatRestoreRow()
>> }
>>
>> This will work for any matrix.
>>
>> Matt
>>
>>
>>> Best regards,
>>>
>>> Eda
>>>
>>
>>
>> --
>> 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/
>> 
>>
>


Re: [petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
No excatly same source on my side. It works with commits prior to 646531bb84  and fails starting from 646531bb84.

 


 



On Mon, Feb 25, 2019 at 9:00 AM Marius Buerkle via petsc-users  wrote:





Hi,

 

After commit 646531bb84 I get the following error message when calling MatLUFactorNumeric. It worked without a problem before.

 

[6]PETSC ERROR: - Error Message --
[6]PETSC ERROR: Nonconforming object sizes
[6]PETSC ERROR: Non conforming matrix add: local sizes 51 x 54, 51 x 54




 

This seems impossible since it reports above that the sizes are the same, but the error says they are different. Is it possible you source

got accidentally changed?

 

  Matt

 




[6]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[6]PETSC ERROR: Petsc Development GIT revision: v3.10.3-1412-g646531bb84  GIT Date: 2019-02-07 21:47:41 +0300
[6]PETSC ERROR: /home/marius/prog/ownstuff/fortran/programs/transomat_dev/transomat/transomat on a  named tono-hpc1 by marius Mon Feb 25 22:43:23 2019
[6]PETSC ERROR: Configure options --prefix=/home/marius/prog/petsc/intel_openmpi_openmp_mkl_opt_with_slepc --with-fortran-kernels=1 --with-64-bit-indices=0 --CC=mpi
cc --COPTFLAGS="-g -O0  -std=c11" --CXX=mpicxx --CXXOPTFLAGS="-g -O0  -std=c++14" --FC=mpif90 --FOPTFLAGS="-g -O0  -traceback " --with-mpi=1 --with-x=0 --download-p
armetis=1 --download-metis=1 --download-superlu_dist=1 --download-superlu_dist-commit=93a9aa53142253f2a56891e09c6f950d250ae251 --download-hwloc=1 --download-sowing=
1 --with-openmp=0 --with-pthread=0 --download-elemental=1 --download-elemental-commit=de7b5bea1abf5f626b91582f742cf99e2e551bff --with-cxx-dialect=c++11 --with-scala
r-type=complex --with-debugging=1 --with-valgrind=0 --with-blaslapack-lib=" -L/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scal
apack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -ldl" --with-scalapack-lib=" -L/home/marius/intel/compilers
_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -
ldl" --with-mkl_pardiso-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_cpardiso-dir=/home/marius/intel/compilers_and_libraries_2019.
1.144/linux/mkl --with-mkl_sparse-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_sparse_optimize-dir=/home/marius/intel/compilers_an
d_libraries_2019.1.144/linux/mkl
[6]PETSC ERROR: #1 MatAXPY() line 39 in /home/marius/prog/petsc/git/petsc/src/mat/utils/axpy.c

 

best,

Marus




 

 
--







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/













[petsc-users] Nonconforming object sizes in axpy

2019-02-25 Thread Marius Buerkle via petsc-users
Hi,

 

After commit 646531bb84 I get the following error message when calling MatLUFactorNumeric. It worked without a problem before.

 

[6]PETSC ERROR: - Error Message --
[6]PETSC ERROR: Nonconforming object sizes
[6]PETSC ERROR: Non conforming matrix add: local sizes 51 x 54, 51 x 54
[6]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
[6]PETSC ERROR: Petsc Development GIT revision: v3.10.3-1412-g646531bb84  GIT Date: 2019-02-07 21:47:41 +0300
[6]PETSC ERROR: /home/marius/prog/ownstuff/fortran/programs/transomat_dev/transomat/transomat on a  named tono-hpc1 by marius Mon Feb 25 22:43:23 2019
[6]PETSC ERROR: Configure options --prefix=/home/marius/prog/petsc/intel_openmpi_openmp_mkl_opt_with_slepc --with-fortran-kernels=1 --with-64-bit-indices=0 --CC=mpi
cc --COPTFLAGS="-g -O0  -std=c11" --CXX=mpicxx --CXXOPTFLAGS="-g -O0  -std=c++14" --FC=mpif90 --FOPTFLAGS="-g -O0  -traceback " --with-mpi=1 --with-x=0 --download-p
armetis=1 --download-metis=1 --download-superlu_dist=1 --download-superlu_dist-commit=93a9aa53142253f2a56891e09c6f950d250ae251 --download-hwloc=1 --download-sowing=
1 --with-openmp=0 --with-pthread=0 --download-elemental=1 --download-elemental-commit=de7b5bea1abf5f626b91582f742cf99e2e551bff --with-cxx-dialect=c++11 --with-scala
r-type=complex --with-debugging=1 --with-valgrind=0 --with-blaslapack-lib=" -L/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scal
apack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -ldl" --with-scalapack-lib=" -L/home/marius/intel/compilers
_and_libraries_2019.1.144/linux/mkl/lib/intel64 -lmkl_scalapack_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lmkl_blacs_openmpi_lp64 -liomp5 -lpthread -lm -
ldl" --with-mkl_pardiso-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_cpardiso-dir=/home/marius/intel/compilers_and_libraries_2019.
1.144/linux/mkl --with-mkl_sparse-dir=/home/marius/intel/compilers_and_libraries_2019.1.144/linux/mkl --with-mkl_sparse_optimize-dir=/home/marius/intel/compilers_an
d_libraries_2019.1.144/linux/mkl
[6]PETSC ERROR: #1 MatAXPY() line 39 in /home/marius/prog/petsc/git/petsc/src/mat/utils/axpy.c

 

best,

Marus


Re: [petsc-users] About DMDA (and extracting its ordering)

2019-02-25 Thread Thibaut Appel via petsc-users

Hi Matthew,

The file in the link you sent does not call DMGetLocalToGlobalMapping 
nor ISLocalToGlobalMappingGetIndicesF90 though?


Anyway, everything you wanted is there:

https://bitbucket.org/petsc/petsc/issues/262/fortran-unassociated-pointer-with

Thibaut


On 25/02/2019 12:03, Matthew Knepley wrote:
On Mon, Feb 25, 2019 at 3:19 AM Appel, Thibaut 
mailto:t.appe...@imperial.ac.uk>> wrote:


Hi Matthew,

Yes I need F90 and the syntax in the file / yours

PetscInt, pointer :: id_ltog(:)


Is the exact same as

PetscInt, dimension(:), pointer :: id_ltog


They’re both modern fortran ”correct”

Anyways I tried both and I still get the same error message.


Okay, that file I sent the link to is tested every night, so I suspect 
a compiler bug in your version.
Please send your entire example so I can run it here. Also, let us 
know what Fortran compiler

and version you are using again.

  Thanks,

     Matt

Thibaut

On 24 Feb 2019, at 23:38, Matthew Knepley mailto:knep...@gmail.com>> wrote:


On Sun, Feb 24, 2019 at 6:33 PM Appel, Thibaut
mailto:t.appe...@imperial.ac.uk>> wrote:

Is that for the id_ltog argument? I tried declaring it as IS,
and you can’t declare an deferred-shape array as target. Same
message. XXX(:) is syntactic sugar for dimension(:) :: XXX

I’m really confused because this

https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex14f.F90.html
doesn’t use the xxxF90 variants of the routines we’re talking
about?


You can use the F77 stuff if you want. I thought you needed F90. 
For F90, I think you need to declare it

  PetscInt, pointer :: id_ltog(:)

like it is in the link I sent you.

  Thanks,

     Matt

Thibaut


On 24 Feb 2019, at 22:50, Matthew Knepley mailto:knep...@gmail.com>> wrote:

On Sun, Feb 24, 2019 at 4:28 PM Appel, Thibaut
mailto:t.appe...@imperial.ac.uk>>
wrote:

Hi Matthew,

With the following data declaration and routines calls:


I am not a Fortran90 expert, but your declaration looks
different than the ones I have seen work:


https://bitbucket.org/petsc/petsc/src/master/src/dm/impls/plex/examples/tutorials/ex1f90.F90

  Thanks,

     Matt


  DM :: da
ISLocalToGlobalMapping :: ltog
  PetscInt, DIMENSION(:), POINTER :: id_ltog

  CALL

DMDACreate2D(PETSC_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,(nx+1),(ny+1),
&
  
PETSC_DECIDE,PETSC_DECIDE,neq,0,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,da,ierr)
  CHKERRA(ierr)

  CALL DMSetUp(da,ierr)
  CHKERRA(ierr)

  CALL

DMDAGetCorners(da,icx,icy,PETSC_NULL_INTEGER,lx,ly,PETSC_NULL_INTEGER,ierr)
  CHKERRA(ierr)

  CALL DMGetLocalToGlobalMapping(da,ltog,ierr)
  CHKERRA(ierr)

  CALL
ISLocalToGlobalMappingGetIndicesF90(ltog,id_ltog,ierr)
  CHKERRA(ierr)

  CALL
ISLocalToGlobalMappingRestoreIndicesF90(ltog,id_ltog,ierr)
  CHKERRA(ierr)

  CALL DMDestroy(da,ierr)
  CHKERRA(ierr)


I get, with the most recent Intel Fortran compiler and a
fresh “git pull” PETsc:

forrtl: severe (408): fort: (7): Attempt to use pointer
ID_LTOG when it is not associated with a target


Thibaut


On 22 Feb 2019, at 15:13, Matthew Knepley
mailto:knep...@gmail.com>> wrote:

On Fri, Feb 22, 2019 at 9:10 AM Thibaut Appel via
petsc-users mailto:petsc-users@mcs.anl.gov>> wrote:
I reckon that what corresponds best to my situation is
to create my own MPIAIJ matrix, recover the DMDA local
to global mapping, preallocate myself and fill my
values with MatSetValues.

However, what is the correct way to
call ISLocalToGlobalMappingGetIndices in Fortran? It
seems there's something missing in the documentation as
my code just won't work.

Some examples include a PetscOffset argument which is
not present in the documentation and there is no manual
page for ISLocalToGlobalMappingGetIndicesF90: the only
information I could find is on
/src/vec/is/utils/f90-custom/zisltogf90.c. Are
you supposed to allocate the index array yourself? I
tried declaring it as a pointer too. I keep getting an
error

1) There was a bug in that file, but I don't think it
should have affected you. I will put in a PR

2)  You are supposed to pass in a pointer, unallocated.
We manage all the allocation, which is why you ca

Re: [petsc-users] About DMDA (and extracting its ordering)

2019-02-25 Thread Matthew Knepley via petsc-users
On Mon, Feb 25, 2019 at 3:19 AM Appel, Thibaut 
wrote:

> Hi Matthew,
>
> Yes I need F90 and the syntax in the file / yours
>
> PetscInt, pointer :: id_ltog(:)
>
>
> Is the exact same as
>
> PetscInt, dimension(:), pointer :: id_ltog
>
>
> They’re both modern fortran ”correct”
>
> Anyways I tried both and I still get the same error message.
>

Okay, that file I sent the link to is tested every night, so I suspect a
compiler bug in your version.
Please send your entire example so I can run it here. Also, let us know
what Fortran compiler
and version you are using again.

  Thanks,

 Matt


> Thibaut
>
> On 24 Feb 2019, at 23:38, Matthew Knepley  wrote:
>
> On Sun, Feb 24, 2019 at 6:33 PM Appel, Thibaut 
> wrote:
>
>> Is that for the id_ltog argument? I tried declaring it as IS, and you
>> can’t declare an deferred-shape array as target. Same message. XXX(:) is
>> syntactic sugar for dimension(:) :: XXX
>>
>> I’m really confused because this
>>
>> https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex14f.F90.html
>> doesn’t use the xxxF90 variants of the routines we’re talking about?
>>
>
> You can use the F77 stuff if you want. I thought you needed F90.  For F90,
> I think you need to declare it
>
>   PetscInt, pointer :: id_ltog(:)
>
> like it is in the link I sent you.
>
>   Thanks,
>
>  Matt
>
>
>> Thibaut
>>
>> On 24 Feb 2019, at 22:50, Matthew Knepley  wrote:
>>
>> On Sun, Feb 24, 2019 at 4:28 PM Appel, Thibaut 
>> wrote:
>>
>>> Hi Matthew,
>>>
>>> With the following data declaration and routines calls:
>>>
>>
>> I am not a Fortran90 expert, but your declaration looks different than
>> the ones I have seen work:
>>
>>
>> https://bitbucket.org/petsc/petsc/src/master/src/dm/impls/plex/examples/tutorials/ex1f90.F90
>>
>>   Thanks,
>>
>>  Matt
>>
>>
>>>
>>>   DM :: da
>>>   ISLocalToGlobalMapping :: ltog
>>>   PetscInt, DIMENSION(:), POINTER :: id_ltog
>>>
>>>   CALL
>>> DMDACreate2D(PETSC_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,(nx+1),(ny+1),
>>> &
>>>
>>>   
>>> PETSC_DECIDE,PETSC_DECIDE,neq,0,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,da,ierr)
>>>   CHKERRA(ierr)
>>>
>>>   CALL DMSetUp(da,ierr)
>>>   CHKERRA(ierr)
>>>
>>>   CALL
>>> DMDAGetCorners(da,icx,icy,PETSC_NULL_INTEGER,lx,ly,PETSC_NULL_INTEGER,ierr)
>>>   CHKERRA(ierr)
>>>
>>>   CALL DMGetLocalToGlobalMapping(da,ltog,ierr)
>>>   CHKERRA(ierr)
>>>
>>>   CALL ISLocalToGlobalMappingGetIndicesF90(ltog,id_ltog,ierr)
>>>   CHKERRA(ierr)
>>>
>>>   CALL ISLocalToGlobalMappingRestoreIndicesF90(ltog,id_ltog,ierr)
>>>   CHKERRA(ierr)
>>>
>>>   CALL DMDestroy(da,ierr)
>>>   CHKERRA(ierr)
>>>
>>>
>>> I get, with the most recent Intel Fortran compiler and a fresh “git
>>> pull” PETsc:
>>>
>>> forrtl: severe (408): fort: (7): Attempt to use pointer ID_LTOG when it
>>> is not associated with a target
>>>
>>>
>>> Thibaut
>>>
>>> On 22 Feb 2019, at 15:13, Matthew Knepley  wrote:
>>>
>>> On Fri, Feb 22, 2019 at 9:10 AM Thibaut Appel via petsc-users <
>>> petsc-users@mcs.anl.gov> wrote:
>>> I reckon that what corresponds best to my situation is to create my own
>>> MPIAIJ matrix, recover the DMDA local to global mapping, preallocate myself
>>> and fill my values with MatSetValues.
>>>
>>> However, what is the correct way to
>>> call ISLocalToGlobalMappingGetIndices in Fortran? It seems
>>> there's something missing in the documentation as my code just won't work.
>>>
>>> Some examples include a PetscOffset argument which is not present in the
>>> documentation and there is no manual page
>>> for ISLocalToGlobalMappingGetIndicesF90: the only information I could find
>>> is on /src/vec/is/utils/f90-custom/zisltogf90.c. Are you supposed to
>>> allocate the index array yourself? I tried declaring it as a pointer too. I
>>> keep getting an error
>>>
>>> 1) There was a bug in that file, but I don't think it should have
>>> affected you. I will put in a PR
>>>
>>> 2)  You are supposed to pass in a pointer, unallocated. We manage all
>>> the allocation, which is why you call Restore. What happens when you do
>>> that?
>>>
>>>   Thanks,
>>>
>>>  Matt
>>> [0]PETSC ERROR: #1 User provided function() line 0 in User file
>>> application called MPI_Abort(MPI_COMM_SELF, -42924) - process 0
>>>
>>> Minimal example:
>>>
>>> PROGRAM test_dmda
>>>
>>> #include 
>>> #include 
>>>
>>>   USE PetscDMDA
>>>
>>>   IMPLICIT NONE
>>>
>>>   PetscErrorCode :: ierr
>>>   PetscInt   :: irank, icx, icy, lx, ly, n_ltog
>>>   DM :: da
>>>   ISLocalToGlobalMapping :: ltog
>>>
>>>   PetscInt, DIMENSION(:), ALLOCATABLE :: id_ltog
>>>   !PetscInt, DIMENSION(:), POINTER :: id_ltog
>>>
>>>   PetscInt, PARAMETER :: nx=24, ny=9, neq=4
>>>   CHARACTER(LEN=100) :: err_msg
>>>
>>>   CALL PetscInitialize(PETSC_NULL_CHARACTER,ierr)
>>>
>>>   CALL MPI_COMM_RANK(PETSC_COMM_WORLD,irank,ierr)
>>>
>>>
>>> CALL 
>>> DMDACreate2D(PETSC_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,(nx+1),(ny+1),
>>>  &
>>>
>>>   
>>> PETSC_DECIDE

[petsc-users] Finding nonzero indices

2019-02-25 Thread Eda Oktay via petsc-users
Hello,

I am trying to find the indices (both row and column separately) of nonzero
entries of a sparse matrix in Petsc Binary Format. I found
MatGetSeqNonzeroStructure but it gives me a struct and I don't know whether
this is what I want or not.

Best regards,

Eda


Re: [petsc-users] About DMDA (and extracting its ordering)

2019-02-25 Thread Appel, Thibaut via petsc-users
Hi Matthew,

Yes I need F90 and the syntax in the file / yours
PetscInt, pointer :: id_ltog(:)

Is the exact same as
PetscInt, dimension(:), pointer :: id_ltog

They’re both modern fortran ”correct”

Anyways I tried both and I still get the same error message.

Thibaut

On 24 Feb 2019, at 23:38, Matthew Knepley 
mailto:knep...@gmail.com>> wrote:

On Sun, Feb 24, 2019 at 6:33 PM Appel, Thibaut 
mailto:t.appe...@imperial.ac.uk>> wrote:
Is that for the id_ltog argument? I tried declaring it as IS, and you can’t 
declare an deferred-shape array as target. Same message. XXX(:) is syntactic 
sugar for dimension(:) :: XXX

I’m really confused because this
https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex14f.F90.html
doesn’t use the xxxF90 variants of the routines we’re talking about?

You can use the F77 stuff if you want. I thought you needed F90.  For F90, I 
think you need to declare it

  PetscInt, pointer :: id_ltog(:)

like it is in the link I sent you.

  Thanks,

 Matt

Thibaut

On 24 Feb 2019, at 22:50, Matthew Knepley 
mailto:knep...@gmail.com>> wrote:

On Sun, Feb 24, 2019 at 4:28 PM Appel, Thibaut 
mailto:t.appe...@imperial.ac.uk>> wrote:
Hi Matthew,

With the following data declaration and routines calls:

I am not a Fortran90 expert, but your declaration looks different than the ones 
I have seen work:

  
https://bitbucket.org/petsc/petsc/src/master/src/dm/impls/plex/examples/tutorials/ex1f90.F90

  Thanks,

 Matt


  DM :: da
  ISLocalToGlobalMapping :: ltog
  PetscInt, DIMENSION(:), POINTER :: id_ltog

  CALL 
DMDACreate2D(PETSC_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,(nx+1),(ny+1),
 &

PETSC_DECIDE,PETSC_DECIDE,neq,0,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,da,ierr)
  CHKERRA(ierr)

  CALL DMSetUp(da,ierr)
  CHKERRA(ierr)

  CALL 
DMDAGetCorners(da,icx,icy,PETSC_NULL_INTEGER,lx,ly,PETSC_NULL_INTEGER,ierr)
  CHKERRA(ierr)

  CALL DMGetLocalToGlobalMapping(da,ltog,ierr)
  CHKERRA(ierr)

  CALL ISLocalToGlobalMappingGetIndicesF90(ltog,id_ltog,ierr)
  CHKERRA(ierr)

  CALL ISLocalToGlobalMappingRestoreIndicesF90(ltog,id_ltog,ierr)
  CHKERRA(ierr)

  CALL DMDestroy(da,ierr)
  CHKERRA(ierr)


I get, with the most recent Intel Fortran compiler and a fresh “git pull” PETsc:

forrtl: severe (408): fort: (7): Attempt to use pointer ID_LTOG when it is not 
associated with a target


Thibaut

On 22 Feb 2019, at 15:13, Matthew Knepley 
mailto:knep...@gmail.com>> wrote:

On Fri, Feb 22, 2019 at 9:10 AM Thibaut Appel via petsc-users 
mailto:petsc-users@mcs.anl.gov>> wrote:
I reckon that what corresponds best to my situation is to create my own MPIAIJ 
matrix, recover the DMDA local to global mapping, preallocate myself and fill 
my values with MatSetValues.

However, what is the correct way to call ISLocalToGlobalMappingGetIndices in 
Fortran? It seems there's something missing in the documentation as my code 
just won't work.

Some examples include a PetscOffset argument which is not present in the 
documentation and there is no manual page for 
ISLocalToGlobalMappingGetIndicesF90: the only information I could find is on 
/src/vec/is/utils/f90-custom/zisltogf90.c. Are you supposed to allocate the 
index array yourself? I tried declaring it as a pointer too. I keep getting an 
error

1) There was a bug in that file, but I don't think it should have affected you. 
I will put in a PR

2)  You are supposed to pass in a pointer, unallocated. We manage all the 
allocation, which is why you call Restore. What happens when you do that?

  Thanks,

 Matt
[0]PETSC ERROR: #1 User provided function() line 0 in User file
application called MPI_Abort(MPI_COMM_SELF, -42924) - process 0

Minimal example:

PROGRAM test_dmda

#include 
#include 

  USE PetscDMDA

  IMPLICIT NONE

  PetscErrorCode :: ierr
  PetscInt   :: irank, icx, icy, lx, ly, n_ltog
  DM :: da
  ISLocalToGlobalMapping :: ltog

  PetscInt, DIMENSION(:), ALLOCATABLE :: id_ltog
  !PetscInt, DIMENSION(:), POINTER :: id_ltog

  PetscInt, PARAMETER :: nx=24, ny=9, neq=4
  CHARACTER(LEN=100) :: err_msg

  CALL PetscInitialize(PETSC_NULL_CHARACTER,ierr)

  CALL MPI_COMM_RANK(PETSC_COMM_WORLD,irank,ierr)

  CALL 
DMDACreate2D(PETSC_COMM_WORLD,DM_BOUNDARY_NONE,DM_BOUNDARY_NONE,DMDA_STENCIL_STAR,(nx+1),(ny+1),
 &

PETSC_DECIDE,PETSC_DECIDE,neq,0,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,da,ierr)
  CHKERRA(ierr)

  CALL DMSetUp(da,ierr)
  CHKERRA(ierr)

  CALL 
DMDAGetCorners(da,icx,icy,PETSC_NULL_INTEGER,lx,ly,PETSC_NULL_INTEGER,ierr)
  CHKERRA(ierr)

  WRITE(*,'(*(1X,A,I3))') 'I am process #', irank, ' - my lower left corner is 
icx=', icx, &
  'and icy=', icy, ' - the width is lx=', lx, ' and 
ly=', ly

  CALL DMGetLocalToGlobalMapping(da,ltog,ierr)
  CHKERRA(ierr)

  CALL ISLocalToGlobalMappingGetSize(ltog,n_ltog,ierr)
  CHKERRA(ierr)

  ALLOCATE(id_ltog(1:n_ltog),STAT=ierr,ERRMSG=err_msg)

  CALL ISLocalToGlobalMappingGetIndices(lt