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

benchmark non-python programs #35

Open
Pzoom522 opened this issue Nov 21, 2020 · 4 comments
Open

benchmark non-python programs #35

Pzoom522 opened this issue Nov 21, 2020 · 4 comments
Assignees

Comments

@Pzoom522
Copy link

Hi, thanks for this great project! I'm wondering whether it's possible to track the usage of non-python programs, e.g., C++ code? And how?

@Pzoom522
Copy link
Author

Pzoom522 commented Nov 22, 2020

I've found out that this can be done by simply writing a wrapper using os.system(). Close for now.

@cifkao
Copy link

cifkao commented Nov 24, 2020

I would vote for reopening this issue because I'm sure there are other people wanting to do the same thing (like me). A command-line wrapper would indeed be very handy. @Pzoom522 maybe you can share your wrapper or contribute it to the repo?

@Pzoom522 Pzoom522 reopened this Nov 24, 2020
@Pzoom522
Copy link
Author

I would vote for reopening this issue because I'm sure there are other people wanting to do the same thing (like me). A command-line wrapper would indeed be very handy. @Pzoom522 maybe you can share your wrapper or contribute it to the repo?

Surely I will. I will put my workaround here later this week.

@Pzoom522
Copy link
Author

@cifkao Basically, I found that this tool is tracking the usage of everything the main program initialises until the main program terminates. Therefore, I chose to directly start a non-python process using os.system(), as it will wait for the returned value of the command. I benchmarked some computationally expensive C programs with the following simple wrapper and got reasonable results.

import os
from experiment_impact_tracker.compute_tracker import ImpactTracker
tracker = ImpactTracker(<your log directory here>)
tracker.launch_impact_monitor()
os.system(<your command here>)

Dear maintainers, please let me know if this workaround is correct, so I can make a pull request.

@Breakend Breakend self-assigned this Jan 2, 2021
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

No branches or pull requests

3 participants