中田真秀(なかたまほ)のブログ

研究について、日常について、その他。

OSXでikalogは速い

2016-04-20 21:29:43 | 日記
あたりまえだが、OSXでikalogは速かった
$  /usr/bin/time python IkaLog.py -f ./ikalog_sample.mp4
....
<ikalog.outputs.csv.CSV object at 0x1084c1828> (enabled = True)
<ikalog.outputs.printjson.JSON object at 0x11007ff60> (enabled = True)
bye!
       70.82 real        61.02 user         9.39 sys

4倍くらい速かった。かたやARM64 2.0GHz 4コア、かたやMac mini server (Late 2012), 2.3GHz Intel Core i7のでまぁそんなもんだが。
元動画は90秒程度なんで、若干高速な感じ。ここまでくるとリアルタイムで解析も可能なんだけどわざわざその程度のパソつかわんと
イカんのか?という疑問がある。

ODROID-C2はikalogの夢を見る

2016-04-20 07:11:09 | 日記
ODROID-C2でikalogで解析をしてみた。
ikalog_sample.mp4は、1:30程度のサンプル動画であるが...
215.07user 4.29system 2:53.04elapsed 126%CPU (0avgtext+0avgdata 203604maxresident)k
と、2倍程度時間がかかっていた。
<ikalog.scenes.result_udemae.ResultUdemae object at 0x7f96c0ca20>: switching to state _state_default

からがやけに時間がかかっているように見える。
raspberry pi2の8:11.14elapsedと比較すると流石に高速。もうちょい速くなってくれるとリアルタイムできるしたぶんできる(雑)

注意点
OpenCV 3.1はarm64、Google DNNモジュールがビルドできなかった。
くらいかね。

OpenCVのビルドがまた鬼門で、外付けHDDでやるのだが、電源容量が足りず、途中たいへん不安定になった。この手の
コンピュータの問題としては結構ポップらしい。

お疲れ様でした


RetroPie と RecalBox の違い: RecalBoxのほうが高速なのはなぜだろ?

2016-04-16 09:40:07 | 日記
Raspberry Pi2を購入したのは、
N64 & PSX Emulator Performance Raspberry Pi 2 - RecalboxOS - Tekken 3, Mario Kart 64
を見て、鉄拳3がスムースに動くのを確認したからだ。他にもある

で、Raspberry Pi2を買ってきてはやる気持ちを抑えつつ、動かそうとすると、Recalboxはmkfs.fatのエラーがリサイズ途中で起きてインストールの途中で止まる。

困った挙句、RetroPiをインストールする。ソフトウェア的には同じだろうと思って油断していたら、全く速度が出ない。もちろん設定も変えたりオーバークロックも
してみた。それでも鉄拳3でフレームが30~40程度とゲームにならない。さすがにARMの900MHz4コアでプレステのmipsR3000A 33MHz程度のエミュがダメかとおもうと、
悲しかったが、そのあと、Raspberry Pi 3を購入し、スピード問題が解消した。さすがに1.2GHz、メモリなどもスピードが上がっているし、当然といえば
当然だが。

最近32GBのMiniSDHCカードを買い直したのでRecalbox on RPi2を再び試してみたら、こんどはmkfs.fatのエラーが起きなかった。そしてこれが高速。

まァいまRPi2を購入する理由は殆ど無い。RPi3だと無線LAN, Bluetoothも付いてるわけで、同機能にするにはむしろRpi2のほうが価格的にも不利になる。

ただ、RetroPiもRecalBoxもそんなに違うわけでないので、ここまでスピードが違うのはなんだかおかしい。DreamCastもエミュが高速になるかもしれないので、原因を知りたい。

2電子積分(d,f含む)をGPUで高速に計算する(10倍~20倍)という論文とプログラム

2016-04-11 15:15:22 | 日記
2電子積分(d,f含む)をGPUで高速に計算する(10倍~20倍)という論文とプログラム

http://ow.ly/10vQyk
http://github.com/miaoyipu/quick

Acceleration of High Angular Momentum Electron Repulsion
Integrals and Integral Derivatives on Graphics Processing Units
Yipu Miao and Kenneth M. Merz, Jr.

ABSTRACT:
We present an efficient implementation of ab initio self-
consistent field (SCF) energy and gradient calculations that run on Compute
Unified Device Architecture (CUDA) enabled graphical processing units
(GPUs) using recurrence relations. We first discuss the machine-generated
code that calculates the electron-repulsion integrals (ERIs) for different ERI
types. Next we describe the porting of the SCF gradient calculation to GPUs,
which results in an acceleration of the computation of the first-order derivative
of the ERIs. However, only s, p, and d ERIs and s and p derivatives could be
executed simultaneously on GPUs using the current version of CUDA and
generation of NVidia GPUs using a previously described algorithm [Miao and Merz
J. Chem. Theory Comput.2013,9, 965-976.].
Hence, we developed an algorithm to compute f type ERIs and d type ERI derivatives on GPUs. Our benchmarks shows the
performance GPU enable ERI and ERI derivative computation yielded speedups of 10-18 times relative to traditional CPU
execution. An accuracy analysis using double-precision calculations demonstrates that the overall accuracy is satisfactory for most
applications.


ほんとだとするとすごい。ソースコードも公開されている。

FMOのインプットファイルを作るfragIt

2016-04-11 11:46:08 | 日記
FMO (fragment molecular orbital)法は大きな分子を計算するとき、特にタンパク質を計算するときに役に立つ。
問題はinput fileを作るのが尋常ではなく難しいことだ。GAMESSもすでにマニア向けであるが、FMOまでくると
人力で作るのはほぼ不可能である。これをとんでもなく簡単にするのが
FragIt
である。pdbからダイレクトにGAMESSのinputファイルを作成してくれる(自動で水素はつかないのでそこは
また必要)

方針は簡単にいうと、SMARTS表記でフラグメントパターンを記述、pdbから読んでそこで切る、である。

$ wget https://github.com/FragIt/fragit-main/archive/fragit-1.5.0.tar.gz
$ python2.7 setup.py build
$ python2.7 setup.py install

running install
running build
running build_py
running build_scripts
running install_lib
running install_scripts
changing mode of /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/fragit to 755
running install_data
running install_egg_info
Removing /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fragit-1.5.0-py2.7.egg-info
Writing /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/fragit-1.5.0-py2.7.egg-info

----依存の解消(OpenBABELおよびpython2系が必要)
port select --set python python27
git clone git://github.com/openbabel/openbabel.git
cd openbabel
mkdir build
cd build
cmake -DRUN_SWIG=ON -DPYTHON_BINDINGS=ON \
-DCMAKE_INSTALL_PREFIX=/opt/openbabel  -DENABLE_TESTS=ON ..
make
make test
sudo make install

export PYTHONPATH=/opt/openbabel/lib/python2.7/site-packages:$PYTHONPATH
export LD_LIBRARY_PATH=/opt/openbabel/lib:$LD_LIBRARY_PATH
export PATH=/opt/openbabel/bin:$PATH
----つかいかた
cd /Volumes/Home/maho/fragit
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/fragit ala_phe_ala.pdb


サンプルのタンパク質(103原子、Ala-Ala-Ala-Ala-Phe-Ala-Ala-Ala)をfragItで分割し、基底関数6-31G*で計算してみたら
3530.081u 43.944s 1:00:20.74 98.7% 0+0k 109+376io 84pf+0w
ほぼ一時間であった(Mac Late 2012 corei7 2.3GHz)