Survey on Top500

What is Top500?

TOP500計畫是針對全球已知最強大的計算機系統做出排名與詳細介紹。此計畫始於1993年,主旨在提供一個可靠的基礎去追蹤與偵測高效能計算的趨勢。

How often do they update the list? When does the next list come out?

一年出版兩次最新的超級計算機排名列表。第一次是在六月份的國際超級計算機會議(International Supercomputing Conference)上,第二次是在十一月份的超級計算會議(Supercomputing Conference)上。下一次会在Hamburg, Germany June 17–21, 2012上公布。

What is the criterion used to rank these computers? What does this criterion do?

The Linpack Benchmark,它是一組benchmark, 通過讓一個專用系統求解密集系統線性方程組的方式評價系統的性能,由一組數字表示性能的好壞。

What are the current top 5? What kind of machines are they? Describe their hardware and software configuration. How fast do they go?

第一名是日本的K computer,系統配備了864個機櫃,88,128顆八核心富士通生產的SPARC64CPU,為45奈米的CMOS製程。它的水冷系統可以把故障率和能耗降到最低。每個計算節點之間使用直連網路的設計,以保證高靈活性和可擴展性。京使用的開放源碼軟體包括:Open MPI,Linux和Lustre集群文件系統,達到了每秒8162萬億次運算。

第二名是中國的天河-1A,該計算機由103台機櫃組成,裝有3072顆Intel Quad Core Xeon E5540 2.53GHz四核處理器和3072顆Intel Quad Core Xeon E5450 3.0GHz四核處理器,共有24576個處理器核心。天河一號還裝備2560塊AMD Radeon HD 4870 X2顯示卡,共有5120個圖形處理器用於圖形處理器通用編程。天河一號擁有98TB內存和1PB共用的磁碟容量。全系統功率為1280千瓦。天河-1A使用的開源軟體包括:Linux作業系統,SLURM作業調度系統(Job Scheduler),Lustre集群文件系統。達到了每秒4700萬億次浮點運算。

第三名是美國的Jaguar,它的XT5分區包含18688個計算節點。每個XT5計算節點包含16進制雙核心AMD Opteron 2435處理器和16GB的記憶體。它的XT4分區包含7832個計算節點,每個計算節點包含一個四核AMD Opteron1354處理器和8GB的記憶體。總的記憶體容量超過360TB。使用的開源軟體包括:Linux作業系統,和Lustre集群文件系統。並提供超過10PB的存儲。它的計算速度達到了每秒1750萬億次浮點運算。

第四名是中國的星雲,帶有Intel Xeon X5650處理器的Dawning TC3600 blade system,和Nvidia Tesla C2050圖形處理器。它使用Linux作業系統。它的計算速度達到了每秒1271萬億次浮點運算。

第五名是日本的TSUBAME 2.0,它是HP的Cluster Platform 3000SL,具有73278個Intel Xeon 6C X5670處理器。圖形處理器是nVidia的Tesla系列。使用Linux作業系統。它的計算速度達到了每秒1192萬億次浮點運算。

Who has the top 10 machines? Categorize them in nations.

在top10中,美國有5台,中國有2台,日本有2台,法國有1台。

一個Gaussian Model的implement

最近在研究Dynamic Time Warping, 在网上找不到现成的DTW library,最终决定自己implement.
对于所给的Training data, 对每个example sequence的所有feature vector都做一个Gaussian Model,也就是Normal Distribution Model. 这样子,每个model需要存储同一类型的feature vector.以及Covariance Matrix和Mean Vector. 这样在做Recognition时只要对每个Feature vector的Gaussian Model算一个probability dense function,得到一个probability,而不用和所有的相同类型的feature做对比。
因为一个feature vector需要存放多个feature于是,我需要写一个Multi-dimensional Gaussian Distribution Model. 这里采用OpenCV进行C++的implement.
在有已知的samples的情况下,我们需要计算covariance matrix和mean vector, 这个理论上可以由OpenCV的一个function来解决。。。可是在具体coding的时候,却遇到了不少麻烦。
下面是OpenCV 2.3中的定义:

void calcCovarMatrix(const Mat* samples, int nsamples, Mat& covar, Mat& mean, int flags, int ctype=CV_64F)
void calcCovarMatrix(InputArray samples, OutputArray covar, OutputArray mean, int flags, int ctype=CV_64F)

