valgrind

Asked by Murtazo Nazarov

Hi,

I am trying to use
valgrind --tool=cachegrind ./demo

to check the performance of my code, but I get the following error:

==27082==
terminate called after throwing an instance of 'CGAL::Assertion_exception'
  what(): CGAL ERROR: assertion violation!
Expr: -CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1)
File: /usr/include/CGAL/Interval_nt.h
Line: 158
Explanation: Wrong rounding: did you forget the -frounding-math option if you use GCC?
==27082==
==27082== I refs: 22,583,550
==27082== I1 misses: 2,318
==27082== L2i misses: 2,216
==27082== I1 miss rate: 0.01%
==27082== L2i miss rate: 0.00%
==27082==
==27082== D refs: 8,211,978 (6,125,423 rd + 2,086,555 wr)
==27082== D1 misses: 279,852 ( 269,368 rd + 10,484 wr)
==27082== L2d misses: 59,980 ( 53,008 rd + 6,972 wr)
==27082== D1 miss rate: 3.4% ( 4.3% + 0.5% )
==27082== L2d miss rate: 0.7% ( 0.8% + 0.3% )
==27082==
==27082== L2 refs: 282,170 ( 271,686 rd + 10,484 wr)
==27082== L2 misses: 62,196 ( 55,224 rd + 6,972 wr)
==27082== L2 miss rate: 0.2% ( 0.1% + 0.3% )
Abort

Have anyone tried it out?

murtazo

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Murtazo Nazarov
Solved:
Last query:
Last reply:
Revision history for this message
Anders Logg (logg) said :
#1

You need to set this option to run with Valgrind:

  CGAL_DISABLE_ROUNDING_MATH_CHECK

This will configure the build against CGAL so that CGAL does not
interfere with Valgrind. If you use cmake-gui, you should be able to
see this option and just click it.

--
Anders

On Tue, Sep 28, 2010 at 06:00:10PM -0000, Murtazo Nazarov wrote:
> New question #127201 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/127201
>
> Hi,
>
> I am trying to use
> valgrind --tool=cachegrind ./demo
>
> to check the performance of my code, but I get the following error:
>
> ==27082==
> terminate called after throwing an instance of 'CGAL::Assertion_exception'
> what(): CGAL ERROR: assertion violation!
> Expr: -CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1)
> File: /usr/include/CGAL/Interval_nt.h
> Line: 158
> Explanation: Wrong rounding: did you forget the -frounding-math option if you use GCC?
> ==27082==
> ==27082== I refs: 22,583,550
> ==27082== I1 misses: 2,318
> ==27082== L2i misses: 2,216
> ==27082== I1 miss rate: 0.01%
> ==27082== L2i miss rate: 0.00%
> ==27082==
> ==27082== D refs: 8,211,978 (6,125,423 rd + 2,086,555 wr)
> ==27082== D1 misses: 279,852 ( 269,368 rd + 10,484 wr)
> ==27082== L2d misses: 59,980 ( 53,008 rd + 6,972 wr)
> ==27082== D1 miss rate: 3.4% ( 4.3% + 0.5% )
> ==27082== L2d miss rate: 0.7% ( 0.8% + 0.3% )
> ==27082==
> ==27082== L2 refs: 282,170 ( 271,686 rd + 10,484 wr)
> ==27082== L2 misses: 62,196 ( 55,224 rd + 6,972 wr)
> ==27082== L2 miss rate: 0.2% ( 0.1% + 0.3% )
> Abort
>
> Have anyone tried it out?
>
> murtazo
>

--
Anders

Revision history for this message
Murtazo Nazarov (murtazo) said :
#2

On 09/28/10 21:48, Anders Logg wrote:
> Question #127201 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/127201
>
> Status: Open => Answered
>
> Anders Logg proposed the following answer:
> You need to set this option to run with Valgrind:
>
> CGAL_DISABLE_ROUNDING_MATH_CHECK
>
> This will configure the build against CGAL so that CGAL does not
> interfere with Valgrind. If you use cmake-gui, you should be able to
> see this option and just click it.
>

Is it when I install dolfin? I usually use dorsal, where shall change in
this case?

murtazo

