2009年11月2日月曜日

Fedora11, lam and Rmpi

This is an instruction to install LAM and Rmpi with Fedora 11
Installation was done with gateway note book T7500.
Since Fedora RPM LAM will be installed in strange location, usual Rmpi can't confiture where mpi.h is.
Instruction begins immediately after fedora installation.

1. Install Fedora
Install fedora11 from DVD.iso
After first login do following as your favorites
(@root)
yum update
yum groupinstall kde-desktop (simply because I like KDE)
yum install lam
yum install lam-devel
yum install gkrellm (gkrellm is hardware monitoring tool, not necessarily if you just need R)

I like to login with nx, so I usually install nx.
Get nxclient, node and server and then
(@root)
11 rpm -i nxclient-3.4.0-5.x86_64.rpm
12 rpm -i nxnode-3.4.0-6.x86_64.rpm
13 rpm -i nxserver-3.4.0-8.x86_64.rpm
edit /etc/hosts (necessarily for nx connection)
-- org
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
--after edit
127.0.0.1 localhost localhost.localdomain localhost4 gateway
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

2. Install Atlas blas
get atlas blas source.
A. cpu fequecy change disable before atlas configuration
@root
[root@gateway ORG]# chmod 4755 /usr/bin/cpufreq-selector
[root@gateway ORG]# /usr/bin/cpufreq-selector -g performance
[root@gateway ORG]# /usr/bin/cpufreq-selector -c 1 -g performanc
cat /proc/cpuinfo (confirmation because cpufreq-selector didn't work in older fedora)
B. Atlas instllation
@user
bunzip2 atlas3.9.16.tar.bz2
tar -xvf atlas3.9.16.tar
[user@gateway Pre]$ cd ATLAS/
[user@gateway ATLAS]$ mkdir HOGE
[user@gateway ATLAS]$ cd HOGE
[usergateway HOGE]$ /home/user/Desktop/Pre/ATLAS/configure -Fa alg -fPIC
make
make time
--result
Reference clock rate=2493Mhz, new rate=2201Mhz
Refrenc : % of clock rate achieved by reference install
Present : % of clock rate achieved by present ATLAS install

single precision double precision
******************************** *******************************
real complex real complex
--------------- --------------- --------------- ---------------
Benchmark Refrenc Present Refrenc Present Refrenc Present Refrenc Present
========= ======= ======= ======= ======= ======= ======= ======= =======
kSelMM 643.0 728.3 562.2 636.7 370.1 419.2 357.3 404.7
kGenMM 189.4 214.5 189.7 214.9 175.8 199.2 176.2 199.6
kMM_NT 135.7 140.3 166.8 169.7 178.2 168.1 173.1 174.5
kMM_TN 141.8 148.8 158.2 167.3 168.7 168.6 159.8 173.7
BIG_MM 611.7 639.6 620.4 634.7 353.1 370.4 348.4 362.7
kMV_N 85.6 98.9 117.5 135.7 44.2 45.2 58.9 88.9
kMV_T 71.3 87.2 100.1 116.7 45.9 48.0 60.5 70.9
kGER 56.0 40.9 100.9 83.6 25.7 20.0 56.1 45.4
--
@root
make install

2. Install R
Obtain R source
[user@gateway Pre]$ gunzip R-2.10.0.tar.gz
[user@gateway Pre]$ tar -xvf R-2.10.0.tar
cd (R directly)
./configure --with-blas='-L/usr/local/atlas/lib -lf77blas -latlas'

--result
R is now configured for x86_64-unknown-linux-gnu

Source directory: .
Installation directory: /usr/local

C compiler: gcc -std=gnu99 -g -O2
Fortran 77 compiler: gfortran -g -O

C++ compiler: g++ -g -O2
Fortran 90/95 compiler: gfortran -g -O
Obj-C compiler:

Interfaces supported: X11
External libraries: readline, BLAS(ATLAS), lzma
Additional capabilities: PNG, JPEG, TIFF, NLS, cairo
Options enabled: R profiling, Java

Recommended packages: yes

configure: WARNING: you cannot build DVI versions of the R manuals
configure: WARNING: you cannot build DVI versions of all the help pages
configure: WARNING: you cannot build PDF versions of the R manuals
configure: WARNING: you cannot build PDF versions of all the help pages
--
make
@root
make install

I usually check R performance at this point

3 Install Rmpi
A. Configure file Preparation

gunzip Rmpi_0.5-7.tar.gz
tar -xvf Rmpi_0.5-7.tar
cd Rmpi

edit configure for configure file to recognize lam@fedora
Line 2616
--before
for d in /opt/lib /usr/lib /usr /usr/local/lib /usr/local; do
--after
for d in /opt/lib /usr/lib64/lam /usr /usr/local/lib /usr/local; do

cd ../
tar zcvf Rmpi_0.5-7_edit.tar.gz Rmpi

B. Rmpi install
and library path preparation

@root
R CMD INSTALL Rmpi_0.5-7_edit.tar.gz
cat > /etc/ld.so.conf.d/lam.ld.conf
(input while shell is waiting your input)
/usr/lib64/lam/lib
(Interapt with Ctrl-D)
/sbin/ldconfig

C. lamboot


RPM of lam, lam-devel installed configuration files in /etc
We need to have it in usual path otherwise we can't lamboot
@root
mkdir /usr/lib64/lam/etc
cp /etc/lam-conf.lamd /usr/lib64/lam/etc/

D. Done

@user
[user@gateway ~]$ cat > lamhost
gateway cpu=2
[user@gateway ~]$ /usr/lib64/lam/bin/lamboot -v lamhost -prefix /usr/lib64/lam/

Enjoy your dual/quad core PC.

You like Openmpi ? see this post.
This did work for me, but I like lam over openmpi.

Many thanks to the people who posted valuable information.
Questions to yamaoyaji.shop (at mark) gmail.com
I appreciate any comments, but I'm a layer person in this field.







2008年6月30日月曜日

S3のアクセス制限

http://gihyo.jp/dev/serial/01/amazon_ec2/0001?page=3

S3にはWeb経由で内容を参照できるが、ここのページにあるように、メールアドレスによる認証などはできない。つまりフルアクセスしかできない。
認証によるアクセス制限が可能なのは、Amazon S3に登録している人との間で、User IDまたは登録しているメールアドレスによる認証で可能。
つまりこの記事は間違っている。
FirefoxS3 extensionからメールアドレスを登録しようとしてもできないので注意。
そもそも認証できたらEC2でサーバーを動かす必要がない。

2008年6月29日日曜日

Amazon EC2 で統計計算

Amazon EC2 @ Rで統計計算をしたい人向けのメモ
  • 一般的な設定、インスタンスの走らせ方などは省略
  • それらのためのURLは以下のとおり
  1. http://kokogiko.net/m/archives/001772.html

前提としてAmazonでは通常のPCと違ってAMIというものを作って、そこから毎回起動する。つまりどのような作業をして、システムを変更したり、ファイルを作ってもAMIを作成しない限りふりだしに戻る。
そこで、Rを含んだAMIを作っておけば、

いまだにsshでのログインを理解していないので、Windowsで作業。以下が必要です。