Re: [petsc-dev] errors for /petsc/src/ts/examples/tutorials/ex29.c

2016-10-24 Thread Barry Smith

> On Oct 24, 2016, at 11:15 AM, Anton Popov  wrote:
> 
> Our code breaks after compiling with recent branch 
> (barry/fix-matmpixxxsetpreallocation-reentrant)
> 
> I figured out it's because of this:
> 
> On 09/23/2016 05:19 AM, Barry Smith wrote:
>> branch barry/fix-dmdacreate in next for testing pulls the DMSetFromOptions() 
>> and DMSetUp() call out of the DMDACreateNd(). It also removes any special 
>> handling of negative M,N, and P arguments.
> 
> Is it going to be the standard behavior of DMDACreateNd() in future releases?

   Yes, the new code fixed some issues with multiple DMDAs and is more like the 
rest of the PETSc design. 
> 
> Anton
> 



Re: [petsc-dev] errors for /petsc/src/ts/examples/tutorials/ex29.c

2016-10-24 Thread Anton Popov
Our code breaks after compiling with recent branch 
(barry/fix-matmpixxxsetpreallocation-reentrant)


I figured out it's because of this:

On 09/23/2016 05:19 AM, Barry Smith wrote:

branch barry/fix-dmdacreate in next for testing pulls the DMSetFromOptions() 
and DMSetUp() call out of the DMDACreateNd(). It also removes any special 
handling of negative M,N, and P arguments.


Is it going to be the standard behavior of DMDACreateNd() in future 
releases?


Anton



Re: [petsc-dev] errors for /petsc/src/ts/examples/tutorials/ex29.c

2016-09-22 Thread Barry Smith

branch barry/fix-dmdacreate in next for testing pulls the DMSetFromOptions() 
and DMSetUp() call out of the DMDACreateNd(). It also removes any special 
handling of negative M,N, and P arguments.


  Barry

> On Sep 15, 2016, at 11:35 PM, Jed Brown  wrote:
> 
> Barry Smith  writes:
>>  A perhaps better fix is to finally remove this from the DMDCreateNd() calls 
>> 
>>  /* This violates the behavior for other classes, but right now users expect 
>> negative dimensions to be handled this way */
>>  ierr = DMSetFromOptions(*da);CHKERRQ(ierr);
>>  ierr = DMSetUp(*da);CHKERRQ(ierr);
>> 
>>  Perhaps we could remove both of these lines from those calls and require 
>> every use of DMDCreateNd() to add the 
>> DMSetUp() call. Then the user is free to insert a DMSetFromOptions() in 
>> between or not. We remove the negative value business which is hokey anyway?
>> 
>>  So in the use of DMDAGetReducedDMDA() it could call DMDACreate2d() then the 
>> DMSetUp() but skip the DMSetFromOptions() line.
> 
> I won't stop you, but I'm not sure that's worth it.  We don't use
> MatCreateAIJ type "convenience" functions in library code, so why should
> we use the DMDACreate*d convenience functions?  Presumably doing so
> would remove the conditionals (over dimension) that we have now.  Or
> perhaps we should do both?



Re: [petsc-dev] errors for /petsc/src/ts/examples/tutorials/ex29.c

2016-09-16 Thread Barry Smith

> On Sep 15, 2016, at 11:35 PM, Jed Brown  wrote:
> 
> Barry Smith  writes:
>>  A perhaps better fix is to finally remove this from the DMDCreateNd() calls 
>> 
>>  /* This violates the behavior for other classes, but right now users expect 
>> negative dimensions to be handled this way */
>>  ierr = DMSetFromOptions(*da);CHKERRQ(ierr);
>>  ierr = DMSetUp(*da);CHKERRQ(ierr);
>> 
>>  Perhaps we could remove both of these lines from those calls and require 
>> every use of DMDCreateNd() to add the 
>> DMSetUp() call. Then the user is free to insert a DMSetFromOptions() in 
>> between or not. We remove the negative value business which is hokey anyway?
>> 
>>  So in the use of DMDAGetReducedDMDA() it could call DMDACreate2d() then the 
>> DMSetUp() but skip the DMSetFromOptions() line.
> 
> I won't stop you, but I'm not sure that's worth it.  We don't use
> MatCreateAIJ type "convenience" functions in library code, so why should
> we use the DMDACreate*d convenience functions?  Presumably doing so
> would remove the conditionals (over dimension) that we have now.  Or
> perhaps we should do both?

   Yeah, we probably should do both.

  Barry




