[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-20 Thread Jed Brown
On Wed, Apr 20, 2011 at 00:35, Ethan Coon wrote: > Ok, here's a patch that does the very very special case of: > > p=P=1, s > p, DMDA_BOUNDARY_PERIODIC in the z-direction. > > Note this is really only possible in the z-direction... > That is the case that you usually want, otherwise DMDAVecGetAr

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Jed Brown
On Tue, Apr 19, 2011 at 23:21, Ethan Coon wrote: > The attached patch fixes the errors to error in the correct cases. Pushed, thanks. -- next part -- An HTML attachment was scrubbed... URL:

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Jed Brown
On Tue, Apr 19, 2011 at 22:44, Ethan Coon wrote: > The short answer -- make the z-size = s. It's not that huge of a hit -- > the local arrays are 6*NX*NY*ndofs instead of 5*NX*NY*ndofs. > Indeed, though it is potentially about twice as much work because you only have to evaluate residuals on th

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Jed Brown
On Tue, Apr 19, 2011 at 22:19, Ethan Coon wrote: > At any rate, I'll fix the error message in 2D and add it to 3D to only > error in the cases that actually currently break. Doing > DMDA_BOUNDARY_PERIODIC with P=1 and s > zl (the multiple-wraps around > the domain case) will take more thought...

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Jed Brown
On Tue, Apr 19, 2011 at 21:47, Ethan Coon wrote: > Hmm, crap. I don't get your valgrind error > On further analysis, this looks like an Open MPI bug since it does not occur when I run the same thing with MPICH2. Unfortunately, I don't have time to reduce it to submit a good bug report. > but

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Jed Brown
On Tue, 19 Apr 2011 09:18:44 -0600, Ethan Coon wrote: > Can you shoot me your example? I run 1-node z direction both with and > without periodic BCs, and with and without ghost nodes, without a > valgrind complaint in DMDACreate3D. See attached very simple test case. It only crashes for stencil

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Matthew Knepley
On Tue, Apr 19, 2011 at 6:19 PM, Jed Brown wrote: > On Wed, Apr 20, 2011 at 00:35, Ethan Coon wrote: > >> Ok, here's a patch that does the very very special case of: >> >> p=P=1, s > p, DMDA_BOUNDARY_PERIODIC in the z-direction. >> >> Note this is really only possible in the z-direction... >> >

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Jed Brown
On Tue, Apr 19, 2011 at 16:56, Ethan Coon wrote: > This is in 3.1 I assume? Yeah, it's a problem in petsc-dev too (only tested with all periodic BCs). I get a seg-fault in [0]PETSC ERROR: [0] VecScatterBegin_1 line 22 /home/jed/petsc/include/../src/vec/vec/utils/vpscat.h [0]PETSC ERROR: [0] Ve

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Ethan Coon
Ok, here's a patch that does the very very special case of: p=P=1, s > p, DMDA_BOUNDARY_PERIODIC in the z-direction. Note this is really only possible in the z-direction... when in the z-direction, we can just check if the global index < 0 or > x*y*z and adjust appropriately. So this can't gener

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Jed Brown
This would make it easier to solve 2D problems with a 3D code. It currently crashes or produces NaN because the scatter is set up incorrectly: ==10402== Invalid read of size 2 ==10402==at 0x4C26C2C: memcpy (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==10402==by 0x6D87D01: opal

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Ethan Coon
The attached patch fixes the errors to error in the correct cases. Ethan On Tue, 2011-04-19 at 22:48 +0200, Jed Brown wrote: > On Tue, Apr 19, 2011 at 22:44, Ethan Coon wrote: > The short answer -- make the z-size = s. It's not that huge > of a hit -- > the local arrays

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Ethan Coon
On Tue, 2011-04-19 at 22:25 +0200, Jed Brown wrote: > On Tue, Apr 19, 2011 at 22:19, Ethan Coon wrote: > At any rate, I'll fix the error message in 2D and add it to 3D > to only > error in the cases that actually currently break. Doing > DMDA_BOUNDARY_PERIODIC with

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Ethan Coon
Ah, the 2D case provides an error message for this case, but not the 3d. [0]PETSC ERROR: - Error Message [0]PETSC ERROR: Argument out of range! [0]PETSC ERROR: Local y-width of domain y 1 is smaller than stencil width s 2! [0]PETSC ERROR:

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Ethan Coon
Hmm, crap. I don't get your valgrind error but I do get the crash with stencil size 2. Will get back to you, thanks, Ethan On Tue, 2011-04-19 at 21:25 +0200, Jed Brown wrote: > On Tue, 19 Apr 2011 09:18:44 -0600, Ethan Coon wrote: > > Can you shoot me your example? I run 1-node z direction bo

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Ethan Coon
Can you shoot me your example? I run 1-node z direction both with and without periodic BCs, and with and without ghost nodes, without a valgrind complaint in DMDACreate3D. I don't have a snes though, and it's done in C, not C++. On Tue, 2011-04-19 at 17:09 +0200, Jed Brown wrote: > On Tue, Apr

[petsc-dev] DACreate3d should work for 1 node in Z

2011-04-19 Thread Ethan Coon
This is in 3.1 I assume? Ethan On Tue, 2011-04-19 at 16:13 +0200, Jed Brown wrote: > This would make it easier to solve 2D problems with a 3D code. It > currently crashes or produces NaN because the scatter is set up > incorrectly: > > > ==10402== Invalid read of size 2 > ==10402==at 0x4C26