[petsc-dev] PetscFinalize broken with -options_table ?

William Perkins william.perkins at pnnl.gov
Wed Mar 19 07:59:46 CDT 2014


OK. That probably explains some other weirdness I was seeing, but could 
not isolate.

Thanks.

On 03/18/2014 09:52 PM, Barry Smith wrote:
>
>    Bill,
>
>      Fixed in maint and soon to be pushed to next and then master
>
>       Thanks for providing a working program that exhibits the problem so well. It was a rather convoluted bug. So long as you either avoid the -options_left option or make sure all PETSc objects are destroyed before PetscFinalize() it should not bit you until you get the fix.
>
>     Barry
>
> On Mar 18, 2014, at 10:46 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>>
>>    False alarm, problem is not as general as I stated.
>>
>>    I can reproduce the problem in maint with your example code when -breakme is on
>>
>>     Problem also happens in master
>>
>>    Still working on it.
>>
>>     Barry
>>
>>
>>
>>
>>
>>
>> On Mar 18, 2014, at 10:17 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>
>>>
>>>   This looks like a problem unrelated to viewers, options,  etc.
>>>
>>>   In maint, 3.4.3 and 3.4.4 PetscFinalize() crashes if any PETSc object (like your viewer) is not destroyed before PetscFinalize(). This does not occur in master and is not suppose to happen.
>>>
>>>    Trying to track it down but could take a while to determine what change broke this.
>>>
>>>   Barry
>>>
>>>
>>>
>>>
>>>
>>> On Mar 18, 2014, at 6:20 PM, William Perkins <william.perkins at pnnl.gov> wrote:
>>>
>>>> All,
>>>>
>>>> I also ran into this today.
>>>>
>>>> Attached is a minimal program that exhibited the problem for me. Initially, I thought it was because I was using non-default formats (e.g. MATLAB) for VecView and MatView, but I think any Viewer use causes the problem.
>>>>
>>>> Thanks.
>>>>
>>>> Bill
>>>>
>>>> P.S. I'm using 3.4.3 configured as follows:
>>>>
>>>> python ./config/configure.py \
>>>>   PETSC_ARCH=arch-macosx-complex-opt \
>>>>   --with-prefix="$prefix" \
>>>>   --with-mpi=1 \
>>>>   --with-cc=mpicc \
>>>>   --with-fc=mpif90 \
>>>>   --with-cxx=mpicxx \
>>>>   --with-c++-support=1 \
>>>>   --with-c-support=0 \
>>>>   --with-fortran=0 \
>>>>   --with-scalar-type=complex \
>>>>   --with-fortran-kernels=generic \
>>>>   --with-valgrind=0 \
>>>>   --download-superlu_dist \
>>>>   --download-parmetis \
>>>>   --download-metis \
>>>>   --download-f2cblaslapack=1 \
>>>>   --with-clanguage=c++ \
>>>>   --with-shared-libraries=0 \
>>>>   --with-dynamic-loading=0 \
>>>>   --with-x=0 \
>>>>   --with-mpirun=mpiexec \
>>>>   --with-mpiexec=mpiexec \
>>>>   --with-debugging=0
>>>>
>>>>
>>>> On 03/12/2014 04:30 AM, Matthew Knepley wrote:
>>>>> On Wed, Mar 12, 2014 at 4:52 AM, Václav Hapla <vaclav.hapla at vsb.cz
>>>>> <mailto:vaclav.hapla at vsb.cz>> wrote:
>>>>>
>>>>>   You're right this is not happening with the petsc example. Thus it's
>>>>>   probably problem in my code. I'll come back when I know what's the
>>>>>   true reason.
>>>>>
>>>>>
>>>>> It could still be our bug. If you can strip down your code and send it,
>>>>> I will look at it.
>>>>>
>>>>> Thanks,
>>>>>
>>>>>     Matt
>>>>>
>>>>>   Matt, sorry for replying to your personal address only.
>>>>>
>>>>>   Thank you,
>>>>>   Vaclav
>>>>>
>>>>>
>>>>>   Dne 11.3.2014 16:04, Matthew Knepley napsal(a):
>>>>>>   On Tue, Mar 11, 2014 at 9:27 AM, Václav Hapla <vaclav.hapla at vsb.cz
>>>>>>   <mailto:vaclav.hapla at vsb.cz>> wrote:
>>>>>>
>>>>>>       FWICS PetscFinalize in petsc-current contains the following bug.
>>>>>>       It calls
>>>>>>          PetscObjectRegisterDestroyAll()
>>>>>>       and after that, if -options_table is present, it calls
>>>>>>       PetscViewerASCIIGetStdout(PETSC_COMM_WORLD,&viewer);
>>>>>>          PetscOptionsView(viewer);
>>>>>>       causing
>>>>>>          [0]PETSC ERROR: No support for this operation for this
>>>>>>       object type!
>>>>>>          [0]PETSC ERROR: Only supports ASCII viewer!
>>>>>>       because the viewer is destroyed already by
>>>>>>       PetscObjectRegisterDestroyAll.
>>>>>>
>>>>>>       I haven't tested petsc-dev but I can see in it's the same
>>>>>>       situation in the pinit.c source.
>>>>>>
>>>>>>
>>>>>>   I cannot reproduce this on 'next':
>>>>>>
>>>>>>   next $:/PETSc3/petsc/petsc-dev/src/snes/examples/tutorials$ ./ex19
>>>>>>   -options_table -snes_monitor
>>>>>>   PETSC_OPTIONS="-cublas 0" ./ex19 -options_table -snes_monitor
>>>>>>   lid velocity = 0.0625, prandtl # = 1, grashof # = 1
>>>>>>     0 SNES Function norm 2.391552133017e-01
>>>>>>     1 SNES Function norm 6.839858507066e-05
>>>>>>     2 SNES Function norm 8.558777232425e-11
>>>>>>   Number of SNES iterations = 2
>>>>>>   #PETSc Option Table entries:
>>>>>>   -options_table
>>>>>>   -snes_monitor
>>>>>>   #End of PETSc Option Table entries
>>>>>>
>>>>>>   Can you reproduce this with a PETSc example?
>>>>>>
>>>>>>     Thanks,
>>>>>>
>>>>>>        Matt
>>>>>>
>>>>>>       Best regards,
>>>>>>       Vaclav
>>>>>>
>>>>>>
>>>>>>       --
>>>>>>
>>>>>>       Vaclav Hapla
>>>>>>       Junior researcher / PhD student
>>>>>>       IT4Innovations <http://www.it4i.eu/> / Dept. of Applied
>>>>>>       Mathematics <http://am.vsb.cz/>
>>>>>>
>>>>>>       _office PI 328_
>>>>>>       tel.: (+420) 597 329 078 <tel:%28%2B420%29%20597%20329%20078>
>>>>>>       Podnikatelsky inkubator VSB-TUO
>>>>>>       Studentska 6202/17
>>>>>>       708 00 Ostrava-Poruba
>>>>>>       Czech Republic
>>>>>>
>>>>>>       _contact address_
>>>>>>       IT4Innovations
>>>>>>       VSB - Technical University of Ostrava
>>>>>>       17. listopadu 15/2172
>>>>>>       708 33 Ostrava-Poruba
>>>>>>       Czech Republic
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>   --
>>>>>>   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
>>>>>
>>>>>   --
>>>>>
>>>>>   Vaclav Hapla
>>>>>   Junior researcher / PhD student
>>>>>   IT4Innovations <http://www.it4i.eu/> / Dept. of Applied Mathematics
>>>>>   <http://am.vsb.cz/>
>>>>>
>>>>>   _office PI 328_
>>>>>   tel.: (+420) 597 329 078 <tel:%28%2B420%29%20597%20329%20078>
>>>>>   Podnikatelsky inkubator VSB-TUO
>>>>>   Studentska 6202/17
>>>>>   708 00 Ostrava-Poruba
>>>>>   Czech Republic
>>>>>
>>>>>   _contact address_
>>>>>   IT4Innovations
>>>>>   VSB - Technical University of Ostrava
>>>>>   17. listopadu 15/2172
>>>>>   708 33 Ostrava-Poruba
>>>>>   Czech Republic
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> 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
>>>>
>>>> --
>>>> Bill Perkins
>>>> Research Engineer
>>>> Hydrology Group
>>>>
>>>> Pacific Northwest National Laboratory
>>>> 902 Battelle Boulevard
>>>> P.O. Box 999, MSIN K9-36
>>>> Richland, WA  99352 USA
>>>> Tel:  509-372-6131
>>>> Fax: 509-372-6089
>>>> william.perkins at pnnl.gov
>>>> www.pnnl.gov
>>>> <viewer.cpp><viewer.out>
>>>
>>
>

-- 
Bill Perkins
Research Engineer
Hydrology Group

Pacific Northwest National Laboratory
902 Battelle Boulevard
P.O. Box 999, MSIN K9-36
Richland, WA  99352 USA
Tel:  509-372-6131
Fax: 509-372-6089
william.perkins at pnnl.gov
www.pnnl.gov



More information about the petsc-dev mailing list