Re: [petsc-dev] errors for /petsc/src/ts/examples/tutorials/ex29.c

2016-09-16 Thread Jed Brown
Barry Smith  writes:
>   A perhaps better fix is to finally remove this from the DMDCreateNd() calls 
>
>   /* This violates the behavior for other classes, but right now users expect 
> negative dimensions to be handled this way */
>   ierr = DMSetFromOptions(*da);CHKERRQ(ierr);
>   ierr = DMSetUp(*da);CHKERRQ(ierr);
>
>   Perhaps we could remove both of these lines from those calls and require 
> every use of DMDCreateNd() to add the 
> DMSetUp() call. Then the user is free to insert a DMSetFromOptions() in 
> between or not. We remove the negative value business which is hokey anyway?
>
>   So in the use of DMDAGetReducedDMDA() it could call DMDACreate2d() then the 
> DMSetUp() but skip the DMSetFromOptions() line.

I won't stop you, but I'm not sure that's worth it.  We don't use
MatCreateAIJ type "convenience" functions in library code, so why should
we use the DMDACreate*d convenience functions?  Presumably doing so
would remove the conditionals (over dimension) that we have now.  Or
perhaps we should do both?


signature.asc
Description: PGP signature


Re: [petsc-dev] errors for /petsc/src/ts/examples/tutorials/ex29.c

2016-09-15 Thread Barry Smith

> On Sep 15, 2016, at 11:14 PM, Jed Brown  wrote:
> 
> Lulu Liu  writes:
> 
>> Hi,
>> 
>> How to fix this errors? Thanks!
>> 
>> mpirun -n 4 ./ex29 -da_refine 4 -ts_max_steps 10 -ts_rtol 1e-3 -ts_atol
>> 1e-3 -ts_type arkimex -ts_monitor -snes_monitor -snes_type aspin
>> -da_processors_x 2 -da_processors_y 2 -snes_type aspin -ts_max_steps 3
> 
> I think it is incorrect for DMDAGetReducedDMDA to call DMDACreate2d.  It
> should instead call the lower level functions and *not* call
> DMSetFromOptions.

  A perhaps better fix is to finally remove this from the DMDCreateNd() calls 

  /* This violates the behavior for other classes, but right now users expect 
negative dimensions to be handled this way */
  ierr = DMSetFromOptions(*da);CHKERRQ(ierr);
  ierr = DMSetUp(*da);CHKERRQ(ierr);

  Perhaps we could remove both of these lines from those calls and require 
every use of DMDCreateNd() to add the 
DMSetUp() call. Then the user is free to insert a DMSetFromOptions() in between 
or not. We remove the negative value business which is hokey anyway?

  So in the use of DMDAGetReducedDMDA() it could call DMDACreate2d() then the 
DMSetUp() but skip the DMSetFromOptions() line.

   Barry



