issp-center-dev / komega Goto Github PK
View Code? Open in Web Editor NEWLibrary for solving linear problems in materials science
Home Page: https://www.pasums.issp.u-tokyo.ac.jp/komega/en/
License: GNU Lesser General Public License v3.0
Library for solving linear problems in materials science
Home Page: https://www.pasums.issp.u-tokyo.ac.jp/komega/en/
License: GNU Lesser General Public License v3.0
sekireiでbuildする際に使っているmake.sysを教えて欲しいです。
preinstallされているとはいえ、自分でも全く同じbuild作業をしておきたいです。
プリインストール版
/home/issp/materiapps/tool/Komega/Komega-2.0.0-0/
でのテストをしてみましたので、報告します。
結論から言うと、エラーなく動いたようです。
が、自分で「git clone→configure」したものとは、
ディレクトリ構成が違いました(プリインストール版は古い?)
特にsample fileが見当たりません。
以下では、sample fileは
/home/issp/materiapps/tool/Komega/Komega-1.0.0-0/sample/ShiftK/from_file
を流用しました。
Kω用の設定script
$ cat /home/issp/materiapps/tool/Komega/Komegavars.sh
. /home/issp/materiapps/tool/env.sh
export KOMEGA_ROOT=/home/issp/materiapps/tool/Komega/Komega-2.0.0-0
export PATH=$KOMEGA_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$KOMEGA_ROOT/lib:$LD_LIBRARY_PATH
Interactive job用のscript(自前)
$ cat ~/job_int.sh
#!/bin/sh
#QSUB -queue i18cpu
#QSUB -node 1
#QSUB -mpi 1
#QSUB -omp 1
#PBS -l walltime=00:30:00
#PBS -I
$ cd $PBS_O_WORKDIR
作業ディレクトリ
/home/k0099/k009900/work/20170705_Komega_wrk01
サンプルファイルのコピー
$ cp -r /home/issp/materiapps/tool/Komega/Komega-1.0.0-0/sample/ShiftK/from_file .
$ cp -rp from_file from_file_wrk01
$ cd from_file_wrk01/
$ ll
合計 6
-rw-r--r-- 1 k009900 k0099 283 7月 6 00:48 namelist.def
drwxr-xr-x 2 k009900 k0099 4096 7月 6 00:48 output
-rw-r--r-- 1 k009900 k0099 835 7月 6 00:48 zvo_Excited.dat
-rw-r--r-- 1 k009900 k0099 521 7月 6 00:48 zvo_Ham.dat
$ mv output output_ref
実行:
$ qsub ~/job_int.sh
qsub: waiting for job 765550.sekirei-pbs to start
qsub: job 765550.sekirei-pbs ready
$ script log.txt
Script started, file is log.txt
$ source /home/issp/materiapps/tool/Komega/Komegavars.sh
$ which ShiftK.out
/home/issp/materiapps/tool/Komega/Komega-2.0.0-0/bin/ShiftK.out
$ /home/issp/materiapps/tool/bin/issp-ucount Komega
$ mpijob ShiftK.out namelist.def
mpijob CMD : mpirun -f /tmp/mpiexec.params.k009900.19373
mpijob PARAMS : -d /home/k0099/k009900/work/20170705_Komega_wrk01/from_file_wrk01
r1i0n20 1 omplace -nt 1 "ShiftK.out" "namelist.def"
omplace -nt 1
r1i0n20 1
Open input file namelist.def
Number of processes : 1
Number of threads : 1
########## Input FileName ##########
Hamiltonian file : zvo_Ham.dat
Excited state file : zvo_Excited.dat
########## Input Hamiltonian ##########
Dim. of Hamiltonian : 16 16
Num. of Non-Zero Components : 20
COCG mathod is used.
########## Input Parameter for CG Iteration ##########
Maximum number of loop : 100
Convergence Threshold : 1.000000000000000E-006
########## Input Right Hand Side Vector ##########
Dim. of RHS vector : 16
########## Input Parameter for Spectrum ##########
Max. of Omega : (1.00000000000000,1.000000000000000E-002)
Min. of Omega : (0.000000000000000E+000,1.000000000000000E-002)
Num. of Omega : 100
Calculation type : normal
########## CG Initialization ##########
iter status1 status2 status3 Residual Proj. Res.
1 1 0 1 0.39527E+00 0.50000E+00
2 2 0 1 0.52678E+00 0.31762E-16
3 -3 0 1 0.20711E-13 0.92658E-16
Converged in iteration 3
########## Output Restart Parameter ##########
Num. of Iteration (Current Run) : 3
Current Omega_Seed : 0.00000E+00 0.10000E-01
########## Output Restart Vector ##########
Dim. of Residual vector : 16
$ exit
exit
Script done, file is log.txt
$ exit
logout
qsub: job 765550.sekirei-pbs completed
出力ファイル
log.txt
residual.txt
output/ResVec.dat0
output/TriDiagComp.dat
output/dynamicalG.dat
および、もとからあったoutput file
output_ref/ResVec.dat0
output_ref/TriDiagComp.dat
output_ref/dynamicalG.dat
をパッケージ化:
→data_komega_test_20170706.tgz.zip
→添付
komegaのv2.0.0でバグと思われるところを発見したので,ご報告いたします.
COCG法の計算を複数回行ったところ,2回目のkomega_COCG_initの呼び出し時に
At line 167 of file komega_cocg.F90
Fortran runtime error: Attempting to allocate already allocated variable 'lz_conv'
というエラーが出て,プログラムが終了しました.
komega_cocg.F90を確認してみたところ,komega_COCG_finalizeが
SUBROUTINE komega_COCG_finalize() BIND(C)
!
USE komega_parameter, ONLY : itermax, lz_conv
USE komega_vals_c, ONLY : alpha_save, beta_save, &
& pi, pi_old, pi_save, z
USE komega_vecs_c, ONLY : p, r_l_save, v3
!
IMPLICIT NONE
!
DEALLOCATE(z, v3, pi, pi_old, p)
!
IF(itermax > 0) THEN
DEALLOCATE(alpha_save, beta_save, r_l_save, pi_save, lz_conv)
END IF
!
END SUBROUTINE komega_COCG_finalize
となっており,itermax=0の場合に,lz_convの開放が行われていないことが原因のようでした.
if文の外に DEALLOCATE(lz_conv) を書き足したら,正しく動作するようになりました.
皆様
インストールに関していくつか要望がありましたので、Autoconfを使った半自動インストールに対応したバージョンをリリースしました。
インターフェースに関しても変更があったのでメジャーアップデートとしました。
https://github.com/issp-center-dev/Komega/releases/tag/v2.0.0
詳しくはマニュアルをご覧ください。
星(鳥取大)です。
Kωの単体利用について、手元のMacで試してみた所、エラーがでました。
FFLAGS=-fopenmp -cpp -g -lblas -llapack
での実行でerrorがでて、詳細をしらべるため、
デバックオプション
FFLAGS=-fopenmp -cpp -g -lblas -llapack -Wall -pedantic -fbounds-check -fbacktrace -O -Wuninitialized -ffpe-trap=invalid,zero,overflow
で試したところ、
At line 106 of file ham_prod.f90
Fortran runtime error: Index '1' of dimension 1 of array 'veco' above upper bound of 0
がでました。
app/src/ham_prod.f90
を調べたところ、
SUBROUTINE ham_prod(veci,veco)
!
USE shiftk_vals, ONLY : ndim, inham
!
IMPLICIT NONE
!
COMPLEX(8),INTENT(IN) :: veci(ndim)
COMPLEX(8),INTENT(OUT) :: veco(ndim)
における、ndimがゼロになっていました。
よろしくお願いします。
以下、作業ログです。
commit : f1e1739 on 15 Feb
gfortranのバージョン表示:
$ gfortran -v
組み込み spec を使用しています。
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-apple-darwin12.4.0/4.8.1/lto-wrapper
ターゲット: x86_64-apple-darwin12.4.0
configure 設定: ../gcc-4.8.1/configure --enable-languages=fortran,c++
スレッドモデル: posix
gcc バージョン 4.8.1 (GCC)
gitを用いての作業:
$ git clone https://github.com/issp-center-dev/Komega
$ cd Komega/
$ cp make.sys.in make.sys
make.sysを編集:comment以外は以下の2行
F90=gfortran
FFLAGS=-fopenmp -cpp -g -lblas -llapack -Wall -pedantic -fbounds-check -fbacktrace -O -Wuninitialized -ffpe-trap=invalid,zero,overflow
実行ファイルができる
Komega/app/src/ShiftK.out
$ ../../src/ShiftK.out namelist.def
Open input file namelist.def
Number of processes : 1
Number of threads : 4
########## Input FileName ##########
Hamiltonian file : zvo_Ham.dat
Excited state file : zvo_Excited.dat
########## Input Hamiltonian ##########
Dim. of Hamiltonian : 16 16
Num. of Non-Zero Components : 20
COCG mathod is used.
########## Input Parameter for CG Iteration ##########
Maximum number of loop : 100
Convergence Threshold : 9.9999999999999995E-007
########## Input Right Hand Side Vector ##########
Dim. of RHS vector : 16
########## Input Parameter for Spectrum ##########
Max. of Omega : ( 1.0000000000000000 , 1.0000000000000000E-002)
Min. of Omega : ( 0.0000000000000000 , 1.0000000000000000E-002)
Num. of Omega : 100
Calculation type : normal
########## CG Initialization ##########
iter status1 status2 status3 Residual Proj. Res.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.