Qe kur mesova te haja gjelle nga pjata ku ra qimja sme tremb me asgje ne jete

seen from United States
seen from United States
seen from Norway
seen from United States
seen from China

seen from T1
seen from United States
seen from United States
seen from China

seen from United States

seen from Australia

seen from United States
seen from Sweden

seen from Türkiye
seen from United Kingdom

seen from Georgia
seen from United States

seen from Belarus
seen from China

seen from United States
Qe kur mesova te haja gjelle nga pjata ku ra qimja sme tremb me asgje ne jete

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
ifortでNumeric error無しのLAPACK
以前の記事でintelコンパイラでnetlibのLAPACKをビルドして、make testすると数値エラーがあると書きました。 http://sage-t.tumblr.com/post/82682033843/lapack-check-install 今度はその数値エラーをいかに無くすか、試してみました。 make testに至るまでのビルド方法の詳細は、以前の記事を参照してください。 Intel コンパイラに関する噂として、最適化する際ビットのエラーを気にせず演算の順番を入れ替えたりとか何かするというのがあります。 そこで最適化フラグをO0と明示してみましょう。cmakeのフラグを以下の様にします。
CMAKE_Fortran_FLAGS -O0
CMAKE_Fortran_FLAGS_MINSIZERELEASE -O0
CMAKE_Fortran_FLAGS_RELEASE -O0
たぶん下二つは必須ではないと思いますが、まあ一応。 これでビルドしてmake testして見ます。
--> LAPACK TESTING SUMMARY <-- Processing LAPACK Testing output found in the TESTING direcory SUMMARY nb test run numerical error other error ================ =========== ================= ================ REAL 1079349 0 (0.000%) 0 (0.000%) DOUBLE PRECISION 1079349 0 (0.000%) 0 (0.000%) COMPLEX 556022 0 (0.000%) 0 (0.000%) COMPLEX16 545818 3 (0.001%) 0 (0.000%) --> ALL PRECISIONS 3260538 3 (0.000%) 0 (0.000%)
一気に減りました。だけど0になったわけではありません。 で、いろいろ調べていると、もっと直接的に浮動小数点演算の精度を指定できるオプションがありました。 https://software.intel.com/sites/products/documentation/doclib/stdxe/2013/composerxe/compiler/fortran-mac/GUID-63514789-6BE7-4FA8-9389-F3B618A2EE1A.htm ということで、CMAKE_Fortran_FLAGSに-fp-model preciseと入れてビルド。
$ make (中略) ifort: command line warning #10212: -fp-model precise evaluates in source precision with Fortran. ifort: command line error: use of '-fp-model <arg>' option along with a floating point precision option not supported make[2]: *** [BLAS/SRC/CMakeFiles/blas.dir/isamax.f.o] Error 1 make[1]: *** [BLAS/SRC/CMakeFiles/blas.dir/all] Error 2
といわれます。どういうことだ、とbuildディレクトリ(作業ディレクトリ)に生成されたソースコードのコンパイルオプションをチェック。
$ cat BLAS/SRC/CMakeFiles/blas.dir/flags.make # CMAKE generated file: DO NOT EDIT! # Generated by "Unix Makefiles" Generator, CMake Version 2.8 # compile Fortran with /opt/intel/bin/ifort Fortran_FLAGS = -fp-model precise -fltconsistency -fp_port Fortran_DEFINES =
6行目の -fp-model precise -fltconsistency -fp_port が、「 use of '-fp-model <arg>' option along with a floating point precision option not supported」に該当しているようです。つまり-fp-modelオプションと他のfpオプションの併用はサポートされていないからだめ、と。 一応-fltconsistencyとか-fp_port も調べてみたのですが、これらも浮動小数点演算の精度に関するオプションでした。Lapackは精度重視したいのか、これらを自動で加えているようです。 fltconsistency http://wwweic.eri.u-tokyo.ac.jp/computer/manual/altix/compile/Fortran/Intel_Fdoc91/main_for/mergedProjects/copts_for/fortran_options/option_fltconsistency.htm fp_port https://software.intel.com/sites/products/documentation/doclib/stdxe/2013/composerxe/compiler/fortran-lin/GUID-3B693484-8CB1-4F34-A4A8-ADD0E0D73364.htm けどまあ-fp-model preciseはこれらの上位互換みたいな?よく知りませんが。 ということで、CMAKE generated file: DO NOT EDIT!とか言われるこれらflags.makeからこういったオプションを削り、
Fortran_FLAGS = -fp-model precise
としてみます。 この後ビルドを進めていくと、また同様に-fp系オプションの競合が出たので、逐次-fltconsistency -fp_port を削っていきます。 flags.makeのほかに、link.txtからも削る必要がありました。 またディレクトリ構成も、BLAS、LAPACK、テスト用プログラムのそれぞれに分けられてて、そのすべてに設定ファイルがありますので、編集対象のファイルは地味に多いです。
SRC/CMakeFiles/lapack.dir/flags.make
BLAS/SRC/CMakeFiles/blas.dir/flags.make
TESTING/MATGEN/CMakeFiles/tmglib.dir/flags.make
がflags.makeだけ編集すればよいディレクトリ。
BLAS/TESTING/CMakeFiles/ の中に xblat1c.dir/ xblat1s.dir/ xblat2c.dir/ xblat2s.dir/ xblat3c.dir/ xblat3s.dir/ xblat1d.dir/ xblat1z.dir/ xblat2d.dir/ xblat2z.dir/ xblat3d.dir/ xblat3z.dir/
TESTING/LIN/CMakeFiles/ の中に xlintstc.dir/ xlintstds.dir/ xlintstrfd.dir/ xlintstrfz.dir/ xlintstzc.dir/ xlintstd.dir/ xlintstrfc.dir/ xlintstrfs.dir/ xlintsts.dir/ xlintstz.dir/
TESTING/EIG/CMakeFiles/ の中に xeigtstc.dir/ xeigtstd.dir/ xeigtsts.dir/ xeigtstz.dir/
というテスト用プログラムを分けたディレクトリがあり、それぞれがflags.makeとlink.txt をもっていて、それら全てを書き直す必要があります。 perlを使えば比較的楽に編集できます。たとえば、
perl -p -i.bak -e 's/-fltconsistency -fp_port//g' TESTING/LIN/CMakeFiles/xlint*.dir/link.txt perl -p -i.bak -e 's/-fltconsistency -fp_port//g' TESTING/LIN/CMakeFiles/xlint*.dir/flags.make
の二行で、TESTING/LIN/CMakeFiles/にある全てのflags.makeとlink.txtは編集ができて、flags.make.bakとバックアップが取れています(-i.bakオプション)。 これでビルドします。-fp-model preciseオプションで「ソースコードレベルの精度でビルドするよ」ていう警告がうっとうしいですが、とりあえず完了します。警告を抑えるには-wオプションを加えます。 でmake test。
--> LAPACK TESTING SUMMARY <-- Processing LAPACK Testing output found in the TESTING direcory SUMMARY nb test run numerical error other error ================ =========== ================= ================ REAL 1079349 0 (0.000%) 0 (0.000%) DOUBLE PRECISION 1079349 0 (0.000%) 0 (0.000%) COMPLEX 556022 0 (0.000%) 0 (0.000%) COMPLEX16 556834 0 (0.000%) 0 (0.000%) --> ALL PRECISIONS 3271554 0 (0.000%) 0 (0.000%)
めでたしめでたし。 ですがうまく言ったとはいえ、これはLapackのテストで大丈夫というだけで、全ての演算で精度が大丈夫というわけではないです。 まあ-fltconsistency(浮動小数点の一貫性)と-fp_port(丸め順番)がnetlib Lapack的には最低限守ってほしい精度なんだというnetlibからのメッセージなのでしょうか。 自分のプロジェクトでも大丈夫という保証ではないと思いますので、改めて自分のプログラム向けのテストもすると完璧でしょう。 テストプログラムにはぜひFortranを。
LAPACK3.4以前のmake.inc編集形式だと、INSTALLフォルダにmake.inc.ifortがあるかと思います。これをコピーしてきてmake.incにリネーム。そのあとmake.incをvimかemacsなどお好みのエディタで開き、NOOPTの-fltconsistencyと-fp_portを削除、NOOPTとOPTSに-fp-model preciseを追加してやればいいようです。 -Onなどの最適化オプションは関係ない模様。
GCCの方はどうかといいますと、ビットの精度のほうを優先しているようです。たとえばa*a*a*a*a*aは単純に5回掛け算なのですが、a3 = a*a*a、a3*a3とすると3回の掛け算になります。ですがビット精度があるので、前者のように律儀にかけていくようにしています。 http://stackoverflow.com/questions/6430448/why-doesnt-gcc-optimize-aaaaaa-to-aaaaaa まあこのリンク先にもあるように、GCCにも-ffast-mathというこのような計算順序を速度の観点で最適化するオプションがあります。 ということで、CMAKE_Fortran_FLAGSに-ffast-mathを指定しますと、
--> LAPACK TESTING SUMMARY <-- Processing LAPACK Testing output found in the TESTING direcory SUMMARY nb test run numerical error other error ================ =========== ================= ================ REAL 914117 547 (0.060%) 0 (0.000%) DOUBLE PRECISION 918867 477 (0.052%) 0 (0.000%) COMPLEX 320666 9626 (3.002%) 0 (0.000%) COMPLEX16 323275 9637 (2.981%) 0 (0.000%) --> ALL PRECISIONS 2476925 20287 (0.819%) 0 (0.000%)
こんな風にエラーがいっぱい出ます。Intelの浮動小数点操作を気にしなかったときよりだいぶひどい。Intel fortranは精度を犠牲にしているとはいえそれなりに工夫しているのかもしれません。
zshでifortのエラーの解決
'=='を'='に変更
intel composer on ubuntu 11.04
1. Install packages; you'll need 32-bit libraries and JRE
sudo su # become root
add-apt-repository ppa:ferramroberto/java apt-get update apt-get install ia32-libs sun-java6-jre sun-java6-plugin sun-java6-fonts
2. Run install.sh in DVD
3. Export path; see
http://love-planets.tumblr.com/post/1132559600
SHTOOLS のリコンパイル
(1/15/2011追記)
SHTOOLS2.6 リリース。
このバージョンでは、src/Makefile の修正は不要(というかそもそもそのファイルはない)。
apt-get install make tcsh make F95=ifort make install
でおっけー。ただし、下記のコンパイルスクリプトの SHTOOLS を 2.5 -> 2.6 に直すこと。
(追記ここまで)
ーーーーーーーーーーーーーー
intel fortran のバージョンアップに伴い、再コンパイル。
まずはアンインストール。
rm -R /usr/local/SHTOOLS2.5
あとは、前回と全く同じで再インストール.
コンパイルスクリプトは、以下のように修正。
#!/bin/sh #----------------- # **** NOTE **** # Type as shown below: # $ ./compile.sh XXX.f95 #----------------- SHTPATH='/usr/local/SHTOOLS2.5' MKLPATH='/opt/intel/composerxe-2011.0.084/mkl/lib/intel64' MKLINCLUDE='/opt/intel/composerxe-2011.0.084/mkl/include' # ifort -Tf $1 -free -fast -o ${1%.f95}.exe -I$SHTPATH/modules/ -L$SHTPATH/lib -lSHTOOLS2.5 -L$MKLPATH -I$MKLINCLUDE -I$MKLINCLUDE/intel64/lp64 -lmkl_lapack95_lp64 -Wl,--start-group $MKLPATH/libmkl_intel_lp64.a $MKLPATH/libmkl_intel_thread.a $MKLPATH/libmkl_core.a -Wl,--end-group -liomp5 -lpthread # EOF

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
SHTOOLS を intel fortran で: インストール編
(1/15/2011追記)
SHTOOLS2.6 リリース。
このバージョンでは、src/Makefile の修正は不要(というかそもそもそのファイルはない)。
まず、make all F95=ifort
次に make install
でおっけー。ただし、下記のコンパイルスクリプトの SHTOOLS を 2.5 -> 2.6 に直すこと。
(追記ここまで)
ーーーーーーーーーーーーーー
Debianインストール直後ではパッケージが不足、インストールする必要がある 手順1. SHTOOLSをダウンロード、zip を解凍 http://www.ipgp.fr/~wieczor/SHTOOLS/ 手順2. src/Makefileの編集 45行目 "AR = ar" を "AR = xiar" に 158行目 "$(F95) $(F95FLAGS) -c $<" を "$(F95) $(F95FLAGS) -c -free -Tf $<" に 手順3. 以下のスクリプトを SHTOOLS に保存、実行 ---- #!/bin/sh # apt-get install tcsh make all F95=ifort F95FLAGS="-fast" make install # EOF ---- 保存時は、改行コードに注意
[Old] intel fortran インストール
Debianインストール直後ではパッケージが不足、インストールする必要がある 手順1. パッケージの追加
apt-get install libstdc++5 gcc build-essential rpm ia32-libs
実行時、確認のため、途中何回か Enter を押す 手順2. Compilerのインストール IntelCompiler_(ver).tgz をHDDにコピー、展開 l_cprof_p_(ver) へ移動 ./install.shを実行 手順3. パスを通す /etc/bashrc.bashrc に以下を追加 source /opt/intel/Compiler/(ver)/bin/ifortvars.sh intel64
追記:
Intel Comporser XE だとパスがちょっと変わって source /opt/intel/composer(ver)/bin/compilervars.sh intel64