其中第二行的InputArray可以接受C++中的vector,于是我就毫不犹豫的选择了第二个function.结果问题就来了…
当程序执行到该函数时就挂掉了,命令行中显示:
OpenCV Error: Assertion failed (0 <= i && i < (int)v.size()) in unknown function
, file c:\Users\vp\work\ocv\opencv\modules\core\src\matrix.cpp, line 917
于是我查了matrix.cpp,发现917行是

CV_Assert( 0 

就是说在选择我samples中的第i个元素时竟然越界了。。。这很不可思议,在网上找了很久,也找不到结果。于是就尝试第一个function.没想到竟然成功了!!!
但是在这里,因为我的samples是动态的增加的,如果写成数组的形式会不太好,后来从学长那里学到,一个vector如何转换成一个数组。这样这个问题就解决啦!!!

vector samples;
//change vector to array
double* sample_array = &samples[0];

这样sample_array就相当于一个数组的head pointer啦~
那具体的implement就放在下面。

Continue reading

开始HMM学习

来到了新的学校,进入了研究生阶段,面对新的研究领域,需要补充很多基础知识。HMM(Hidden Markov Model)是近期要攻克的一个目标。在网上找了很多资料,http://www.comp.leeds.ac.uk/roger/HiddenMarkovModels/html_dev/main.html 有其他人的博客推荐这个网站,所以决定仔细研读,并且做些翻译,这样对细节方面把握会更好!

折腾人的CUDA

这几天给实验室服务器配CUDA环境,真够折腾的~

最开始因为显卡驱动的原因,安装不了CUDA,尝试了几乎所有的办法,最终将一块nVidia GT430的显卡作为这个服务器的显示设备,才成功安装了驱动。因为这台服务器配了2块Tesla C2070的显卡,原先将显示设备指定为主板上的集显,型号为Matrox Graphics, Inc. MGA G200eW WPCM450,安装nVidia的驱动时发生了冲突。据说是安装了nVidia的驱动后,会屏蔽其他牌子的显卡…T_T…

安装好显卡驱动后,想试着编译CUDA C的代码,可是编译时报错:

error while loading shared libraries: libcudart.so.4: cannot open shared object file: No such file or directory

可能还有其他错误会发生,这是由于环境变量没有设置正确导致的。需要手动修改环境变量,主要的环境变量修改如下(这里cuda选择默认的安装路径/usr/local/cuda):

export PATH=”/usr/local/cuda/bin:$PATH”
export LD_LIBRARY_PATH=”/usr/local/cuda/lib64:/usr/local/cuda/lib:$LD_LIBRARY_PATH”
export CPLUS_INCLUDE_PATH=”/usr/local/cuda/include”
export LIBRARY_PATH=”/usr/lib/nvidia-current”

全局的环境变量文件在/etc/profile中,(这里使用的Linux是SLES 11)

然后在/etc/etc/ld.so.conf.d目录中添加cuda.conf文件(如已存在,可以检查是否为以下内容):

/usr/local/cuda/lib

修改好文件后,别忘了重载环境变量哦~
ldconfig
source /etc/profile
到目前为止,问题基本解决了,我编译了书中的示例程序,成功编译并且执行!

#include "stdio.h"
int main ( void ) {
    printf( "Hello, World!\n");
    return 0;
}

注意,这里cuda的代码后缀是cu而不是c, 并且编译器是nvcc而不是gcc

Data Binding in WPF

Binding to XML

From John Papa, MSDN magazine
Binding to data sources such as XML and objects is also handy. Figure 4 shows a sample of an XmlDataProvider that contains an embedded list of colors that will be used as a data source. The XmlDataProvider can be used to bind to an XML document or fragment that is either embedded in the XmlDataProvider tag or is in a file referred to in an external location.

<StackPanel>
<StackPanel.Resources>
<XmlDataProvider x:Key="MoreColors" XPath="/colors">
    <x:XData>
        <colors >
            <color name="pink"/>
            <color name="white"/>
            <color name="black"/>
            <color name="cyan"/>
            <color name="gray"/>
            <color name="magenta"/>
        </colors>
    </x:XData>
</XmlDataProvider>

Embedded XML content must be placed within a tag inside of an XmlDataProvider, as shown in Figure 4. The XmlDataProvider must be given an x:Key value so that it can be referred to by data-binding targets. Notice that the XPath attribute is set to “/colors”. This attribute defines the level of the XML content that will be used as the data source. This becomes very useful when binding to a large XML structure that may be contained in a file or database and the data you want to bind to is not the root element.
An XmlDataProvider is a resource that can be placed inside of a context-specific resource. As Figure 4 shows, the XmlDataProvider is defined as a resource within the context of the StackPanel. This means that the XmlDataProvider will be available to all content inside of that StackPanel. Setting the context of a resource helps limit the exposure of a data source to the appropriate areas. This enables you to create well-defined, self-contained regions of both controls and supporting resources within your page, thus improving readability.
The syntax for binding to a resource is slightly different than it is for binding to an element. When binding to a control, you set the ElementName and the Path properties of the Binding. However, when you bind to a resource you set the Source and, since we are binding to an XmlDataProvider, you set the XPath property of the Binding as well. For example, the following code will bind the ListBox’s items to the MoreColors resource. The Source property is set to a resource and it is specified as a StaticResource named MoreColors. The XPath property indicates that the items will be bound to the
element’s name attribute within the XML data source:

<ListBox x:Name="lbColor" Width="248" Height="56"
    IsSynchronizedWithCurrentItem="True"
    ItemsSource="{Binding Source={StaticResource MoreColors},
    XPath=color/@name}">
