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

Lazily initialize RAPL wraparound monitor processes #121

Open
jaywonchung opened this issue Sep 10, 2024 · 1 comment
Open

Lazily initialize RAPL wraparound monitor processes #121

jaywonchung opened this issue Sep 10, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jaywonchung
Copy link
Member

Currently, whenever get_cpus is called, it will instantiate a RAPLFile for every CPU/DRAM domain, which will in turn spawn a wraparound monitor process. However, the user may not intend to use RAPL anyway, which makes the processes poll RAPL for nothing.

One good way is to start those processes lazily, meaning that starting the wraparound monitor processes is deferred as much as possible.
That is, only when RAPL metrics are actually needed (e.g., ZeusMonitor that tracks a non-empty cpu_indices calls begin_window), the processes will be spawned only then.

@wbjin WDYT?

@jaywonchung jaywonchung added enhancement New feature or request good first issue Good for newcomers labels Sep 10, 2024
@wbjin
Copy link
Collaborator

wbjin commented Sep 10, 2024

I agree, we could wait until the very first read() on a RAPLFile to start the monitoring process. I think we could do something like this
Initialize self.wraparound_tracker = None.
In read() initialize RaplWraparoundTracker if self.wraparound_tracker == None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants