[petsc-dev] using valgrind with new test harness
Barry Smith
bsmith at mcs.anl.gov
Wed Feb 8 21:43:37 CST 2017
> On Feb 8, 2017, at 4:47 PM, Satish Balay <balay at mcs.anl.gov> wrote:
>
> Scott & Barry,
>
> I'd like to remove the 'env' variable change. We don't want this to be
> overwritten as it can be fragile [as users env can have incompatible
> stuff here]
>
> And petscmpiexec relies on env variables - so I'm not using it in the test harness.
>
> So I have a branch scott/test-harness-valgrind-v2 (with commits collapsed/fixed)
>
> So the following would be the way to use it.
>
> make -f gmakefile test VALGRIND=1
>
> Do you have any objections to this?
This is ok with me. I only want an easy way to add valgrind, I am not advocating using environmental variables to achieve it.
>
> If we want them to be overwritted - then I guess we'll have to namespace them properly.
>
> Satish
>
> On Wed, 8 Feb 2017, Scott Kruger wrote:
>
>>
>>
>> Actually Jed's discussion of using env for DIFF had me consider another
>> solution than the one I had originally came up with. I have both mpiexec and
>> diff using this new method to give what Barry
>> wants more directly:
>> https://bitbucket.org/petsc/petsc/pull-requests/631/
>>
>>
>> Both of these now work at the makefile level:
>>
>> make -f gmakefile test VALGRIND=1
>>
>> MPIEXEC="/sandbox/bsmith/petsc/bin/petscmpiexec -valgrind" make -e -f
>> gmakefile test
>>
>> Note that I am passing the -e flag to make which has
>> the environment variable override the value in
>> ${PETSC_ARCH}/lib/conf/petscvariables
>> This can be dangerous depending on how clean your environment is
>> because it'll override ALL variables.
>>
>>
>> And from the shell script level:
>>
>> runex1.sh -V
>>
>> MPIEXEC="/sandbox/bsmith/petsc/bin/petscmpiexec -valgrind" runex1.sh
>>
>>
>>
>> On 2/7/17 4:42 PM, Barry Smith wrote:
>>>
>>>> On Feb 7, 2017, at 5:34 PM, Satish Balay <balay at mcs.anl.gov> wrote:
>>>>
>>>> We cannot override stuff via env variables in the new test harness. For
>>>> nightlybuilds
>>>> I added support to check if PETSC_ARCH has 'valgrind' string in it - and
>>>> if so - use
>>>> valgrind.
>>>>
>>>> 26646c0bcc29652ef239540b066d00d1c8fc99c7
>>>>
>>>> Perhaps we can force this to use valgrind with:
>>>>
>>>> ./config/gmakegentest.py --valgrind=1
>>>
>>> I can't decide at the time I run the tests, but need to decide when I do
>>> the gmakegentest.py
>>>>
>>>> Ok - perhaps the attached patch.
>>>
>>> That is one heck of a patch, talk about code duplication resulting in
>>> endless bugs.
>>>
>>>> But then - sometimes gmakefile runs ./config/gmakegentest.py directly
>>>> [without valgrind]
>>>
>>> Fix it properly somehow; currently it is impossible and that is insanely
>>> horrible.
>>>
>>>>
>>>> Satish
>>>>
>>>> -------
>>>>
>>>>
>>>> On Tue, 7 Feb 2017, Barry Smith wrote:
>>>>
>>>>>
>>>>> Both
>>>>>
>>>>> make -f gmakefile test MPIEXEC="/sandbox/bsmith/petsc/bin/petscmpiexec
>>>>> -valgrind "
>>>>>
>>>>> and
>>>>>
>>>>> MPIEXEC="/sandbox/bsmith/petsc/bin/petscmpiexec -valgrind " make -f
>>>>> gmakefile test
>>>>>
>>>>> do not appear to use valgrind in the test harness (the old system did).
>>>>>
>>>>> How do I run all tests under valgrind automatically?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> not ok dm_impls_plex_tests-ex18_1
>>>>> # [0]PETSC ERROR: PetscTrFreeDefault() called from
>>>>> VecDestroy_MPI() line 18 in /sandbox/bsmith/petsc/src/vec\
>>>>> /vec/impls/mpi/pdvec.c
>>>>> # [0]PETSC ERROR: Block [id=0(32)] at address 0xb54240 is
>>>>> # corrupted (probably write past end of array)
>>>>> # [0]PETSC ERROR: Block allocated in VecCreate_MPI_Private() line
>>>>> # 497 in /sandbox/bsmith/petsc/src/vec/vec/i\
>>>>> mpls/mpi/pbvec.c
>>>>> # [0]PETSC ERROR: --------------------- Error Message
>>>>> ------------------------------------------------------\
>>>>> --------
>>>>> # [0]PETSC ERROR: Memory corruption:
>>>>> # http://www.mcs.anl.gov/petsc/documentation/installation.html#valgrind
>>>>> # [0]PETSC ERROR: Corrupted memory
>>>>> # [0]PETSC ERROR: See
>>>>> # http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble
>>>>> # shooting.
>>>>> # [0]PETSC ERROR: Petsc Development GIT revision:
>>>>> # v3.7.5-3057-g2d11e0f GIT Date: 2017-02-07 15:39:04 -0600
>>>>> # [0]PETSC ERROR: ../ex18 on a arch-single named es by bsmith Tue
>>>>> # Feb 7 15:46:25 2017
>>>>> # [0]PETSC ERROR: Configure options --download-ctetgen
>>>>> # --download-exodusii --download-hdf5 --download-mpich \
>>>>> --download-netcdf PETSC_ARCH=arch-single --with-precision=single
>>>>> # [0]PETSC ERROR: #1 PetscTrFreeDefault() line 287 in
>>>>> # /sandbox/bsmith/petsc/src/sys/memory/mtr.c
>>>>> # [0]PETSC ERROR: #2 VecDestroy_MPI() line 18 in
>>>>> # /sandbox/bsmith/petsc/src/vec/vec/impls/mpi/pdvec.c
>>>>> # [0]PETSC ERROR: #3 VecDestroy() line 406 in
>>>>> # /sandbox/bsmith/petsc/src/vec/vec/interface/vector.c
>>>>> # [0]PETSC ERROR: #4 DMDestroy() line 681 in
>>>>> # /sandbox/bsmith/petsc/src/dm/interface/dm.c
>>>>> # [0]PETSC ERROR: #5 main() line 473 in
>>>>> # /sandbox/bsmith/petsc/src/dm/impls/plex/examples/tests/ex18.c
>>>>> # [0]PETSC ERROR: PETSc Option Table entries:
>>>>> # [0]PETSC ERROR: -dm_view ascii::ascii_info_detail
>>>>> # [0]PETSC ERROR: -interpolate
>>>>>
>>>>>
>>>>>
>>>> <val.patch>
>>>
>>
>>
>
More information about the petsc-dev
mailing list