2010年8月9日 星期一

D2MCE 簡易實作步驟

https://pms.eps.csie.ntut.edu.tw/trac/d2mce/wiki/Reference
https://pms.eps.csie.ntut.edu.tw/svn/d2mce/


d2mce在64bit機器上會壞掉
只能在32bit上執行


首先利用svn下載至電腦上
#apt-get install subversion
#svn co https://pms.eps.csie.ntut.edu.tw/svn/d2mce/


編譯D2MCE
#cd /d2mce/trunk
#./configure --prefix=/opt/d2mce
#make
#make install


要先在home目錄底下mkdir一個.d2mce_conf且裡面要有d2mce.conf
#~/.d2mce_conf/d2mce.conf
這個檔案用來設定用哪一個port哪一個網卡
若沒有這個檔案執行檔案時會出現

root@nisun:/d2mce/trunk/examples/matrix-d2mce-dynamic# ./matrix 
can't not open /root/.d2mce_conf/d2mce.conf
Error: read_config() failed.
d2mce init failured

所以要先做
#cd ~
#mkdir .d2mce_conf
#cd .d2mce_conf

#vim d2mce.conf
編輯內容

network_device eth0
port 55660
然後:wq
port最好大於1024

接下來還要再開一個程式
在/opt/d2mce/bin內的d2mced
這是一個daemon用來控制整個group
所以必須先開daemon
#/opt/d2mce/bin/d2mced

接下來就可以執行程式了
我們執行一個example
#cd /d2mce/trunk/examples/matrix-d2mce-dynamic
#make
#./matrix
可以看到結果

Vector Size:512
Matrix size:262144
Processing time:1.956712
msg count:184
msg byte :5474
daemon exit ok!!


若有error while loading shared libraries: libd2mce.so.0: cannot open shared object file: No such file or directory
需要先在/sbin裡
打ldconfig /opt/d2mce/lib/