gpt4 book ai didi

psutil - Snakemake中基准变量的含义

转载 作者:行者123 更新时间:2023-12-02 04:12:00 27 4
gpt4 key购买 nike

我在我的 Snakemake 工作流程中包含了一些规则的 benchmark 指令,生成的文件具有以下 header :

s   h:m:s   max_rss max_vms max_uss max_pss io_in   io_out  mean_load

The only documentation I've found提到“基准 txt 文件(其中包含一个以制表符分隔的运行时间和 MiB 内存使用情况表)”。

我可以猜测第 1 列和第 2 列是显示执行规则所需时间的两种不同方式(以秒为单位,并转换为小时、分钟和秒)。

io_inio_out 可能与磁盘读写事件有关,但它们以什么单位进行测量?

其他的是什么?这是否记录在某处?

编辑:查看源代码

我在 /snakemake/benchmark.py 中找到了以下代码段,这很可能是基准数据的来源:

def _update_record(self):
"""Perform the actual measurement"""
# Memory measurements
rss, vms, uss, pss = 0, 0, 0, 0
# I/O measurements
io_in, io_out = 0, 0
# CPU seconds
cpu_seconds = 0
# Iterate over process and all children
try:
main = psutil.Process(self.pid)
this_time = time.time()
for proc in chain((main,), main.children(recursive=True)):
meminfo = proc.memory_full_info()
rss += meminfo.rss
vms += meminfo.vms
uss += meminfo.uss
pss += meminfo.pss
ioinfo = proc.io_counters()
io_in += ioinfo.read_bytes
io_out += ioinfo.write_bytes
if self.bench_record.prev_time:
cpu_seconds += proc.cpu_percent() / 100 * (
this_time - self.bench_record.prev_time)
self.bench_record.prev_time = this_time
if not self.bench_record.first_time:
self.bench_record.prev_time = this_time
rss /= 1024 * 1024
vms /= 1024 * 1024
uss /= 1024 * 1024
pss /= 1024 * 1024
io_in /= 1024 * 1024
io_out /= 1024 * 1024
except psutil.Error as e:
return
# Update benchmark record's RSS and VMS
self.bench_record.max_rss = max(self.bench_record.max_rss or 0, rss)
self.bench_record.max_vms = max(self.bench_record.max_vms or 0, vms)
self.bench_record.max_uss = max(self.bench_record.max_uss or 0, uss)
self.bench_record.max_pss = max(self.bench_record.max_pss or 0, pss)
self.bench_record.io_in = io_in
self.bench_record.io_out = io_out
self.bench_record.cpu_seconds += cpu_seconds

所以这似乎来自 psutil 提供的功能.

最佳答案

我将把它留在这里以供将来引用。

通读

如前所述:

<表类=“s-表”><标题>colname类型(单位)描述 <正文>s float (秒)运行时间(以秒为单位)时:分:秒字符串 (-)以小时、分钟、秒格式显示的运行时间max_rss float (MB)最大“驻留集大小”,这是进程已使用的非交换物理内存。最大虚拟机数 float (MB)最大“虚拟内存大小”,这是进程使用的虚拟内存总量最大uss float (MB)“Unique Set Size”,这是进程独有的内存,如果进程立即终止,该内存将被释放。最大pss float (MB)“比例集大小”是与其他进程共享的内存量,以在共享内存的进程之间平均分配内存量的方式进行计算(仅限 Linux)io_in float (MB)读取的 MB 数(累计)。io_out float (MB)写入的 MB 数(累计)。平均负载 float (-)一段时间内的 CPU 使用率除以总运行时间(第一行)CPU_时间 float (-)用户和系统的CPU时间总和

关于psutil - Snakemake中基准变量的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46813371/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com