OCTOPUSでは、intel C/C++コンパイラ、Fortranコンパイラ、intelMPIコンパイラが利用可能です。
デフォルトで利用可能なバージョンは2022.2.1となります。旧バージョンの利用方法はこちらをご覧ください。
コンパイル コマンド
コンパイルを行う際のコマンドは、プログラミング言語ごとに異なります。
Fortran言語のコンパイルコマンドはifort、C言語のコンパイルコマンドはicc、C++言語のコンパイルコマンドはicpcとなります。
またintelMPIを利用する場合、先頭にmpiを付けたmpiifort、mpiicc、mpiicpcというコマンドとなります。
C言語 | C++言語 | Fortran言語 | |
---|---|---|---|
intelコンパイラ | icc | icpc | ifort |
intelMPIコンパイラ | mpiicc | mpiicpc | mpiifort |
使用例
コンパイラオプションを利用する場合は、[options]という個所に指定してください。
並列化なし
並列化を行わないコンパイル方法です。
$ ifort [options] source_file
$ icc [options] source_file
$ icpc [options] source_file
自動並列化
コンパイラによって自動的に並列化を行う際のコンパイル方法です。
ノード内並列(共有メモリ並列処理)となります。
$ ifort -parallel [options] source_file
$ icc -parallel [options] source_file
$ icpc -parallel [options] source_file
OpenMP
プログラムにコンパイラに対する指示行を挿入し、並列化を行う際のコンパイル方法です。
ノード内並列(共有メモリ並列処理)となります。
$ ifort -openmp [options] source_file
$ icc -qopenmp [options] source_file
$ icpc -qopenmp [options] source_file
MPI
MPI実行する並列プログラムのコンパイル方法です。
$ mpiifort [options] source_file
$ mpiicc [options] source_file
$ mpiicpc [options] source_file
MPI+自動並列化
MPIによるノード間並列プログラムを、自動並列化によって、さらにノード内並列を行う際に使用するコンパイル方法です。
ノード間並列(分散メモリ並列処理)+ノード内並列(共有メモリ並列処理)となります。
$ mpiifort -parallel [options] source_file
$ mpiicc -parallel [options] source_file
$ mpiicpc -parallel [options] source_file
MPI+OpenMP
MPIによるノード間並列プログラムを、OpenMPによって、さらにノード内並列を行う際に使用するコンパイル方法です。
ノード間並列(分散メモリ並列処理)+ノード内並列(共有メモリ並列処理)となります。
$ mpiifort -openmp [options] source_file
$ mpiicc -qopenmp [options] source_file
$ mpiicpc -qopenmp [options] source_file
おすすめオプション(すべてFortran言語コンパイラを基準に書いています)
プログラムを初めて実行する方へ
- 規定値レベルの最適化を行います。
$ ifort -O2 source_file
正常終了するプログラムを高速化したい方へ
- プログラムが高速化されます。また演算結果が変わる可能性がありますので、-O2オプション指定時と結果が変わらないか確認してください。場合によっては遅くなることもあります。
$ ifort -O3 source_file
汎用CPUノード群向けの高速化を行いたい方へ
演算結果が変わらないことをご確認の上、-O2を-O3に変更すると、更に高速化される可能性があります。
AVX-512命令を使用し、zmmレジスタを必要最小限に使用する
$ ifort -O2 -xCORE-AVX512 -qopt-zmm-usage=low source_file
AVX-512命令を使用し、zmmレジスタを制限無しに使用する
$ ifort -O2 -xCORE-AVX512 -qopt-zmm-usage=high source_file
AVX-512命令を使用せずAVX2命令を使用し、Skylakeプロセッサ向けに最適化する
$ ifort -O2 -xCORE-AVX2 -mtune=skylake-avx512 source_file
Xeon Phiノード群向けの高速化を行いたい方へ
演算結果が変わらないことをご確認の上、-O2を-O3に変更すると、更に高速化される可能性があります。
AVX-512命令を使用する
$ ifort -O2 -xMIC-AVX512 source_file
デバッグしたい方へ
$ ifort -g -traceback source_file
#(デバッグ情報、トレースバック情報が出力されます)
$ ifort -check uninit -check bounds source_file
#(実行時に初期化漏れ、配列外参照のチェック、実行時間が遅くなります。)
旧バージョンのコンパイラを利用する方法
OCTOPUSでは以下のバージョンのIntelコンパイラをご利用いただけます。
ご利用の際は、下記コマンドの実行後に「ifort」「icc」「icpc」コマンドを実行してください。
バージョン | コマンド |
14.0.2 | source /octfs/apl/Intel/psxece2013u1/bin/ifortvars.sh intel64 source /octfs/apl/Intel/psxece2013u/impi/4.1.3.048/bin64/mpivars.sh |
15.0.1 | source /octfs/apl/Intel/psxece2015u1/bin/ifortvars.sh intel64 source /octfs/apl/Intel/psxece2015u1/impi/5.0.2.044/bin64/mpivars.sh |
17.0.5 | source /octfs/apl/Intel/psxece2017u5/compilers_and_libraries_2017.5.239/linux/bin/ifortvars.sh intel64 source /octfs/apl/Intel/psxece2017u5/compilers_and_libraries_2017.5.239/linux/mpi/bin64/mpivars.sh |
18.0.3 | source /octfs/apl/Intel/psxece2018u3/compilers_and_libraries_2018.3.222/linux/bin/ifortvars.sh intel64 source /octfs/apl/Intel/psxece2018u3/compilers_and_libraries_2018.3.222/linux/mpi/bin64/mpivars.sh |
19.0.5.281 | source /octfs/apl/Intel/psxece2019u5/compilers_and_libraries_2019.5.281/linux/bin/ifortvars.sh intel64 source /octfs/apl/Intel/psxece2019u5/compilers_and_libraries_2019.5.281/linux/mpi/intel64/bin/mpivars.sh |
19.1.0.166 | source /octfs/apl/Intel/psxece2020/compilers_and_libraries_2020.0.166/linux/bin/ifortvars.sh intel64 source /octfs/apl/Intel/psxece2020/compilers_and_libraries_2020.0.166/linux/mpi/intel64/bin/mpivars.sh |
マニュアル
intelコンパイラのマニュアルについては、下記をご参照ください。
intelコンパイラマニュアル