Skip to content
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

Improved compilation time of WBToolbox blocks by optimizing Blockinitialization() #190

Conversation

nunoguedelha
Copy link
Collaborator

@nunoguedelha nunoguedelha commented Jun 15, 2020

This is related to #189. Refer to those issues for full details.

Improved compilation time of WBToolbox blocks by optimizing Blockinitialization() code:

  • In Blockinitialization() current implementation, we first retrieve the list of all the WBT
    blocks in the model. Then we look for the closest Config block, starting from the block's
    scope, and going up in the tree.
  • The optimization consisted in retrieving only the Config blocks (name under mask is ImConfig)
    instead of the full list. the reduced list is enough for the second regexp, when looking for
    the closest Config, since only the lines containing ImConfig are supposed to match the regexp.
  • This change is compatible with the support of multi-config models.

@nunoguedelha nunoguedelha marked this pull request as draft June 15, 2020 15:32
@traversaro
Copy link
Member

Why "Draft"?

@nunoguedelha
Copy link
Collaborator Author

I was still building superbuild with the changes. Although I know that the changed file is simply copied to the install folder, I wanted to have that check end to end, building, then running a compilation under Matlab.
But I'm having issues building the superbuild because of my recent update of homebrew I think.

Anyway we can move the PR to ready now, since it's a trivial change.

@nunoguedelha nunoguedelha marked this pull request as ready for review June 15, 2020 15:57
Copy link
Member

@diegoferigo diegoferigo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nunoguedelha for fixing this problem, it has a huge impact on the workflow of so many people!

Meanwhile I try to figure out what's happening with CI, I ask you if you can remove the link to the private repo you added in the description of the commit (also in the PR description). Thanks!

@nunoguedelha
Copy link
Collaborator Author

Well, great team work with all of you! And thx @Giulero for the stats on the code lines.

@diegoferigo I'll push force a commit to remove the reference you mentioned.

…kinitialization()` code.

- Refer to robotology#189 for full details.
- In `Blockinitialization()` current implementation, we first retrieve the list of all the WBT
  blocks in the model. Then we look for the closest Config block, starting from the block's
  scope, and going up in the tree.
- The optimization consisted in retrieving only the Config blocks (name under mask is `ImConfig`)
  instead of the full list. the reduced list is enough for the second regexp, when looking for
  the closest Config, since only the lines containing `ImConfig` are supposed to match the regexp.
- This change is compatible with the support of multi-config models.
@nunoguedelha nunoguedelha force-pushed the feature/improve-wbt-blocks-initialisation-during-compilation branch from 71b0674 to 771c7f8 Compare June 16, 2020 07:39
@diegoferigo diegoferigo changed the base branch from devel to master June 16, 2020 09:01
@diegoferigo diegoferigo merged commit d6c755c into robotology:master Jun 16, 2020
@diegoferigo
Copy link
Member

Merged into master and aligned devel.

@nunoguedelha
Copy link
Collaborator Author

CC @gabrielenava

@nunoguedelha nunoguedelha deleted the feature/improve-wbt-blocks-initialisation-during-compilation branch June 22, 2020 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize BlockInitialization MATLAB function to reduce model compilation time
3 participants