Questions tagged «cray»

9
如何从C程序获取100%CPU使用率
这是一个非常有趣的问题,所以让我开始讨论。我在国家计算机博物馆工作,我们刚刚设法让一台Cray Y-MP EL超级计算机从1992年开始运行,我们真的很想知道它能走多快! 我们认为最好的方法是编写一个简单的C程序,该程序将计算质数并显示执行此操作需要多长时间,然后在快速的现代台式PC上运行该程序并比较结果。 我们很快想出了以下代码来计算质数: #include <stdio.h> #include <time.h> void main() { clock_t start, end; double runTime; start = clock(); int i, num = 1, primes = 0; while (num <= 1000) { i = 2; while (i <= num) { if(num % i == 0) break; i++; } if …
79 c  windows  linux  performance  cray 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.