> --
> Anders
>
>
> On Tue, Sep 28, 2010 at 06:00:10PM -0000, Murtazo Nazarov wrote:
>
>> New question #127201 on DOLFIN:
>> https://answers.launchpad.net/dolfin/+question/127201
>>
>> Hi,
>>
>> I am trying to use
>> valgrind --tool=cachegrind ./demo
>>
>> to check the performance of my code, but I get the following error:
>>
>> ==27082==
>> terminate called after throwing an instance of 'CGAL::Assertion_exception'
>> what(): CGAL ERROR: assertion violation!
>> Expr: -CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1)
>> File: /usr/include/CGAL/Interval_nt.h
>> Line: 158
>> Explanation: Wrong rounding: did you forget the -frounding-math option if you use GCC?
>> ==27082==
>> ==27082== I refs: 22,583,550
>> ==27082== I1 misses: 2,318
>> ==27082== L2i misses: 2,216
>> ==27082== I1 miss rate: 0.01%
>> ==27082== L2i miss rate: 0.00%
>> ==27082==
>> ==27082== D refs: 8,211,978 (6,125,423 rd + 2,086,555 wr)
>> ==27082== D1 misses: 279,852 ( 269,368 rd + 10,484 wr)
>> ==27082== L2d misses: 59,980 ( 53,008 rd + 6,972 wr)
>> ==27082== D1 miss rate: 3.4% ( 4.3% + 0.5% )
>> ==27082== L2d miss rate: 0.7% ( 0.8% + 0.3% )
>> ==27082==
>> ==27082== L2 refs: 282,170 ( 271,686 rd + 10,484 wr)
>> ==27082== L2 misses: 62,196 ( 55,224 rd + 6,972 wr)
>> ==27082== L2 miss rate: 0.2% ( 0.1% + 0.3% )
>> Abort
>>
>> Have anyone tried it out?
>>
>> murtazo
>>
>>
> --
> Anders
>
>

Revision history for this message
Anders Logg (logg) said :
#3

On Tue, Sep 28, 2010 at 10:18:29PM +0200, Murtazo Nazarov wrote:
> On 09/28/10 21:48, Anders Logg wrote:
> >Question #127201 on DOLFIN changed:
> >https://answers.launchpad.net/dolfin/+question/127201
> >
> > Status: Open => Answered
> >
> >Anders Logg proposed the following answer:
> >You need to set this option to run with Valgrind:
> >
> > CGAL_DISABLE_ROUNDING_MATH_CHECK
> >
> >This will configure the build against CGAL so that CGAL does not
> >interfere with Valgrind. If you use cmake-gui, you should be able to
> >see this option and just click it.
>
> Is it when I install dolfin? I usually use dorsal, where shall
> change in this case?
>
> murtazo

I don't know where this can be changed in Dorsal. Maybe Harish knows?

--
Anders

Revision history for this message
Harish Narayanan (hnarayanan) said :
#4

Might it be something like adding

-DCGAL_DISABLE_ROUNDING_MATH_CHECK=ON

to the cmake line?

Revision history for this message
Murtazo Nazarov (murtazo) said :
#5

On 09/28/2010 11:27 PM, Harish Narayanan wrote:
> Question #127201 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/127201
>
> Harish Narayanan proposed the following answer:
> Might it be something like adding
>
> -DCGAL_DISABLE_ROUNDING_MATH_CHECK=ON
>
> to the cmake line?
>
>
Is it need to be added in dorsal?

murtazo

Revision history for this message
Johannes Ring (johannr) said :
#6

Yes, but AFAIK there is no nice way to do this in Dorsal at the moment.

Harish: Maybe the cmake build chain should obey the CONFOPTS variable similarly as the autotools build chain does? This way Murtazo could simply add

  CONFOPTS=-DCGAL_DISABLE_ROUNDING_MATH_CHECK=ON

in dolfin.package and DOLFIN would then be configured with this option.

Revision history for this message
Murtazo Nazarov (murtazo) said :
#7

I put it the line your wrote into dolfin.package:

NAME=dolfin
SOURCE=lp:
PACKING=bzr
BUILDCHAIN=cmake
CONFOPTS=-DCGAL_DISABLE_ROUNDING_MATH_CHECK=ON

But, still the problem is there.

murtazo

Revision history for this message
Johannes Ring (johannr) said :
#8

This feature is not yet supported by Dorsal. I was simply suggesting that it should be added. Anyway, adding ${CONFOPTS} to line 209 in dorsal.sh should probably make it work for you. That is, replace this line

  echo cmake ../ -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} >>dorsal_build

with this

  echo cmake ../ ${CONFOPTS} -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} >>dorsal_build

Revision history for this message
Harish Narayanan (hnarayanan) said :
#9

Johannes: It does now!

Revision history for this message
Johannes Ring (johannr) said :
#10

Great!

Revision history for this message
Murtazo Nazarov (murtazo) said :
#11

Johannes: Yes, it works now!

Thanks!