[dune-fem] Fem timer

Agnese, Marco m.agnese13 at imperial.ac.uk
Wed Apr 15 19:37:01 CEST 2015


Ok it worked ;)

I will update a little the documentation of the timer.

Thank you Tobias,
Cheers,
Marco.
________________________________________
From: Tobias Malkmus [tomalk at mathematik.uni-freiburg.de]
Sent: Wednesday, April 15, 2015 4:28 PM
To: Agnese, Marco; dune-fem at dune-project.org
Subject: Re: [dune-fem] Fem timer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Marco

Your code should look like:

/* Begin */
#define FEMTIMER
#include <config>

#include <dune/fem/misc/femtimer.hh>

int main ()
{
unsigned int id =
FemTimer::addTo( "Compute timer",1);
FemTimer::start(id);

// do something

FemTimer::stop(id);
FemTimer::print(std::cout);

/* End */
}

The femtimer is itself is a singleton.
You can also set the macro FEMTIMER within the makefiles, this ensures
that it is defined within each included header, which seems not to be
the case, otherwise the complier should complain about the private
default constructor FemTimer femtimer();

Best Tobias

On 04/15/2015 05:16 PM, Andreas Dedner wrote:
> Hi Perhaps you could provide a small demo cc file? Andreas
>
>
> On 15/04/15 16:05, Agnese, Marco wrote:
>> Hi Tobias,
>>
>> I have
>>
>> #define FEMTIMER 1
>>
>> at the beginning of my code.
>>
>> I don't understand why the print() doesn't output anything.
>>
>> Cheers, Marco. ________________________________________ From:
>> Tobias Malkmus [tomalk at mathematik.uni-freiburg.de] Sent:
>> Wednesday, April 15, 2015 3:46 PM To: Agnese, Marco;
>> dune-fem at dune-project.org Subject: Re: [dune-fem] Fem timer
>>
> Hi Marco
>
> The FemTimer is deactivated by default, you can enable it by
> defining the macro FEMTIMER.
>
> Best Tobias
>
> On 04/15/2015 03:42 PM, Agnese, Marco wrote:
>>>> Hi, I am trying to use the FemTimer without success.
>>>>
>>>> My code is something like
>>>>
>>>> FemTimer femTimer; const unsigned int
>>>> timerID(femTimer.addTo("Compute timer",1));
>>>> femTimer.start(timerID);
>>>>
>>>> femTimer.start(timerID,1); // do something
>>>> femTimer.stop(timerID,1);
>>>>
>>>> femTimer.stop(timerID); femTimer.print(std::cout);
>>>> femTimer.reset(timerID);
>>>>
>>>> It compiles correctly but, when I run the code, I don't see
>>>> any FemTimer output on my terminal. What am I doing wrong?
>>>>
>>>> Thank you very much, regards, Marco.
>>>> _______________________________________________ dune-fem
>>>> mailing list dune-fem at dune-project.org
>>>> http://lists.dune-project.org/mailman/listinfo/dune-fem
>>>>
>
>>
>> _______________________________________________ dune-fem mailing
>> list dune-fem at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune-fem
>
>
> _______________________________________________ dune-fem mailing
> list dune-fem at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-fem
>
>

- --
Tobias Malkmus                 <tomalk at mathematik.uni-freiburg.de>

Mathematisches Institut               Tel: +49 761 203 5627
Abt. für Angewandte Mathematik        Universität Freiburg
Hermann-Herder-Str. 10
79104 Freiburg

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJVLoOLAAoJEBMY7DHvcWNgExcH/19ZJ7JJHnSgndlJ9H2Vvo9c
uRIyXtCfhalvuzgkw7JhYgiaWBIwFpOl571LJojrMPpmgH7c1KPDbHQZfkQMporz
4co4JWS6ZYDDvqX4fyaoX/oJF7YrLajfG9ulSJzsBhU0m9WwYtfaPEs42mQqXs5l
pDXAcYY8I6LIqC46QQjTCT/zHMg7pdPUO0Iwu133GNQ9ED1DJIkpmeqCjsQsrOKh
wiNuklSdneM1llbymLepOnKYdDbxTcgp6KYWyXmdWkohDsZKyRAjNoXLlXmFmsJ3
x9oW/r6mhZ1EZsq9nHNyftVX+V7Wzb50hWkGlx/aHeRAxs/KDwz0apU15K41ajA=
=VgVU
-----END PGP SIGNATURE-----




More information about the dune-fem mailing list