> 
>> 0 TS dt 0.05 time 0.
>> [0]PETSC ERROR: - Error Message
>> --
>> [0]PETSC ERROR: Argument out of range
>> [0]PETSC ERROR: Too many processors in X direction: 2 1
>> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
>> trouble shooting.
>> [1]PETSC ERROR: - Error Message
>> --
>> [1]PETSC ERROR: Argument out of range
>> [1]PETSC ERROR: Too many processors in X direction: 2 1
>> [1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
>> trouble shooting.
>> [1]PETSC ERROR: Petsc Release Version 3.7.3, unknown
>> [1]PETSC ERROR: ./ex29 on a arch-darwin-c-debug named
>> 77-59-39-26.dclient.hispeed.ch by lulu Tue Sep 13 22:04:51 2016
>> [1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
>> --with-fc=gfortran --download-fblaslapack --download-mpich --download-cmake
>> --download-superlu_dist --download-mumps --download-hypre
>> --download-scalapack --download-metis --download-parmetis
>> --download-superlu --download-triangle --download-exodusii
>> --download-netcdf --download-hdf5
>> [1]PETSC ERROR: [2]PETSC ERROR: - Error Message
>> --
>> [2]PETSC ERROR: Argument out of range
>> [2]PETSC ERROR: Too many processors in X direction: 2 1
>> [2]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
>> trouble shooting.
>> [2]PETSC ERROR: Petsc Release Version 3.7.3, unknown
>> [2]PETSC ERROR: ./ex29 on a arch-darwin-c-debug named
>> 77-59-39-26.dclient.hispeed.ch by lulu Tue Sep 13 22:04:51 2016
>> [2]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
>> --with-fc=gfortran --download-fblaslapack --download-mpich --download-cmake
>> --download-superlu_dist --download-mumps --download-hypre
>> --download-scalapack --download-metis --download-parmetis
>> --download-superlu --download-triangle --download-exodusii
>> --download-netcdf --download-hdf5
>> [2]PETSC ERROR: #1 DMSetUp_DA_2D() line 268 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/da2.c
>> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown
>> [0]PETSC ERROR: ./ex29 on a arch-darwin-c-debug named
>> 77-59-39-26.dclient.hispeed.ch by lulu Tue Sep 13 22:04:51 2016
>> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
>> --with-fc=gfortran --download-fblaslapack --download-mpich --download-cmake
>> --download-superlu_dist --download-mumps --download-hypre
>> --download-scalapack --download-metis --download-parmetis
>> --download-superlu --download-triangle --download-exodusii
>> --download-netcdf --download-hdf5
>> [0]PETSC ERROR: #1 DMSetUp_DA_2D() line 268 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/da2.c
>> [1]PETSC ERROR: #2 DMSetUp_DA() line 25 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dareg.c
>> [1]PETSC ERROR: #3 DMSetUp() line 744 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
>> [1]PETSC ERROR: #4 DMDACreate2d() line 866 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/da2.c
>> [1]PETSC ERROR: #5 DMDAGetReducedDMDA() line 398 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dacorn.c
>> [1]PETSC ERROR: #6 DMCreateCoordinateDM_DA() line 14 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dacorn.c
>> [1]PETSC ERROR: #7 DMGetCoordinateDM() line 4293 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
>> [1]PETSC ERROR: #8 DMSubDomainHook_Coordinates() line 3989 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
>> [1]PETSC ERROR: [2]PETSC ERROR: #2 DMSetUp_DA() line 25 in
>> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dareg.c

Re: [petsc-dev] errors for /petsc/src/ts/examples/tutorials/ex29.c

2016-09-15 Thread Jed Brown
Lulu Liu  writes:

> Hi,
>
> How to fix this errors? Thanks!
>
> mpirun -n 4 ./ex29 -da_refine 4 -ts_max_steps 10 -ts_rtol 1e-3 -ts_atol
> 1e-3 -ts_type arkimex -ts_monitor -snes_monitor -snes_type aspin
> -da_processors_x 2 -da_processors_y 2 -snes_type aspin -ts_max_steps 3

I think it is incorrect for DMDAGetReducedDMDA to call DMDACreate2d.  It
should instead call the lower level functions and *not* call
DMSetFromOptions.

> 0 TS dt 0.05 time 0.
> [0]PETSC ERROR: - Error Message
> --
> [0]PETSC ERROR: Argument out of range
> [0]PETSC ERROR: Too many processors in X direction: 2 1
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
> trouble shooting.
> [1]PETSC ERROR: - Error Message
> --
> [1]PETSC ERROR: Argument out of range
> [1]PETSC ERROR: Too many processors in X direction: 2 1
> [1]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
> trouble shooting.
> [1]PETSC ERROR: Petsc Release Version 3.7.3, unknown
> [1]PETSC ERROR: ./ex29 on a arch-darwin-c-debug named
> 77-59-39-26.dclient.hispeed.ch by lulu Tue Sep 13 22:04:51 2016
> [1]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
> --with-fc=gfortran --download-fblaslapack --download-mpich --download-cmake
> --download-superlu_dist --download-mumps --download-hypre
> --download-scalapack --download-metis --download-parmetis
> --download-superlu --download-triangle --download-exodusii
> --download-netcdf --download-hdf5
> [1]PETSC ERROR: [2]PETSC ERROR: - Error Message
> --
> [2]PETSC ERROR: Argument out of range
> [2]PETSC ERROR: Too many processors in X direction: 2 1
> [2]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
> trouble shooting.
> [2]PETSC ERROR: Petsc Release Version 3.7.3, unknown
> [2]PETSC ERROR: ./ex29 on a arch-darwin-c-debug named
> 77-59-39-26.dclient.hispeed.ch by lulu Tue Sep 13 22:04:51 2016
> [2]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
> --with-fc=gfortran --download-fblaslapack --download-mpich --download-cmake
> --download-superlu_dist --download-mumps --download-hypre
> --download-scalapack --download-metis --download-parmetis
> --download-superlu --download-triangle --download-exodusii
> --download-netcdf --download-hdf5
> [2]PETSC ERROR: #1 DMSetUp_DA_2D() line 268 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/da2.c
> [0]PETSC ERROR: Petsc Release Version 3.7.3, unknown
> [0]PETSC ERROR: ./ex29 on a arch-darwin-c-debug named
> 77-59-39-26.dclient.hispeed.ch by lulu Tue Sep 13 22:04:51 2016
> [0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
> --with-fc=gfortran --download-fblaslapack --download-mpich --download-cmake
> --download-superlu_dist --download-mumps --download-hypre
> --download-scalapack --download-metis --download-parmetis
> --download-superlu --download-triangle --download-exodusii
> --download-netcdf --download-hdf5
> [0]PETSC ERROR: #1 DMSetUp_DA_2D() line 268 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/da2.c
> [1]PETSC ERROR: #2 DMSetUp_DA() line 25 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dareg.c
> [1]PETSC ERROR: #3 DMSetUp() line 744 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
> [1]PETSC ERROR: #4 DMDACreate2d() line 866 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/da2.c
> [1]PETSC ERROR: #5 DMDAGetReducedDMDA() line 398 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dacorn.c
> [1]PETSC ERROR: #6 DMCreateCoordinateDM_DA() line 14 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dacorn.c
> [1]PETSC ERROR: #7 DMGetCoordinateDM() line 4293 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
> [1]PETSC ERROR: #8 DMSubDomainHook_Coordinates() line 3989 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
> [1]PETSC ERROR: [2]PETSC ERROR: #2 DMSetUp_DA() line 25 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dareg.c
> [2]PETSC ERROR: #3 DMSetUp() line 744 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
> [2]PETSC ERROR: #4 DMDACreate2d() line 866 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/da2.c
> [2]PETSC ERROR: #5 DMDAGetReducedDMDA() line 398 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dacorn.c
> [2]PETSC ERROR: #6 DMCreateCoordinateDM_DA() line 14 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/impls/da/dacorn.c
> [2]PETSC ERROR: #7 DMGetCoordinateDM() line 4293 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
> [2]PETSC ERROR: #8 DMSubDomainHook_Coordinates() line 3989 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
> [2]PETSC ERROR: #9 DMCreateDomainDecomposition() line 1592 in
> /Users/lulu/petsc/petsc-3.7.3/petsc/src/dm/interface/dm.c
>
> -- 
>
> ---