使用超线程运行仿真使运行时间加倍 [英] Running simulation with hyperthreading doubles runtime

查看:151
本文介绍了使用超线程运行仿真使运行时间加倍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用用python/numpy/cython编写的模拟. 由于我需要对许多模拟运行进行平均,因此我使用多处理模块来批量运行所有单个模拟运行.

I use a simulation written in python/numpy/cython. Since i need to average over many simulation runs i use the multiprocessing module to run all the individual simulation runs in batches.

在办公室,我有一个带HT的i7-920工作站.在家里,我有没有i5-560. 我以为我可以在办公室中的每个批次中运行两倍数量的模拟实例,并将运行时间减少一半.令人惊讶的是,每个实例的运行时间比我的家庭工作站所花费的时间增加了一倍.这样,在家里并行运行3个模拟实例将花费8分钟,而在办公室运行6个实例则花费大约15分钟.我使用'cat/proc/cpuinfo'验证了'siblings'= 8,'cpu cores'= 4,因此启用了HT.

At the office i have an i7-920 workstation with HT. At home i have an i5-560 without. I thought i could run twice as many instances of the simulation in each batch in the office and cut my running time in half. Surprisingly, the run time of each individual instance was doubled compared to the time it take on my home workstation. That it, running 3 simulation instances in parallel at home would take, say 8 minutes, while running 6 instances at the office take about 15 minutes. Using 'cat /proc/cpuinfo' i verified 'siblings' = 8 and 'cpu cores' = 4, so HT is enabled.

我不知道任何节约总运行时间"的法则(尽管从科学的角度来看,这可能很有趣:)),跳到这里的人也许可以弄清楚这个难题.

I am not aware of any "conservation of total runtime" law (though from s scientific point of view it could quite interesting :) ), and hopping someone here might shed some light on this conundrum.

推荐答案

也许上下文切换会产生更多的开销,这是由6个大量计算过程和4个实际内核造成的.如果这些进程争用CPU资源,则它们可能会使用效率低下的CPU缓存.

Maybe the context switches produce more overhead, caused by 6 massivly calculating processes and only 4 real cores. If the processes compete for the cpu-ressources, they may use inefficient the cpu-caches.

如果仅启用4核而不是6核,结果如何?

If you only enable 4 instead of 6 core, what's the result?

这篇关于使用超线程运行仿真使运行时间加倍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