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

GafferModule : Windows verifyAllocator() #6087

Merged
merged 1 commit into from
Oct 15, 2024

Conversation

ericmehl
Copy link
Collaborator

This adds a check on Windows when starting Gaffer to verify that the TBB allocator has been installed correctly. Other platforms don't perform the check and the check method is not present.

I don't actually know what circumstances the allocator would fail to install itself. If I just remove the tbbmalloc_proxy.dll file from the installation, Gaffer immediately and silently fails to open at all.

But I think this is still worthwhile as an easy box to check off when debugging performance problems.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

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

Thanks Eric - LGTM, nitpicking about log levels aside.

Comment on lines 205 to 209
IECore::msg( IECore::Msg::Debug, "Gaffer", "Failed to install TBB memory allocator. Performance may be degraded." );
for( char **logEntry = replacementLog; *logEntry != 0; logEntry++ )
{
IECore::msg( IECore::Msg::Info, "Gaffer", *logEntry );
}
Copy link
Member

Choose a reason for hiding this comment

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

Seems a bit odd that the primary message ("Failed to install") is given a lower log level than the detailed messages. Perhaps WARNING for the first, and DEBUG for the others, or even warning for all? Now I think about it, it does seem worth having whatever we print be visible at the default logging level, since we definitely don't expect or want this to fail.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed, more visibility if it fails does sound good. I changed it to WARNING in 1edd800 and squashed down.

@ericmehl
Copy link
Collaborator Author

Thanks John! I did a rebase and squash after changing the log level to WARNING. Should be good to go.

@johnhaddon johnhaddon merged commit 29bd8ae into GafferHQ:main Oct 15, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants