-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GUI] Improve advanced timer #468
[GUI] Improve advanced timer #468
Conversation
Thank you for your pull request! |
@@ -185,7 +185,7 @@ int main(int argc, char** argv) | |||
bool noAutoloadPlugins = false; | |||
int nbIterations = BatchGUI::DEFAULT_NUMBER_OF_ITERATIONS; | |||
unsigned int nbMSSASamples = 1; | |||
unsigned computationTimeSampling=0; ///< Frequency of display of the computation time statistics, in number of animation steps. 0 means never. | |||
int computationTimeSampling=0; ///< Frequency of display of the computation time statistics, in number of animation steps. 0 means never. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the computationTimeSampling variable negative ?
I can't find it
Hello, Thank for the PR. The added feature is nice and should be merged but the way it hack the command line by allowing "-2" is very confusing. Why not doing: Only for the init functions: For the init function and for every second step: It would clearly separate the concerns instead of encoding different behavior in the same variable. |
Thank you Damien for the important remark considering "-2", I was not aware of this problem. I will look into further details tomorrow. |
sofa::helper::AdvancedTimer::setEnabled("Init", true); | ||
sofa::helper::AdvancedTimer::setInterval("Init", 1); | ||
sofa::helper::AdvancedTimer::setOutputType("Init", computationTimeOutputType); | ||
sofa::helper::AdvancedTimer::begin("Init"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a duplicated begin("Init") here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a bug in the advanced timer (variable initialization at -1 instead of 0), that I just removed. Should be fine but it is good if that is double checked.
@chrijopa could you take some time to progress on this ? this is open for a long time |
[ci-build] |
applications/sofa/gui/BatchGUI.cpp
Outdated
std::cout << "Computing "<<nbIter<<" iterations." << std::endl; | ||
sofa::helper::AdvancedTimer::begin("Animate"); | ||
sofa::helper::AdvancedTimer::end("Animate"); | ||
sofa::helper::AdvancedTimer::begin("Animate"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrijopa: Why begin then end immediately?
applications/sofa/gui/BatchGUI.cpp
Outdated
sofa::simulation::getSimulation()->animate(groot.get()); | ||
std::cout << sofa::helper::AdvancedTimer::end("Animate", groot.get()) << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use msg_info
instead of std::cout
sofa::simulation::getSimulation()->init(groot.get()); | ||
if( computationTimeAtBegin ) | ||
{ | ||
std::cout << sofa::helper::AdvancedTimer::end("Init", groot.get()) << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use msg_info
instead of std::cout
…putationTimeSampling # Conflicts: # applications/projects/runSofa/Main.cpp # applications/sofa/gui/BatchGUI.cpp
[ci-build] |
[ci-build] |
@ErwanDouaille could you check (very shortly) the API of argument parser in this PR please? we would like to integrate it in v17.12 release ;) |
[ci-build][with-scene-tests] |
@hugtalbot I didn't test it but the argument parser stuff looks good to me. I would suggest to not define b/o characters because, AFAIK, advance timer is not often used so maybe there is better use of b/o character. |
This pull request allows the usage of the advanced timer
runSofa -c 1
runSofa -c 0
runSofa -c -2
Moreover, the usage of the advanced timer in batch mode works again:
runSofa -c -2 -g batch -n 10
Fixes #357
This PR:
Reviewers will merge only if all these checks are true.