国外网友对我天河-1A成为世界最快计算机的评论

 

某国外的网友贴出了这样一则消息(http://tech.slashdot.org/story/10/10/28/1220247/China-Makes-Worlds-Fastest-Supercomputer):


"China has replaced the United States as the maker of the world's fastest supercomputer. A Chinese research center has made the world's faster super computer — named as Tianhe-1A, which was released at a national conference on high-performance computers (HPC) in China. Made at a cost of over $88 million, Tianhe-1A is theoretically able to do more than 1 quadrillion calculations per second (one petaflop) at peak speed. Tianhe-1A 's peak performance reaches 1.206 petaflops, and it runs at 563.1 teraflops (1,000 teraflops is equal to one petaflop) on the Linpack benchmark."


其他外国网友们的回复,很有意思(【】中是我的点评):

 

  1. But does it run (Red Flag) Linux? 【虽然我也不知道是不是跑得红旗“国产操作系统”,但这位哥们竟然知道Red Flag Linux的存在,“核高基”的那群砖家叫兽们还不得内牛满面?】
  2. China: "We made the fastest super-computer!!!"   Intel and NVidia: "Uh - no you didn't, We are own all your processors!!!"  【我也这么认为】
  3. Yeah, lets borrow more money from the Chinese Government so we can build a useless supercomputer to outdo them - just to say we did it! Thanks, grandkids! 【看来景德镇政府这个土大款声名远播了
  4. Sadly, China needed to build this computer simply to calculate the interest on the US debt in realtime. 【这哥们肯定是美国人】
  5. Competitive in what, exactly? We have many supercomputers in the USA; we have no idea what to do with them, though, and many of them are spending a lot of time idle. Some supercomputers are now being rented out to investors, because the people the computers were built for -- the scientists -- are not using enough computer time. 【美国的HPC真的多的用不了了?貌似不是吧……模拟一次军事演习或者核爆,就需要N多HPC。不过这哥们的评论要是把USA改成景德镇,那倒是无可争辩的事实——想想研究生期间实验室里闲置了好几年的好几台IBM服务器,买了之后就没人动过它们……】
  6. What we really need to do is look at the state of research in this country.【这句话说到点子上了。】 Also, maybe if we had a more solid economic base, one in which we solve the trade imbalance by exporting real goods rather than copyrights, we could spend more money on science and supercomputing. Oh well, in your words, "who am I kidding?" 【这句话就说明上段评论是酸葡萄心理了。】

     

  7. Oh my. When have I heard this before? Oh yes, back in the 1980s when there was panic and hyperbole over Japan, Inc. overtaking the USA in everything. How did that pan out exactly? I don't see how the current situation with China is any different. 【严重同意这位美国哥们的观点】
  8. 另一哥们对上条评论的回复:
  9. China is way different from Japan. For starters, it has resources, and it can play the game any way it wants to. Japan could only play hardball (采取强硬态度) economically. China can at any time choose to overrun Korea and Taiwan at any time if they choose to, and the only recourse would either be a hard fought conventional war, or a nuclear exchange. 

    China can fight dirty(下黑手). Japan cannot. And China is good at fighting dirty, because they "won" two wars (Korea and Vietnam) by proxy, sending in men and materials to do what the native population couldn't. If China chose to, they could easily turn up the heat in other areas hostile to the US by sending in troops and munitions. China could hand Iran the tools to seize control of the Strait of Hormuz and there would be nothing the US could do about it except engage in another theater of war which would be unwinnable. 【看来这哥们对景德镇政府的成见很深啊】

     

  10. 一哥们回复说把这世界上“最牛逼”的超级电脑装在世界上“最牛逼”的和谐号上会如何?
  11. Would there be a benefit to putting the fastest computer in the fastest train?

    Hmmm.... if the train was going fast enough for relativistic effects to kick in, then this would make the computer *even faster*. You, sir / ma'am, are brilliant! 【这哥们的回答很无厘头】

     

  12. Finally they will be able to computerize the national census procedures.【直接怀疑这哥们是间谍,竟然连我景德镇人口普查的具体方式都了若指掌——在2010年的今天,还让街道大妈挨家挨户拿着表格手工填…… 不过这哥们应该还是不了解我景德镇的镇情,如此一来解决了多少社会闲散人员的就业,拉动了多少内需,满足了多少文革遗老遗少(街道的那些人)的虚荣心,加强了多少社会的和谐啊!】
  13. Supercomputing is largely a solved problem...do a regression analysis on the variables on the Top 500 sometime. Primarily it's a function of the number of cores. I've told people in my own workplace - you want a machine on the Top 500 then write me a cheque - making a supercomputer isn't the feat of skill or engineering that it was in the days of Cray. This doesn't even touch on what the hell you use these things for the problem space for parallel processing is clearly smaller than that of serial processing. Add to that the assertion that the number of useful applications drops off steeply as you add more cores (at some point you are left with only the "embarrassingly parallel" ones) and creating the largest supercomputer in the world is akin to saying you are creating the least useful computer in the world. Not to mention probably one of the least power efficient, highest maintenance costs, etc.. 【我相信这哥们说的是事实】
  14. we went to the moon during a period of nationalist chest thumping, and when the nationalist chest thumping subsided, we haven't been back. countries that are interested in nationalist chest thumping: china, india, etc, are still pumping up their space programs

    what i am saying is, for all the evils of nationalism, scientific advancement in the realm of large projects seems to be a positive byproduct【至理名言啊!自建镇以来,我景德镇的所有的重大科技成果,那个不是副产品?记得大学期间,一位东南大学的老教授去给我们做讲座,回忆起当年许世友主政南京军区时,逼着他们在极端恶劣的环境下没日没夜的搞永动机,老教授唏嘘不已……】

    for example, if we were still in a cold war with the ussr in the 1990s, i will bet you anything that this would have been completed and would be producing amazing science at this point in time:http://en.wikipedia.org/wiki/Superconducting_Super_Collider [wikipedia.org] 【在我景德镇,这种例子俯拾皆是】

     

  15. There is absolutely no consistency in numbers in this story. Some measurements show this computer to be about 45% slower than the Cray XT5 and some show it to be faster. Given China's history of arbitrarily throwing out numbers to try to prop themselves up in the international community I cannot accept this as fact without some sort of independent verification. If China has in fact created the worlds fastest supercomputer, I congratulate them on a job well done. But I am still skeptical about this story. Sounds like my government (US) is just looking for an excuse to spend billions more on a new supercomputer. 【兄弟,别说你一老美,连我一景德镇居民都不信!老外都知道我景德镇的浮夸之风了。】

对于天河-1A是否是世界上最快的计算机,我不敢妄下结论,但可以肯定的是,天河-1A肯定是比上一代取得不小进步的,因此向工作在这个项目上的最底层的同志们致敬,道一声“你们辛苦了!” 活永远是你们这些基层人的来干,油水永远是领导们捞,功劳和荣耀永远是属于领导的,出了问题责任永远是你们的——这是景德镇的传统。

Chrome 8 进程的疑惑

最近一直习惯用Chrome打开多个网页,时间一长,就发现硬盘一直在高速旋转。一开始以为是公司的监控软件的原因,就忍了。知道今天早上,电脑持续很长时间的没反应之后,弹出对话框说某个plug-in一直在运行……当时只有Chrome浏览器在工作,这个plugin只可能是Chrome的…… 关掉chrome后,硬盘还是高速旋转,打开任务管理器,发现还是有很多chrome进程在运行,很明显这些是跑飞了的chrome进程了。

 

杀死所有chrome残留进程之后,我重新打开chrome浏览器,打开几个tab,对比Windows任务管理器、chrome任务管理器,发现了一些有趣的现象:

 

Chrome运行时截图

 

Windows任务管理器中的Chrome进程

 

Chrome任务管理器中的Chrome进程

 

可以看出:

  1. Chrome任务管理器中所耗内存的数值比Windows任务管理器中显示的要小很多;
  2. 实际打开了8个Tab,在Chrome任务管理器中却有12个;
  3. Chrome任务管理器显示有17个Chrome进程,而Windows任务管理器却显示有18个Chrome进程。

等将来有时间时,好好研究一下这些问题。

-----------------------------------------------------------------------------------------------------------

Update: 2010-100-26

 

Chrome 8 dev升级到8.0.552.11已经有一段时间了,虽说该升级版本已经修复了一些Chrome进程僵死的bug,但运行时间一长,该问题还是会出现的。

 

手机引发的思维定势

早晨你一睁眼,发现早已天光大亮,不禁疑惑为什么手机的闹钟没有响。爬起来打开手机一看,满屏八糟的英文字母——Oh, my god,你的手机怎么了?!凭着自己几年程序员的经验,匆匆瞥一眼最后一行的提示,按下<Home>键,满屏的英文字母变成了一个巨大的惊叹号,然后就无论你怎么操作都不再有反应了……病毒?系统崩溃?还是硬件错误?

你略加思索,然后打开手机后盖,拆掉电池然后重新装上,开机,终于等来了久违的“HTC”这三个字母。你沾沾自喜,大多数软件问题都可以通过重启系统解决……“HTC”这三个字母很快就变成了Sprint的开机动画——你的手机是水货,Sprint定制的HTC的EVDO Android手机​——当你的信息更加坚定之时,突然手机左上角的提示等闪了两下,整个屏幕黑暗了……

你重新开机,重新看到HTC,重新看到Sprint,这次还看到了Android的小机器人,你开始紧张,左上角的红灯又闪了两下,屏幕再次变暗……反复几次,重启并没有解决问题……OMG,花几千块钱刚买了不到一年的手机竟然无法开机!你抓狂了……

中秋那天你陪你老婆去天安门看巨型牡丹,拍照时你那素有“破坏之王”美誉的老婆把你的手机摔了一下——一下摔倒了手机的右下角和右上角——感谢毛爷爷,你的手机捡起来还能继续用。是的,是能用的,因为昨天晚上你还用它给你妈妈打电话。但会不会是因为摔了那一下把某个芯片的焊点摔松了,尽管当时能work,时间一长就脱焊了?很有可能。

不管是不是硬件的问题,你都得先试试通过软件能不能修复——这也是你唯一有可能控制的东西。你想按一下<Reset>回复到出厂设置,但你又担心这样一来不仅删除了所有已经保存的信息,而且由于中美CDMA手机之间的差异,这手机必须得破解、写号之后才能用,而这,是非常恐怖的事情……好在你终于还是无法找到那个<Reset>小孔,否则你很难保证能战胜心中按下它的欲望。

看来这手机只能慢慢修了。可是你最近又非常忙,忙工作,忙自己的事情,根本没时间也没心情去搞一部坏了的手机。即使有了时间有了心情,你对于Android只有一个肤浅的认识,怎么进入debug模式都不知道,又谈何修复?于是你的头越来越大……

好在还有去年的一部旧手机可以用,虽说破了点,但能打电话,将就一下吧。你翻箱倒柜把它找出来,插上卡,开机,果然还能用。

你稍稍冷静了一下,边洗脸刷牙边考虑接下买什么手机……HTC的?算了,坏了的这个就是HTC质量的写照,本来去年就是本着支持国产(虽说HTC是台湾的企业,但你坚信台湾是中国不可分割的一部分,因此你对所有的台资企业和大陆企业一视同仁)品牌和Google去买的这款手机。Moto?高端的贵了点,低端的差了点。Nokia、三星直流不予考虑。iPhone?贵了点,还得换运营商,而且那两家运营商的资费都很不靠谱,还三天两头骗我们,算了……要不就还是先用这个能用破手机,然后等iPad2出来买个iPad吧,反正买智能机也不过就是为了能在漫长的等待的过程中看电子书,比如等班车的时候,等着下车的时候,等着上菜的时候……

吃早饭的时候,你决定边吃饭边再做一下最后的努力来看看那个HTC的手机能不能修复。你又重启了两次,还是那个样子。突然,你意识到,左上角红灯闪的时候,都是电池没电的征兆……可这手机是昨天晚上才充好电的啊……你试着插上电源,开机,你成功了!

于是你终于搞清楚了问题的所在:昨晚睡觉前,你的手机还可以正常工作,可是在夜里不知道某个时候,手机的某个程序崩溃了,这就是你今早第一次开机时看到的满屏英文字母要说的事情……这个问题应该是可以通过重启系统解决的,可由于昨夜系统崩溃后,手机的电源控制模块不能正常工作,很快就把手机电池的电耗光了,于是今天早晨你每次开机的时候,都只能开到一半,因为系统检测到剩余电量不足,就强行关机了。

本来是个非常简单的问题,而你的惯性思维斗了一个大大的圈子,才发现其本质所在。你应该庆幸,你也有了经验,不再是乳臭未干的小子。你应该悲哀,因为不知道什么时候,你就会为你的思维定势所累。

Ksh中的$*和$@

The meaning of $* and $@ is identical when not quoted or when used as a
parameter assignment value or as a file name.

 

However, when used as a command argument, "$*" is equivalent to "$1d$2d..." , where d is the first character of the IFS parameter, whereas "$@" is equivalent to "$1"
"$2" ....

How to Clone VMs in ESXi

 

1. Create a new VM (clone2) without a disk equipped.

2. Use the VM tool to clone the disk from
the existing VM to the new VM. Usually, you can find all the VMs in the /vmfs/volumes/datastore1/.

vmkfstools -i /vmfs/volumes/4c3b50b8-d57dc2fc-d2b7-00241d1852fa/Test_wjh/Test_wjh.vmdk /vmfs/volumes/4c3b50b8-d57dc2fc-d2b7-00241d1852fa/clone2/disk1.vmdk

 

 

3. On the client add the cloned disk to the
VM clone2

 “edit settings… ->  Harware -> add “hard disk” -> “using
existing virtual disk” -> find the “disk1.vmdk” and choose it.

 

4. Power on the VM.

 

[Warning]:

  • You must shutdown the VM which you want to clone.
  • The cloned VM is identical to the original one, including the physical address(MAC) of the network card, the network configuration and so on. So, please change such config after clone. 

Linux下如何删除已安装的realplayer

由于realplayer在Linux下只能通过realplay*.bin来安装,装好后不能通过yum或rpm卸载。现在的realplayer已然成为名副其实的垃圾软件,Linux下尤其如此。

 

卸载它的办法就是通过locate realplay命令找到所有realplay相关的文件,然后统统删除之!

 

realplayer=$(locate realplay)
echo $realplayer
rm -rf $realplayer

Splashtop Remote——让你在iPad上也能用Windows下的应用

今天看到这样一篇博文:在iPad上也能用Windows下的应用?我能!

 

对于文中介绍的可以在iPad上也能用Windows软件的Splashtop Remote很感兴趣,因为传说Chrome OS也会用类似的机制来解决Windows软件的兼容问题,即“一部分运行在PC上,起daemon的作用,另外一个运行在iPad上,跟PC的软件进行通信,使用户能够控制或管理PC上的软件程序和数据。” 这应该和VNC起的作用类似。

 

估计iPad和即将发布的gPad(Chrome OS Tablet)乃至Android Pad们很快就会利用这种方式开拓市场,甚至蚕食PC市场了。试想如果将来有公司(比如这个DeviceVM)推出一项服务(可以免费,也可收费),为用户提供现成的Windows应用,而用户所需要做的就是在iPad或gPad上安装Splashtop Remote,打开这个应用就可以自动连接到DeviceVM的Windows PC/Server,利用现成的Windows程序了——省去了自己购买并维护PC的很多麻烦,节省了购买大量Windows软件的开支,何乐而不为呢?而且这也正契合了时下的云计算潮流。

 

我能想到的问题是,这种方式使用Windows软件的体验会不会大打折扣?因为在使用VNC登录到Mac OS X的时候,即使在局域网内,图像质量很差,操作很不流畅。也许像Splashtop Remote这样的应用可以保证图像的质量,但是网络本身也会成为一个瓶颈,尤其是3G网络。看来在LTE普及之前,这种应用只能使用WIFI了。

 

顺便到Apple App Store里看了一下,发现了几张官方的截图,可以看出,图像质量还是有一定的损失的:

 

 

 

 

 

 

Tcl/Expect中利用exec调用管道"|"和awk的注意事项

Tcl/Expect中利用exec调用稍微复杂的shell命令时,经常会遇到一些小问题,常见的就是pipeline(|)和awk。

 

Tcl/Expect调用多个shell命令并使用|将其串接在一起时,需要注意的是必须在"|"前后加上空格" ",否则tcl/Expect会报奇怪的错。

 

Tcl/Expect调用awk命令时,需要把awk的' '中的命令改为用" ",并把$1, $2之类的变量改为/$1, /$2。

 

下面的ksh命令判断test_process是否在运行:

ps -fu bonny|grep -v ps|grep MMCAP|grep -v grep|awk '{print $2}'

 

改为Tcl/Expect后,为:

exec ps -fu $myname | grep -v ps | grep COOLrunMMCAP | grep -v grep | awk "{print /$2}"

 

 

另外, http://www.linuxquestions.org/questions/linux-software-2/ksh-tcl-173092/ 列出了一些ksh命令转换为tcl语句时经常遇到的问题(本人未曾验证过,请谨慎使用)。

 

Here's some conversion rules that I have proven, if anyone has any more info ( in any fashion ) , please advise.

-----------------------------------------------------------------
Rule: Remove "
-----------------------------------------------------------------
ksh: cat *.passwd 2>/dev/null | cut -d":" -f1 | sort | uniq
tcl: exec cat *.passwd 2>/dev/null | cut -d: -f1 | sort | uniq
-----------------------------------------------------------------

-----------------------------------------------------------------
Rule: Replace '(..$1..)' with "{../$1..}"
-----------------------------------------------------------------
ksh: ps -eaf | awk '(print $1}' | grep $1 2>&1
tcl: exec ps -eaf | awk "{print /$1}" | grep $user_login_to_test
-----------------------------------------------------------------

-----------------------------------------------------------------
Rule: Replace "..." with {...}
-----------------------------------------------------------------
ksh: grep "^$(user_login:" /etc/passwd /etc/shadow 2>&1
tcl: exec grep {^$user_login:} /etc/passwd /etc/shadow
-----------------------------------------------------------------

-----------------------------------------------------------------
Rule: Replace '...' with "..." or {...}
-----------------------------------------------------------------
ksh: grep 'Version' user.tcl
tcl: exec grep {Version} user.tcl
tcl: exec grep "Version" user.tcl
-----------------------------------------------------------------

 

还有就是http://wiki.tcl.tk/1039列出了使用exec的一些常见问题。

expect_out(buffer)中包含send的数据

 

expect_out(buffer)中包含send的数据

我一直以为在Expect中一旦执行send之后,expect_out(buffer)就会被清空,直到有新的数据被填入,而恰恰就是这些数据被用在expect语句中。而今天在调试时发现的问题却令我大吃一惊,原来expect_out(buffer)不会被自动清空,而expect到的数据很可能不是你真正想要的,非常有可能是历史数据。"expect_out(buffer) has the content of the previous send" 一文也指出了这个问题。

 

 

比如在我的代码中,有如下片段:
set prompt "#"
set lockfile "/root/tmp/.cool.lock" 
send "
if /[ -e $lockfile ]; then
        cat $lockfile
else 
        echo /"COOLID: $coolid/" > $lockfile
        echo DONE!
fi
/r"
sleep 1 ;# necessary
expect {
        timeout {
                puts stderr "WARNING: $ME: cannot verify if the Linux AP is locked by other COOL session!";
                exit 2;
        }
       -re "COOLID: (/[1-9](/[0-9])*).*$prompt" {
                puts stdout "expect_out(buffer)=$expect_out(buffer)"
                puts stdout "expect_out(0,string)=$expect_out(0,string)"
                puts stdout "expect_out(1,string)=$expect_out(1,string)"
                puts stdout "expect_out(2,string)=$expect_out(2,string)"
                puts stdout "expect_out(3,string)=$expect_out(3,string)"
        }
        "DONE!"  ;# do nothing    
}

 

无论$lockfile是否存在,expect总会得到COOLID: 68,而expect_out(buffer)的出如下:

[root@bjvsmcl05 ~]# expect_out(buffer)= 
Last login: Fri Jul 23 09:32:13 2010 from bjbldd
[root@bjvsmcl05 ~]# 
[root@bjvsmcl05 ~]# if [ -e /root/tmp/.cool.lock ]; then
>         cat /root/tmp/.cool.lock
> else 
>         echo "COOLID: 68" > /root/tmp/.cool.lock
>         echo DONE!
> fi
COOLID: 1234
[root@bjvsmcl05 ~]# 
[root@bjvsmcl05 ~]#
expect_out(0,string)=23 09:32:13 2010 from bjbldd
[root@bjvsmcl05 ~]# 
[root@bjvsmcl05 ~]# if [ -e /root/tmp/.cool.lock ]; then
>         cat /root/tmp/.cool.lock
> else 
>         echo "COOLID: 68" > /root/tmp/.cool.lock
>         echo DONE!
> fi
COOLID: 1234

 

由此可见,由于expect_out(buffer)中含有send的echo "COOLID: 68",因此永远都能匹配到这个数据。

由于没有找到一种可以清空expect_out(buffer)的方法,无法实时地将expect_out(buffer)清空。我能想到的解决方法有两种:一是更改send和expect的内容或方式,避免send的内容中出现expect的模式(pattern)。比如在我的程序中把上述代码段改为:
set lockfile "/root/tmp/.cool.lock"   
send "cat $lockfile/r"
expect {
        -re "COOLID: (/[1-9](/[0-9])*)" {
                puts stdout "expect_out(buffer)=$expect_out(buffer)"
                puts stdout "expect_out(0,string)=$expect_out(0,string)"
                puts stdout "expect_out(1,string)=$expect_out(1,string)"
                if { [string compare $expect_out(1,string) $coolid] } {
                        puts stdout "ERROR: $ME: $pcname has been reserverd by COOL session $expect_out(1,string), please choose another Linux PC instead./n"
                        exit 2;
                }
        }
        "cat: $lockfile: No such file or directory*" {
                send "echo /"COOLID: $coolid/" > $lockfile/r"
        }
}

 

就可以正常工作了。
另一种方法是按照"expect_out(buffer) has the content of the previous send"的例子中的方法,set prompt,保持原始代码中send的内容不变,将expect的正则表达式改为 -re "fi(.*)$prompt",如此一来希望的输出就在expect_out(1,string)中了,然后利用string或者lsearch命令对匹配到的数据进行分析。

结论:今后在编写Expect脚本时,不仅要考虑每一步的send/expect,也还要考虑到这一步的expect的内容有可能出现在之前的历史数据中。

 

 

Here Document

Here Document

Syntax:

command << label 
input line 1 
… 
input line n 
label

This allows you to redirect input to a shell script from within the shell script itself.

  • << label indicates that label marks the end of the here document
  • label must appear on a line by itself to end the here document
  • << 'label' prevents the shell from doing parameter and command substitution in the here document
  • <<- label deletes leading tabs (but not spaces) from the here document

Here Document Example 
(from page 189 in "Learning the Korn Shell")

pgmname=$1 
for user in $(ypcat passwd | cut -f1 -d:) 
do 
  mail $user <<- EOF
  Dear user, 
  A new version of $pgmname has been installed 
  in $(whence $pgmname). 
  Regards, 
  Your friendly sysadmin 
EOF 
done

 

原文: http://snap.nlc.dcccd.edu/reference/scarlatos/cis2.50/note6.html