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

Refactor MemoryProfiler #356

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cniethammer
Copy link
Contributor

Refactored the MemoryProfiler code replacing C file I/O and string parsing with C++ streams and regex. Look for environment variables only once.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • Unittests

Refactored the MemoryProfiler code replacing C file I/O and string parsing
with C++ streams and regex. Look for environment variables only once.

Signed-off-by: Christoph Niethammer <[email protected]>
@cniethammer cniethammer added the clean-up related to the clean-up of the code and tech dept label Dec 7, 2024
@cniethammer cniethammer requested a review from HomesGH December 7, 2024 22:24
Copy link
Contributor

@HomesGH HomesGH left a comment

Choose a reason for hiding this comment

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

Nice effort to modernize the plugin!
Just some comments:

  1. Checks if files exist/error handling of input
  2. More comments in the code would be beneficial
  3. Test not only with unit tests but also run a real simulation and compare the result with the previous implementation
  4. Keep in mind that std::regex might be slower compared to the previous solution

#include "sys/sysinfo.h"

#ifndef _SX
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the preprocessor macro _SX? I cannot find any definition in our code base or online.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This preprocessor macro is specific to NEC platforms which do not run standard unix/linux like the https://en.wikipedia.org/wiki/NEC_SX-Aurora_TSUBASA.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for the clarification 👍 Does anybody still use ls1 on those machines or is it just legacy?

src/io/MemoryProfiler.cpp Show resolved Hide resolved
src/io/MemoryProfiler.cpp Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean-up related to the clean-up of the code and tech dept
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants