How do I write the runtime for each part of the simulation to file?

+1 vote
69 views
asked Oct 23, 2017 by J-H Plank (440 points)
retagged Oct 23, 2017 by J-H Plank

Dear all,

I'm using the Chaste Heart. Using the member functions Heading and Report of the HeartEventHandler it is possible to write the specific time used for each part of the simulation to the console. Is there an easy way to write the output into a file in the output directory?

Thanks a lot for any answers!

Jan-Hendrik

Remark: This question was asked to the mailing list before (20.10.2017 "Some questions concerning using Chaste Heart")

1 Answer

0 votes
answered Oct 23, 2017 by GaryM (940 points)

At the moment the GenericEventHandler (which implements the HeartEventHandler printing) is hardcoded to write to std::cout (see https://chaste.cs.ox.ac.uk/trac/browser/git_repo/global/src/timing/GenericEventHandler.hpp#L334 for the source code that does this).

If this is something you would like, then it might be worth opening a ticket on our trac ticket system: https://chaste.cs.ox.ac.uk/trac/timeline

If you would just like total run time of parts of your code, you can use the Timer class https://chaste.cs.ox.ac.uk/public-docs/classTimer.html with methods Reset and GetElapsedTime around blocks you want to time and write these to file 'manually'.

commented Nov 8, 2017 by J-H Plank (440 points)

Thanks a lot for your answer. Since it is not really a bigger problem I will probably not open ticket.

Welcome to Chaste Q&A, where you can ask questions and receive answers from other members of the community of Chaste developers and users.

See the Chaste wiki for installation instructions, guides and tutorials.

...