SEARCH
TOOLBOX
LANGUAGES
ProfileVisitor

ProfileVisitor

From SOFAWiki

Jump to: navigation, search

Trace and Profiling Visitors

You can Trace and Profile the Visitors, components, methods execution within SOFA. To enable this option, you must compile SOFA with SOFA_DUMP_VISITOR_INFO defined in the compilation flags.

This option is enabled by default in your local configuration file. Image:Profiling.png

  • Meaning of the colors:
    • blue: Visitor
    • purple: Component
    • gray: Node
    • yellow: Comment

How to use it

The Visitors, and Components triggered by the visitors are automatically traced, and profiled.

To print a comment, add in your code:

simulation::Visitor::printComment("You Comment");

To trace and profile the execution of a part of your program, put, at the beginning of the code to profile:

simulation::Visitor::printNode("NameMethod");

and at end the process

simulation::Visitor::printCloseNode("NameMethod");

The method printNode can take other arguments to get a more detailed log; please refer to its API in the file modules/sofa/simulation/common/Visitor.h