coLinux日記

coLinuxはフリーソフトを種として、よろずのシステムとぞなれりける。

Raspberry Pi の浮動小数点演算の性能

2013-07-27 01:35:31 | Raspberry Pi

Pidora の設定が一応終わったので、いろいろ試していこうと思います。 まず、Raspberry Pi の浮動小数点演算の性能を見るために昔行った姫野ベンチを試してみます。比較のためにプログラムはその時のものを使います。Fortranコンパイラは標準ではインストールされていないのでインストールします。

# yum install gcc-gfortran.armv6hl
.............
Installed:
  gcc-gfortran.armv6hl 0:4.7.2-2.fc17.a6

Dependency Installed:
  libgfortran.armv6hl 0:4.7.2-2.fc17.a6

Complete!
# which gfortran
/usr/bin/gfortran

早速プログラムをコンパイルしてみます。

$ gfortran -O3 himenoBMTxp.f90
himenoBMTxp.f90:131.7:

  pause
       1
Warning: Deleted feature: PAUSE statement at (1)
$

コンパイルできました。これを実行してみます。

$ ./a.out
 Select Grid-size:
 Grid-size=
            XS (64x32x32)
            S  (128x64x64)
            M  (256x128x128)
            L  (512x256x256)
            XL (1024x512x512)
XS
  mimax=          65  mjmax=          33  mkmax=          33
  imax=          64  jmax=          32  kmax=          32
  Time measurement accuracy : .10000E-02
  Start rehearsal measurement process.
  Measure the performance in 3 times.
   MFLOPS:   36.0227814       time(s):  0.15800000000000000        6.22747932E-03
 Now, start the actual measurement process.
 The loop will be excuted in        1139  times.
 This will take about one minute.
 Wait for a while.
  Loop executed for         1139  times
  Gosa :   3.48486265E-06
  MFLOPS:   36.3105049       time(s):   59.512000000000000
  Score based on Pentium III 600MHz :  0.438320935
PAUSE
To resume execution, type go.  Other input will terminate the job.
go
RESUMED
$

S も試してみます。

$ ./a.out
 Select Grid-size:
 Grid-size=
            XS (64x32x32)
            S  (128x64x64)
            M  (256x128x128)
            L  (512x256x256)
            XL (1024x512x512)
S
  mimax=         129  mjmax=          65  mkmax=          65
  imax=         128  jmax=          64  kmax=          64
  Time measurement accuracy : .10000E-02
  Start rehearsal measurement process.
  Measure the performance in 3 times.
   MFLOPS:   36.3792992       time(s):   1.3580000000000001        3.28862783E-03
 Now, start the actual measurement process.
 The loop will be excuted in         132  times.
 This will take about one minute.
 Wait for a while.
  Loop executed for          132  times
  Gosa :   1.96013972E-03
  MFLOPS:   36.4830971       time(s):   59.582000000000001
  Score based on Pentium III 600MHz :  0.440404385
PAUSE
To resume execution, type go.  Other input will terminate the job.
go
RESUMED
$

Fortranプログラムの結果は残念なもので、浮動小数点演算は遅いようです。しかし、Raspberry Pi にとっては Fortran プログラムをコンパイルできて動作したということで満足です。


コメント    この記事についてブログを書く
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« Pidora の設定 ntpdate とア... | トップ | Pidora のアップデートでのト... »
最新の画像もっと見る

コメントを投稿

Raspberry Pi」カテゴリの最新記事