[petsc-dev] snes_monitor_residual

Matthew Knepley knepley at gmail.com
Thu Dec 22 09:10:04 CST 2016


On Thu, Dec 22, 2016 at 8:02 AM, Mark Adams <mfadams at lbl.gov> wrote:

>
>>> #PETSc Option Table entries:
>>> -dm_view hdf5:res.h5
>>> -snes_monitor_residual hdf5:res.h5::append
>>>
>>> ierr = DMViewFromOptions(ctx->dm,NULL,"-dm_view");CHKERRQ(ierr);
>>>
>>
>> 1) You need this in the code. Its in all my examples.
>>
>> 2) Did you put it before the vec views? Otherwise, it need 'append'.
>>
>
> The vec views are inside of SNES. I added this code before TSSolve and it
> did not change anything.
>
> I do not see an example with snes_monitor_residual.
>

Mark, this seems to work for me in SNES ex12:

master *$:/PETSc3/petsc/petsc-pylith$ MACOSX_DEPLOYMENT_TARGET=10.5
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PETSC_DIR/arch-master-debug/lib
PETSC_ARCH=arch-master-debug ./config/builder2.py check
src/snes/examples/tutorials/ex12.c --testnum=39 --args="-dm_view
hdf5:ex12.h5"
MACOSX_DEPLOYMENT_TARGET=10.5
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PETSC_DIR/arch-master-debug/lib
PETSC_ARCH=arch-master-debug ./config/builder2.py check
src/snes/examples/tutorials/ex12.c --testnum=39 --args="-dm_view
hdf5:ex12.h5"
Namespace(args=['-dm_view hdf5:ex12.h5'],
files=['src/snes/examples/tutorials/ex12.c'], func=<function check at
0x1005cb050>, numProcs=None, regParams=None, replace=False, retain=False,
testnum='39')
Running 1 tests
Test 37 requires packages ['exodusii', 'Broken']
Test 38 requires packages ['exodusii', 'Broken']
Building ['/PETSc3/petsc/petsc-pylith/src/snes/examples/tutorials/ex12.c']
Running #39: arch-master-debug/bin/mpiexec -host localhost -n 1
arch-master-debug/lib/ex12-obj/ex12 -run_type full -refinement_limit
0.015625 -interpolate 1 -petscspace_order 2 -pc_type gamg -ksp_rtolTest 51
requires packages ['pragmatic', 'Broken']
Test 83 requires packages ['p4est', 'Broken']
Test 84 requires packages ['p4est', 'Broken']
All tests pass
master *$:/PETSc3/petsc/petsc-pylith$ h5ls ex12.h5
h5ls ex12.h5
geometry                 Group
labels                   Group
topology                 Group
viz                      Group
master *$:/PETSc3/petsc/petsc-pylith$ MACOSX_DEPLOYMENT_TARGET=10.5
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PETSC_DIR/arch-master-debug/lib
PETSC_ARCH=arch-master-debug ./config/builder2.py check
src/snes/examples/tutorials/ex12.c --testnum=39 --args="-dm_view
hdf5:ex12.h5 -snes_monitor_residual hdf5:ex12.h5::append"
MACOSX_DEPLOYMENT_TARGET=10.5
DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$PETSC_DIR/arch-master-debug/lib
PETSC_ARCH=arch-master-debug ./config/builder2.py check
src/snes/examples/tutorials/ex12.c --testnum=39 --args="-dm_view
hdf5:ex12.h5 -snes_monitor_residual hdf5:ex12.h5::append"
Namespace(args=['-dm_view hdf5:ex12.h5 -snes_monitor_residual
hdf5:ex12.h5::append'], files=['src/snes/examples/tutorials/ex12.c'],
func=<function check at 0x1005cb050>, numProcs=None, regParams=None,
replace=False, retain=False, testnum='39')
Running 1 tests
Test 37 requires packages ['exodusii', 'Broken']
Test 38 requires packages ['exodusii', 'Broken']
Building ['/PETSc3/petsc/petsc-pylith/src/snes/examples/tutorials/ex12.c']
Running #39: arch-master-debug/bin/mpiexec -host localhost -n 1
arch-master-debug/lib/ex12-obj/ex12 -run_type full -refinement_limit
0.015625 -interpolate 1 -petscspace_order 2 -pc_type gamg -ksp_rtolTest 51
requires packages ['pragmatic', 'Broken']
Test 83 requires packages ['p4est', 'Broken']
Test 84 requires packages ['p4est', 'Broken']
All tests pass
master *$:/PETSc3/petsc/petsc-pylith$ h5ls ex12.h5
h5ls ex12.h5
fields                   Group
geometry                 Group
labels                   Group
topology                 Group
vertex_fields            Group
viz                      Group
master *$:/PETSc3/petsc/petsc-pylith$ h5ls ex12.h5/vertex_fields
h5ls ex12.h5/vertex_fields
Vec_0x84000000_0_potential Dataset {41}

  Thanks,

     Matt


> Thanks,
>



-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20161222/db24b908/attachment.html>


More information about the petsc-dev mailing list