GAMESSでテストを終わらせられるようになるまで
GAMESSのダウンロード
$ wget {tarファイルのURL} --http-user=source --http-passwd={登録でもらったパスワード}
とかでダウンロード後、
$ tar xvzf gamess-xx.tar
で解凍
MKLのインストール(Intelへの登録が必要)
http://www2.rikkyo.ac.jp/~tokiwa/menu/bioLib/library/mkl/mkl.html
https://software.intel.com/en-us/articles/installing-intel-free-libs-and-python-apt-repo
ついでにIMPIもインストールしてもいいかも
コンパイラの準備
今回はspackからgccをインストール(一緒にgfortranがインストールされる)
https://github.com/spack/spack
sudoではインストールできないので個人のフォルダに入れること
$ git clone https://github.com/spack/spack.git
$ cd spack/bin
$ ./spack install gcc
コンパイラのパスを通す
先ほどインストールしたコンパイラはspackのoptディレクトリに入っている。
$ PATH={spackのディレクトリ}/opt/spack/{システム名}/gcc-xx/gcc-xx-xx/bin:$PATH
$ export PATH
configとcompファイルの書き換え
最新版のgcc(gfortran)だとconfigで蹴られるので良しなにしてもらえるよう版に応じて適宜書き換える。
linux64のcaseの中を書き換えてください。
switch ($GMS_FORTRAN)
case gfortran:
echo "gfortran is very robust, so this is a wise choice."
(省略)
switch ($GMS_GFORTRAN_VERNO)
case 4.1:
(省略)
case 7.2:
echo " Good, the newest gfortrans can compile REAL*16 data type."
breaksw
case 7.3:
case 7.4:
default:
(省略)
switch ($GMS_FORTRAN)
case gfortran:
echo "gfortran is very robust, so this is a wise choice."
(省略)
switch ($GMS_GFORTRAN_VERNO)
case 4.1:
(省略)
case 7.2:
case 7.3:
echo " Good, the newest gfortrans can compile REAL*16 data type."
breaksw
case 7.4:
default:
(省略)
if ($TARGET == linux64) then
(省略)
switch ($GMS_FORTRAN)
case gfortran:
(省略)
switch ($GMS_GFORTRAN_VERNO)
case 4.0:
(省略)
case 7.1:
case 7.2:
set EXTRAOPT="$EXTRAOPT -w -fno-aggressive-loop-optimizations -funconstrained-commons"
breaksw
case 7.3:
case 7.4:
default:
echo Unrecognized gfortran version for linux64
exit 4
breaksw
endsw
if ($TARGET == linux64) then
(省略)
switch ($GMS_FORTRAN)
case gfortran:
(省略)
switch ($GMS_GFORTRAN_VERNO)
case 4.0:
(省略)
case 7.1:
case 7.2:
case 7.3:
set EXTRAOPT="$EXTRAOPT -w -fno-aggressive-loop-optimizations -funconstrained-commons"
breaksw
case 7.4:
default:
echo Unrecognized gfortran version for linux64
exit 4
breaksw
endsw
(任意)プロファイル用のフラグを追加しておく
GMS_DEBUG_FLAGSを立てたときに-pgフラグが入るようにする
if ($?GMS_DEBUG_FLAGS == 0) then
set GMS_DEBUG_FLAGS=''
endif
if ($?GMS_DEBUG_FLAGS == 0) then
set GMS_DEBUG_FLAGS='-pg'
endif
リンク用のプログラムを書き換える
-ldlを付けないとmklを入れることが出来ないため、これを追加する。
上と同様、GMS_DEBUG_FLAGSを立てたときに-pgフラグが入るようにする
set EXTRA_LINK_FLAGS=''
set EXTRA_MPI_LIB_FLAGS=''
set EXTRA_LINK_FLAGS='-ldl'
set EXTRA_MPI_LIB_FLAGS=''
if ($?GMS_DEBUG_FLAGS == 0) then
set EXTRA_MPI_LIB_FLAGS='-pg'
endif
config実行
$ ./config
インタラクティブに環境を聞いてくれるのでそれに従う。
今回、ddiはsocketsを利用
ddiのコンパイル
socketsの場合、生成したddikick.xをgamessのフォルダに移す。
$ cd ddi
$ ./compddi
$ mv ddikick.x ..
$ cd ..
(ddi関連のエラーが出たら)/etc/hostsに自分のhostnameが無い場合嵌るので追加しておく。ホストネームはhostname
と打てば出てくる。
127.0.0.1 {自分のhostname} localhost localhost.localdomain localhost4 localhost4.localdomain4
service restart network
(プロファイルしたいとき)install.infoにGMS_DEBUG_FLAGSを書き加える
追加
setenv GMS_DEBUG_FLAGS 1
実行時に生成したgmon.outを使って
gprof ./gamess.xxx.x gmon.out -p
などとすると、どの関数の計算で時間が掛かっているか分かる
make実行
$ make
テスト実行
$ make test
テストが新しくなっているらしい
Makeでやる方
Makefile.inに内容が書かれている
The new CHECKTEST
Exam inputs are divided into subdirectory collections. The inputs in the "standard" directory are default.
More directories can be added to easily run all tests of a certain classification such as "mp2" or "gradient". Soft links can be used if one wishes to place the same input file in two classifications.
To run a different subdirectory, specify the name on the command line
make checktest EXAM_PATH=mp2
The target "checktest" will run the exam inputs and perform the error checking. If an examXX.log file exists, it will not be rerun but only check. If the user wishes to only a few of the exams with in the chosen $(EXAM_PATH):
make checktest EXAMS=exam05
make checktest EXAMS="exam05 exam30"
To add new exam, two files are required. The chkabs script in the standard subdirectory is used by default. It is recommended that names of your input files do not exceed 10 characters. Any further characters will be dropped from the output of make checktest.
The input
$(GMS_PATH)/tests/$(EXAM_PATH)/mytest.inp
The script (use already standard/scripts/examXX scripts as templates)
$(GMS_PATH)/tests/$(EXAM_PATH)/scripts/mytest
The new exam can be run and tested by itself
make checktest EXAM_PATH=mytests EXAMS=mytest
補足
普通に計算するとき
rungmsを書き換えてパスを通す
下のように修正
set TARGET=sockets
set SCR=/scr/$USER
set USERSCR=/home/$USER/scr
set GMSPATH=/opt/gamess
参考