2016年3月27日日曜日

UbuntuでACML

GPGPUされたBLAS/LAPACKを手軽に使いたかったので、Ubuntu (14.04)でACML6.1を使う。

sudo update-alternatives --install /usr/lib/libblas.so.3 libblas.so.3 /opt/ACML/6.1.0/gfortran64_mp/lib/libacml_mp.so 60

sudo update-alternatives --install /usr/lib/liblapack.so.3 liblapack.so.3 /opt/ACML/6.1.0/gfortran64_mp/lib/libacml_mp.so 60

して、登録後
sudo update-alternatives --config libblas.so.3
sudo update-alternatives --config liblapack.so.3

AMD A8-3850とRadeon R9 390という歪な構成ながら、問題サイズが大きければOpenBLASよりも速いこともあるようなので、まぁまぁ?ACMLの時はtopでみてる感じだとCPU使用率50%ぐらい。OpenBLASの時はもちろんほとんど400%

計算例:
Python:
>>> from numpy import *
>>> from time import *
>>> a=random.rand(10000,10000); t=time(); a=linalg.inv(a); time()-t

ACML: 46.84487009048462
OpenBLAS: 72.2047929763794

OCTAVE:
octave:1> a=rand(10000,10000); b=a;
octave:2> tic; c=a*b; toc;

ACML:4.4 sec
OpenBLAS: 46.8 sec
すばらしい。

追記:
octaveをインストールする時にいろいろ文句を言われたので、下の方がいいかも。
sudo update-alternatives --install /usr/lib/libblas.so.3 libblas.so.3 /opt/ACML/6.1.0/gfortran64_mp/lib/libacml_mp.so 60 --slave /usr/lib/libblas.so.3gf libblas.so.3gf /opt/ACML/6.1.0/gfortran64_mp/lib/libacml_mp.so

sudo update-alternatives --install /usr/lib/liblapack.so.3 liblapack.so.3 /opt/ACML/6.1.0/gfortran64_mp/lib/libacml_mp.so 60 --slave /usr/lib/liblapack.so.3gf liblapack.so.3gf /opt/ACML/6.1.0/gfortran64_mp/lib/libacml_mp.so

2016年3月14日月曜日

NexusのROMを再インストール

なぜだかは良く分からないけど、先週突然Nexus5のWifiが不安定になって使い物にならなくなってしまった。Wifiのon/offがOSからうまくコントロールできていないように見えた。
もう二年以上使っているのでそろそろ買い換えてもいいころではあるんだけど、もう少し待って食指が動くものを探したい気もしたので、何とかリカバリを目指す。

ファクトリリセットはbootloaderからだと失敗して、OSからは成功したんだけど、Wifiが不安定なことには変わりなかった。この過程で判明したんだけど、USB接続もおかしい。

結局Ubuntuに対してUSB接続の方法をいろいろ変えていると(MTPとかPTPとか)、PTPならつながることがあることを発見。
下記を参考にUbuntuからADBで接続できるようにして、
https://androidonlinux.wordpress.com/2013/05/12/setting-up-adb-on-linux/
下記からファームの一番新しいのをゲット&インストール
https://developers.google.com/android/nexus/images#instructions

現在、Wifiを使ってアプリの更新中。

引っかかったのは、AndoridとfastbootではATTR{idProduct}の値を変えなくてはいけなかったこと。lsusbして確認してください。


2016年2月25日木曜日

(Probably) The easiest way to get map tile for NASA's world wind with natural earth data

Converting from the natural earth data raster images to NASA's World Wind tile is a bit complicated.
I guess one of the easiest way is use the demo program in goworldwind.org.

How to:
(1) Get the script named "InstallImageryAndElevationsDemo" and launch it.
(2) "Install" the tiff image of the natural earth data.
(3) check the directory "c:\programdata\worldwindinstalled" on Windows.
      (Probably you can do the same thing on the other plat forms)

URL:
http://goworldwind.org/demos/

2016年2月20日土曜日

三井住友信託銀行の提携クレジットカード

なんか、提携やめてしまうみたい。
新しいのは全然魅力がないので、小規模ユーザーは結構抜けてしまうのでは。

http://www.smbctb.co.jp/banking/creditcard/index.html

2016年2月18日木曜日

"reject" to "major revision"

My article which has been "under review" such a long time was rejected one week ago. I believed the reviewer's comments were somehow unreasonable, and so, I wrote a letter to the editor who has been taking care of my article.

In the end, I have just received an e-mail from the editorial office, which says;
"The Editor has informed me that this decision should be reverted and you will receive a new decision letter shortly."
And the status of the article turns from "reject" to "major revision"

The editor's decision is not always 100% sure.
You should try to write a letter to your editor in some cases.

2016年2月10日水曜日

linux でEPSから余白なしのPDFを作る

latexでepsがうまく表示されないので、あらかじめPDFにしておくことにした。
imagemagickでeps -> pdfすると余白がついてしまうので、pdfcropを使って削除する。
一括でできるように簡単なshell scriptを。

% cat run.sh
#!/bin/sh -f
for i in $@
do
j=`echo $i | sed -e 's/eps/pdf/g'`
convert $i $j
pdfcrop $j $j
done

% ./run.sh *.eps

2016年2月4日木曜日

pythonからCのモジュールを呼んでいる時に、プロファイルを取る方法

下記のページそのままなんですが、googleのprofilerを使います。yepはうまくつかえなかったので、結局こうなりました。

https://pygabriel.wordpress.com/2010/04/14/profiling-python-c-extensions/