</ListBox>

I specified StaticResource in this case because the XML will not change. If changes occur in the data source, they will not be sent to the target. The DynamicResource setting indicates the opposite—changes will be sent. This is useful when referencing system themes, languages in globalization, or fonts. A DynamicResource will allow these types of settings to be propagated throughout the UI elements that are bound to them dynamically.
The XmlDataProvider can also point to an external source for the XML content. For my example, I have a file named colors.xml that contains the list of colors I want my ListBox to be bound to. I can simply add a second XmlDataProvider resource to the StackPanel and direct it to the XML file. Notice I set the Source attribute to the name of the XML file and the x:Key to Colors:

<XmlDataProvider x:Key="Colors" Source="Colors.xml" XPath="/colors"/>

Both XmlDataProviders exist as resources within the same StackPanel. I can tell the ListBox to bind itself to this new resource by changing the name that the StaticResource is set to:

<ListBox x:Name="lbColor" Width="248" Height="56"
    IsSynchronizedWithCurrentItem="True"
    ItemsSource="{Binding Source={StaticResource Colors},
    XPath=color/@name}">
</ListBox>

反应面方法

原文为: THE RESPONSE SURFACE METHODOLOGY. Nuran Bradley. Department of Mathematical Sciences Indiana University of South Bend.2007

1 一阶反应面的分析

通常反应变量y和独立变量的关系是不知道的。总的来讲,用低阶多项式模型来描述反应面f. 多项式模型通常能够在小范围内对反应面充分逼近。因此,采用一阶或者二阶段方法来逼近未知函数f.

Continue reading

[中南大学]遗传算法

遗传算法是仿真生物遗传学和自然选择机理,通过人工方式所构造的一类搜索算法,从某种程度上说遗传算法是对生物进化过程进行的数学方式仿真。霍兰德(Holland)在他的著作《Adaptation in Natural and Artificial Systems》首次提出遗传算法,并主要由他和他的学生发展起来的。

生物种群的生存过程普遍遵循达尔文进化准则,群体中的个体根据对环境的适应能力而被大自然所选择或淘汰。进化过程的结果反映在个体的结构上,其染色体包含若干基因,相应的表现型和基因型的联系体现了个体的外部特性与内部机理间逻辑关系。通过个体之间的交叉、变异来适应大自然环境。生物染色体用数学方式或计算机方式来体现就是一串数码,仍叫染色体,有时也叫个体;适应能力是对应着一个染色体的一个数值来衡量;染色体的选择或淘汰则按所面对的问题是求最大还是最小来进行。

遗传算法自从1965年提出以来,在国际上已经形成了一个比较活跃的研究领域,已召开了多次比较重要的国际会议和创办了很多相关的国际刊物。

遗传算法已用于求解带有应用前景的一些问题,例如遗传程序设计、函数优化、排序问题、人工神经网络、分类系统、计算机图像处理和机器人运动规划等。

Continue reading