如何从系统监控程序中捕获CPU核心使用情况?
我有一个使用并行 python 运行的 python 程序。该模块将我提交给计算机各个核心的作业进行扩展,我不知道它是如何做到的,但当我检查系统监视器时,它清楚地显示两个核心的使用率均为 100%(我正在运行一些非常繁重的作业)。
是否有任何 python 模块或工具可以让我在运行作业时从系统监控程序捕获各个核心的使用情况?
I have a python program running using a parallel python. This module scales my job submitted to individual cores of my computer , I don't know how does it do it but when i check my system monitor it clearly shows 100% usage in both the cores (I am running some really heavy jobs).
Is there any python module or tool which allows me to capture the individual core usage from the system monitor program when I run my job?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
psutil:
psutil:
因此,如果您有办法调用系统监视器将核心使用情况写入标准输出,您始终可以执行以下操作:
您可以阅读
subprocess
的工作原理 此处。So if you have a way to call the system monitor to write the core usage to stdout, you can always do something like this:
You can read up on how
subprocess
works here.