如何计算flops

这里FLOPs (FLoating-point Operations Per Second)是衡量浮点性能的常用单位,即每秒做的浮点运算次数。它常被用来估算电脑的执行效能,尤其是在使用到大量浮点运算的科学计算领域中。

  • cpu个数计算

CPUs = (Threads per core) x (cores per socket) (sockets​​​​​​​)

即cpu数目与节点数、核数和单核的线程数有关。详见关于节点数和核数的定义。linux系统中这三个指标可通过如下命令查询。

lscpu | grep -E '^Thread|^Core|^Socket|^CPU\('

CPU(s):                40
Thread(s) per core:    2
Core(s) per socket:    10
Socket(s):             2
  • flops计算

performance in GFlops = (CPU speed in GHz) x (CPU instruction per cycle) x (number of CPU cores) x  (number of CPUs per node)

  • multithread vs hyperthread

多线程是在一个cpu核上运行的软件处理技术,需要cpu完成线程之间的调度工作。超线程是在一个cpu核上虚拟出多个cpu核的硬件处理技术,每个虚拟核都是独立的运行单元(processor),查看processor的命令为 ‘cat /proc/cpuinfo’。

图片来自 这里

 

参考文献:

  1. http://www.novatte.com/our-blog/197-how-to-calculate-peak-theoretical-performance-of-a-cpu-based-hpc-system
  2. basic definition: node, socket, core
  3. CPU Basics: Multiple CPUs, Cores, and Hyper-Threading Explained
  4. How to know number of cores of a system in Linux?
  5. How to calculate peak theoretical performance of a CPU-based HPC system?

  6. 计算能力​​​​​​​
  7. What Are Threads in a Processor?

  8. What is hyper-threading? How does it different from multithreading?

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值