コンパイルエラーが出たらソースコードを書き換えて対症療法を行い、
リンクエラーが出たらダミーファイルを作ってとりあえず先に進め、
コンパイラがサポート外だと言われても判定部分をコメントアウトして先に進め、
make installも行い…
結果
ダミーファイルのため公式のmpiccなどは使えず、コンパイラを直で使おうとしてもリンクエラーでバイナリができず。
(実質)何の成果も得られませんでしたあああああああ!!
さて、自分の環境では残念ながら失敗したOpenMPIですが、
成功例として紹介されていた「姫野ベンチマーク」とやらを試してみることにしました。
姫野ベンチマークは、ここからダウンロードできます。
http://accc.riken.jp/2145.htm
Windows用とMac用の実行ファイル及びソースコードが用意されています。
早速やってみました。
公式バイナリの方が公平な条件になりそうですが、とりあえずソースコードを自分でコンパイルして実験します。
環境
Windows Vista Home Premium SP2 32ビット
Intel(R) Core(TM)2 Duo CPU T8100 @2.10GHz 2.10GHz
RAM 4.00GB
gcc 4.7.2
使用ソースコード:himenoBMTxp_cc_omp_al.lzh
(このファイル、with Makefileとなっているのに.cのソースコードしか入っておらず、詐欺のようです)
コンパイルオプション
> gcc -O2 -o himenoBMTxpa.exe himenoBMTxpa.c -static
> gcc -O2 -fopenmp -o himenoBMTxpa_omp.exe himenoBMTxpa.c -static
(1,445,924 KBもメモリを食った結果、メモリ不足になったようです)
結果
OpenMPなし
>himenoBMTxpa M
mimax = 128 mjmax = 128 mkmax = 256
imax = 127 jmax = 127 kmax =255
Start rehearsal measurement process.
Measure the performance in 3 times.
MFLOPS: 514.144260 time(s): 0.800000 1.693779e-003
Now, start the actual measurement process.
The loop will be excuted in 224 times
This will take about one minute.
Wait for a while
cpu : 60.122000 sec.
Loop executed for 224 times
Gosa : 1.216205e-003
MFLOPS measured : 510.820506
Score based on Pentium III 600MHz using Fortran 77: 6.166351
>himenoBMTxpa_omp M
mimax = 128 mjmax = 128 mkmax = 256
imax = 127 jmax = 127 kmax =255
Start rehearsal measurement process.
Measure the performance in 3 times.
MFLOPS: 816.102000 time(s): 0.504000 1.693779e-003
Now, start the actual measurement process.
The loop will be excuted in 357 times
This will take about one minute.
Wait for a while
cpu : 59.515000 sec.
Loop executed for 357 times
Gosa : 1.095624e-003
MFLOPS measured : 822.423482
Score based on Pentium III 600MHz using Fortran 77: 9.927855
>himenoBMTxp_m.exe
mimax= 257 mjmax= 129 mkmax= 129
imax= 256 jmax= 128 kmax= 128
Start rehearsal measurement process.
Measure the performance in 3 times.
MFLOPS: 1198.464 time(s): 0.3432022 1.6839170E-03
Now, start the actual measurement process.
The loop will be excuted in 524 times.
This will take about one minute.
Wait for a while.
Loop executed for 524 times
Gosa : 9.7985030E-04
MFLOPS: 1267.629 time(s): 56.67516
Score based on Pentium III 600MHz : 15.30214
Fortran Pause - Enter command or to continue.
ちなみに、BOINCのベンチマークの結果が
2184 floating point MIPS (Whetstone) per CPU
4773 integer MIPS (Dhrystone) per CPU
なので数字が小さい…と思ったがよく見ると単位も異なります。これは妥当な結果なのでしょうか?
次に、仮想マシンのUbuntu上で測定してみます。
環境
VirtualBox 4.2.16
Ubuntu 8.04
RAM 376.5MB
gcc 4.2.4
最適化-O2
結果
OpenMPなし
$ ./himenobmtxpa M
mimax = 128 mjmax = 128 mkmax = 256
imax = 127 jmax = 127 kmax =255
Start rehearsal measurement process.
Measure the performance in 3 times.
MFLOPS: 314.795129 time(s): 1.306613 1.693779e-03
Now, start the actual measurement process.
The loop will be excuted in 137 times
This will take about one minute.
Wait for a while
cpu : 42.677473 sec.
Loop executed for 137 times
Gosa : 1.322192e-03
MFLOPS measured : 440.124551
Score based on Pentium III 600MHz using Fortran 77: 5.312947
$ ./himenobmtxpa_omp M
mimax = 128 mjmax = 128 mkmax = 256
imax = 127 jmax = 127 kmax =255
Start rehearsal measurement process.
Measure the performance in 3 times.
MFLOPS: 437.374626 time(s): 0.940419 1.733593e-03
Now, start the actual measurement process.
The loop will be excuted in 191 times
This will take about one minute.
Wait for a while
cpu : 58.872253 sec.
Loop executed for 191 times
Gosa : 1.247475e-03
MFLOPS measured : 444.811938
Score based on Pentium III 600MHz using Fortran 77: 5.369531
最後に、Javascript PC Emulatorで走らせてみました。
ただし、これはかなり遅く、XS設定でも時間がかかってしまうので、ソースを書き換えてかなり小さいサイズにしました。
環境
Firefox 23.0.1
結果
# ./himenoBMTxpa XXXXS
mimax = 4 mjmax = 4 mkmax = 8
imax = 3 jmax = 3 kmax =7
Start rehearsal measurement process.
Measure the performance in 3 times.
MFLOPS: 0.008577 time(s): 0.285414 7.707213e-03
Now, start the actual measurement process.
The loop will be excuted in 630 times
This will take about one minute.
Wait for a while
cpu : 61.040759 sec.
Loop executed for 630 times
Gosa : 7.997833e-15
MFLOPS measured : 0.008422
Score based on Pentium III 600MHz using Fortran 77: 0.000102
cpu : 61(ry sec.となっていますが、実時間は5分くらいかかりました。
みなさんも是非姫野ベンチマークを実行してみて結果を晒し、
いかに私のパソコンが遅いかをわからせてください…