diff --git a/README.md b/README.md index 6c27753d..a2d3d6dc 100644 --- a/README.md +++ b/README.md @@ -163,3 +163,6 @@ It's caused when we call the DGEMM routine of LAPACK. Set `ulimit -s unlimited`, before runing `qp_run`. It seems to fix the problem. +#### Error: f77zmq not symbol found + +In the Makefile of the f77zmq, you should NOT use ar but `libtool -static` diff --git a/config/ifort.cfg b/config/ifort.cfg index b94d0cd4..0c630114 100644 --- a/config/ifort.cfg +++ b/config/ifort.cfg @@ -32,7 +32,7 @@ OPENMP : 1 ; Append OpenMP flags # [OPT] FC : -traceback -FCFLAGS : -xSSE4.2 -O2 -ip -ftz -g +FCFLAGS : -xAVX -O2 -ip -ftz -g # Profiling flags ################# diff --git a/configure b/configure index 9bc8f24b..99a98261 100755 --- a/configure +++ b/configure @@ -76,6 +76,11 @@ from collections import namedtuple Info = namedtuple("Info", ["url", "description", "default_path"]) path_github = {"head": "http://github.com", "tail": "archive/master.tar.gz"} +def path_gitlab(user,project,branch): + """For example, + https://gitlab.com/scemama/resultsFile/-/archive/master/resultsFile-master.tar.gz + """ + return "http://gitlab.com/%(user)s/%(project)s/-/archive/%(branch)s/%(project)s-%(branch)s.tar.gz"%locals() ocaml = Info( url='http://raw.github.com/ocaml/opam/master/shell/opam_installer.sh', @@ -113,7 +118,7 @@ docopt = Info( default_path=join(QP_ROOT_INSTALL, "docopt")) resultsFile = Info( - url='{head}/LCPQ/resultsFile/{tail}'.format(**path_github), + url=path_gitlab("scemama","resultsFile","master"), description=' resultsFile', default_path=join(QP_ROOT_INSTALL, "resultsFile")) @@ -128,17 +133,17 @@ emsl = Info( default_path=join(QP_ROOT_INSTALL, "emsl")) ezfio = Info( - url='{head}/LCPQ/EZFIO/{tail}'.format(**path_github), + url=path_gitlab("scemama","EZFIO","master"), description=' EZFIO', default_path=join(QP_ROOT_INSTALL, "EZFIO")) zeromq = Info( - url='https://github.com/zeromq/zeromq4-1/releases/download/v4.1.5/zeromq-4.1.5.tar.gz', + url='https://github.com/zeromq/libzmq/archive/v4.2.5.tar.gz', description=' ZeroMQ', default_path=join(QP_ROOT_LIB, "libzmq.a")) gmp= Info( - url='https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2', + url='ftp://ftp.gnu.org/gnu/gmp/gmp-6.1.2.tar.bz2', description=' The GNU Multiple Precision Arithmetic Library', default_path=join(QP_ROOT_LIB, "libgmp.a")) @@ -487,9 +492,12 @@ def create_ninja_and_rc(l_installed): 'export IRPF90={0}'.format(path_irpf90.replace(QP_ROOT,"${QP_ROOT}")), 'export NINJA={0}'.format(path_ninja.replace(QP_ROOT,"${QP_ROOT}")), 'function qp_prepend_export () {', - ' #Prepend path $2:${!1}. Add the semicolon only if ${!1} is defined', - ' eval "value_1=\"\${$1}\""', - ' echo ${value_1:+${value_1}:}${2}', + 'eval "value_1="\${$1}""', + 'if [[ -z $value_1 ]] ; then', + ' echo "${2}:"', + 'else', + ' echo "${2}:${value_1}"', + 'fi', '}', 'export PYTHONPATH=$(qp_prepend_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PYTHON}")', 'export PATH=$(qp_prepend_export "PATH" "${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml)', diff --git a/data/basis/6-31+g b/data/basis/6-31+g new file mode 100644 index 00000000..0b89d6e3 --- /dev/null +++ b/data/basis/6-31+g @@ -0,0 +1,635 @@ +$DATA +HYDROGEN +S 3 + 1 18.7311370 0.03349460 + 2 2.8253937 0.23472695 + 3 0.6401217 0.81375733 +S 1 + 1 0.1612778 1.0000000 + +HELIUM +S 3 + 1 38.4216340 0.0237660 + 2 5.7780300 0.1546790 + 3 1.2417740 0.4696300 +S 1 + 1 0.2979640 1.0000000 + +LITHIUM +S 6 + 1 642.4189200 0.0021426 + 2 96.7985150 0.0162089 + 3 22.0911210 0.0773156 + 4 6.2010703 0.2457860 + 5 1.9351177 0.4701890 + 6 0.6367358 0.3454708 +S 3 + 1 2.3249184 -0.0350917 + 2 0.6324306 -0.1912328 + 3 0.0790534 1.0839878 +P 3 + 1 2.3249184 0.0089415 + 2 0.6324306 0.1410095 + 3 0.0790534 0.9453637 +S 1 + 1 0.0359620 1.0000000 +P 1 + 1 0.0359620 1.0000000 +S 1 + 1 0.0074000 1.0000000 +P 1 + 1 0.0074000 1.0000000 + +BERYLLIUM +S 6 + 1 1264.5857000 0.0019448 + 2 189.9368100 0.0148351 + 3 43.1590890 0.0720906 + 4 12.0986630 0.2371542 + 5 3.8063232 0.4691987 + 6 1.2728903 0.3565202 +S 3 + 1 3.1964631 -0.1126487 + 2 0.7478133 -0.2295064 + 3 0.2199663 1.1869167 +P 3 + 1 3.1964631 0.0559802 + 2 0.7478133 0.2615506 + 3 0.2199663 0.7939723 +S 1 + 1 0.0823099 1.0000000 +P 1 + 1 0.0823099 1.0000000 +S 1 + 1 0.0207000 1.0000000 +P 1 + 1 0.0207000 1.0000000 + +BORON +S 6 + 1 2068.8823000 0.0018663 + 2 310.6495700 0.0142515 + 3 70.6830330 0.0695516 + 4 19.8610800 0.2325729 + 5 6.2993048 0.4670787 + 6 2.1270270 0.3634314 +S 3 + 1 4.7279710 -0.1303938 + 2 1.1903377 -0.1307889 + 3 0.3594117 1.1309444 +P 3 + 1 4.7279710 0.0745976 + 2 1.1903377 0.3078467 + 3 0.3594117 0.7434568 +S 1 + 1 0.1267512 1.0000000 +P 1 + 1 0.1267512 1.0000000 +S 1 + 1 0.0315000 1.0000000 +P 1 + 1 0.0315000 1.0000000 + +CARBON +S 6 + 1 3047.5249000 0.0018347 + 2 457.3695100 0.0140373 + 3 103.9486900 0.0688426 + 4 29.2101550 0.2321844 + 5 9.2866630 0.4679413 + 6 3.1639270 0.3623120 +S 3 + 1 7.8682724 -0.1193324 + 2 1.8812885 -0.1608542 + 3 0.5442493 1.1434564 +P 3 + 1 7.8682724 0.0689991 + 2 1.8812885 0.3164240 + 3 0.5442493 0.7443083 +S 1 + 1 0.1687144 1.0000000 +P 1 + 1 0.1687144 1.0000000 +S 1 + 1 0.0438000 1.0000000 +P 1 + 1 0.0438000 1.0000000 + +NITROGEN +S 6 + 1 4173.5110000 0.0018348 + 2 627.4579000 0.0139950 + 3 142.9021000 0.0685870 + 4 40.2343300 0.2322410 + 5 12.8202100 0.4690700 + 6 4.3904370 0.3604550 +S 3 + 1 11.6263580 -0.1149610 + 2 2.7162800 -0.1691180 + 3 0.7722180 1.1458520 +P 3 + 1 11.6263580 0.0675800 + 2 2.7162800 0.3239070 + 3 0.7722180 0.7408950 +S 1 + 1 0.2120313 1.0000000 +P 1 + 1 0.2120313 1.0000000 +S 1 + 1 0.0639000 1.0000000 +P 1 + 1 0.0639000 1.0000000 + +OXYGEN +S 6 + 1 5484.6717000 0.0018311 + 2 825.2349500 0.0139501 + 3 188.0469600 0.0684451 + 4 52.9645000 0.2327143 + 5 16.8975700 0.4701930 + 6 5.7996353 0.3585209 +S 3 + 1 15.5396160 -0.1107775 + 2 3.5999336 -0.1480263 + 3 1.0137618 1.1307670 +P 3 + 1 15.5396160 0.0708743 + 2 3.5999336 0.3397528 + 3 1.0137618 0.7271586 +S 1 + 1 0.2700058 1.0000000 +P 1 + 1 0.2700058 1.0000000 +S 1 + 1 0.0845000 1.0000000 +P 1 + 1 0.0845000 1.0000000 + +FLUORINE +S 6 + 1 7001.7130900 0.0018196169 + 2 1051.3660900 0.0139160796 + 3 239.2856900 0.0684053245 + 4 67.3974453 0.233185760 + 5 21.5199573 0.471267439 + 6 7.40310130 0.356618546 +S 3 + 1 20.8479528 -0.108506975 + 2 4.80830834 -0.146451658 + 3 1.34406986 1.128688580 +P 3 + 1 20.8479528 0.0716287243 + 2 4.80830834 0.3459121030 + 3 1.34406986 0.7224699570 +S 1 + 1 0.358151393 1.0000000 +P 1 + 1 0.358151393 1.0000000 +S 1 + 1 0.1076000 1.0000000 +P 1 + 1 0.1076000 1.0000000 + +NEON +S 6 + 1 8425.8515300 0.0018843481 + 2 1268.5194000 0.0143368994 + 3 289.6214140 0.0701096233 + 4 81.8590040 0.2373732660 + 5 26.2515079 0.4730071260 + 6 9.09472051 0.3484012410 +S 3 + 1 26.5321310 -0.107118287 + 2 6.10175501 -0.146163821 + 3 1.69627153 1.127773500 +P 3 + 1 26.5321310 0.0719095885 + 2 6.10175501 0.3495133720 + 3 1.69627153 0.7199405120 +S 1 + 1 0.44581870 1.0000000 +P 1 + 1 0.44581870 1.0000000 +S 1 + 1 0.1300000 1.0000000 +P 1 + 1 0.1300000 1.0000000 + +SODIUM +S 6 + 1 9993.2000000 0.0019377 + 2 1499.8900000 0.0148070 + 3 341.9510000 0.0727060 + 4 94.6797000 0.2526290 + 5 29.7345000 0.4932420 + 6 10.0063000 0.3131690 +S 6 + 1 150.9630000 -0.0035421 + 2 35.5878000 -0.0439590 + 3 11.1683000 -0.1097521 + 4 3.9020100 0.1873980 + 5 1.3817700 0.6466990 + 6 0.4663820 0.3060580 +P 6 + 1 150.9630000 0.0050017 + 2 35.5878000 0.0355110 + 3 11.1683000 0.1428250 + 4 3.9020100 0.3386200 + 5 1.3817700 0.4515790 + 6 0.4663820 0.2732710 +S 3 + 1 0.4979660 -0.2485030 + 2 0.0843530 -0.1317040 + 3 0.0666350 1.2335200 +P 3 + 1 0.4979660 -0.0230230 + 2 0.0843530 0.9503590 + 3 0.0666350 0.0598580 +S 1 + 1 0.0259544 1.0000000 +P 1 + 1 0.0259544 1.0000000 +S 1 + 1 0.0076000 1.0000000 +P 1 + 1 0.0076000 1.0000000 + +MAGNESIUM +S 6 + 1 11722.8000000 0.0019778 + 2 1759.9300000 0.0151140 + 3 400.8460000 0.0739110 + 4 112.8070000 0.2491910 + 5 35.9997000 0.4879280 + 6 12.1828000 0.3196620 +S 6 + 1 189.1800000 -0.0032372 + 2 45.2119000 -0.0410080 + 3 14.3563000 -0.1126000 +P 6 + 1 189.1800000 0.0049281 + 2 45.2119000 0.0349890 + 3 14.3563000 0.1407250 + 4 5.1388600 0.1486330 0.3336420 + 5 1.9065200 0.6164970 0.4449400 + 6 0.7058870 0.3648290 0.2692540 +S 3 + 1 0.9293400 -0.2122900 + 2 0.2690350 -0.1079850 + 3 0.1173790 1.1758400 +P 3 + 1 0.9293400 -0.0224190 + 2 0.2690350 0.1922700 + 3 0.1173790 0.8461810 +S 1 + 1 0.0421061 1.0000000 +P 1 + 1 0.0421061 1.0000000 +S 1 + 1 0.0146000 1.0000000 +P 1 + 1 0.0146000 1.0000000 + +ALUMINUM +S 6 + 1 13983.1000000 0.00194267 + 2 2098.7500000 0.0148599 + 3 477.7050000 0.0728494 + 4 134.3600000 0.2468300 + 5 42.8709000 0.4872580 + 6 14.5189000 0.3234960 +S 6 + 1 239.6680000 -0.00292619 + 2 57.4419000 -0.0374080 + 3 18.2859000 -0.1144870 + 4 6.5991400 0.1156350 + 5 2.4904900 0.6125950 + 6 0.9445400 0.3937990 +P 6 + 1 239.6680000 0.00460285 + 2 57.4419000 0.0331990 + 3 18.2859000 0.1362820 + 4 6.5991400 0.3304760 + 5 2.4904900 0.4491460 + 6 0.9445400 0.2657040 +S 3 + 1 1.2779000 -0.2276060 + 2 0.3975900 0.00144583 + 3 0.1600950 1.0927900 +P 3 + 1 1.2779000 -0.0175130 + 2 0.3975900 0.2445330 + 3 0.1600950 0.8049340 +S 1 + 1 0.0556577 1.0000000 +P 1 + 1 0.0556577 1.0000000 +S 1 + 1 0.0318000 1.0000000 +P 1 + 1 0.0318000 1.0000000 + +SILICON +S 6 + 1 16115.9000000 0.00195948 + 2 2425.5800000 0.01492880 + 3 553.8670000 0.07284780 + 4 156.3400000 0.24613000 + 5 50.0683000 0.48591400 + 6 17.0178000 0.32500200 +S 6 + 1 292.7180000 -0.00278094 + 2 69.8731000 -0.03571460 + 3 22.3363000 -0.11498500 + 4 8.1503900 0.09356340 + 5 3.1345800 0.60301700 + 6 1.2254300 0.41895900 +P 6 + 1 292.7180000 0.00443826 + 2 69.8731000 0.03266790 + 3 22.3363000 0.13472100 + 4 8.1503900 0.32867800 + 5 3.1345800 0.44964000 + 6 1.2254300 0.26137200 +S 3 + 1 1.7273800 -0.24463000 + 2 0.5729220 0.00431572 + 3 0.2221920 1.09818000 +P 3 + 1 1.7273800 -0.01779510 + 2 0.5729220 0.25353900 + 3 0.2221920 0.80066900 +S 1 + 1 0.0778369 1.00000000 +P 1 + 1 0.0778369 1.00000000 +S 1 + 1 0.0331000 1.0000000 +P 1 + 1 0.0331000 1.0000000 + +PHOSPHOROUS +S 6 + 1 19413.3000000 0.0018516 + 2 2909.4200000 0.0142062 + 3 661.3640000 0.0699995 + 4 185.7590000 0.2400790 + 5 59.1943000 0.4847620 + 6 20.0310000 0.3352000 +S 6 + 1 339.4780000 -0.00278217 + 2 81.0101000 -0.0360499 + 3 25.8780000 -0.1166310 + 4 9.4522100 0.0968328 + 5 3.6656600 0.6144180 + 6 1.4674600 0.4037980 +P 6 + 1 339.4780000 0.00456462 + 2 81.0101000 0.03369360 + 3 25.8780000 0.13975500 + 4 9.4522100 0.33936200 + 5 3.6656600 0.45092100 + 6 1.4674600 0.23858600 +S 3 + 1 2.1562300 -0.2529230 + 2 0.7489970 0.0328517 + 3 0.2831450 1.0812500 +P 3 + 1 2.1562300 -0.01776530 + 2 0.7489970 0.27405800 + 3 0.2831450 0.78542100 +S 1 + 1 0.0998317 1.0000000 +P 1 + 1 0.0998317 1.0000000 +S 1 + 1 0.0348000 1.0000000 +P 1 + 1 0.0348000 1.0000000 + +SULFUR +S 6 + 1 21917.1000000 0.0018690 + 2 3301.4900000 0.0142300 + 3 754.1460000 0.0696960 + 4 212.7110000 0.2384870 + 5 67.9896000 0.4833070 + 6 23.0515000 0.3380740 +S 6 + 1 423.7350000 -0.0023767 + 2 100.7100000 -0.0316930 + 3 32.1599000 -0.1133170 + 4 11.8079000 0.0560900 + 5 4.6311000 0.5922550 + 6 1.8702500 0.4550060 +P 6 + 1 423.7350000 0.0040610 + 2 100.7100000 0.0306810 + 3 32.1599000 0.1304520 + 4 11.8079000 0.3272050 + 5 4.6311000 0.4528510 + 6 1.8702500 0.2560420 +S 3 + 1 2.6158400 -0.2503740 + 2 0.9221670 0.0669570 + 3 0.3412870 1.0545100 +P 3 + 1 2.6158400 -0.0145110 + 2 0.9221670 0.3102630 + 3 0.3412870 0.7544830 +S 1 + 1 0.1171670 1.0000000 +P 1 + 1 0.1171670 1.0000000 +S 1 + 1 0.0405000 1.0000000 +P 1 + 1 0.0405000 1.0000000 + +CHLORINE +S 6 + 1 25180.1000000 0.0018330 + 2 3780.3500000 0.0140340 + 3 860.4740000 0.0690970 + 4 242.1450000 0.2374520 + 5 77.3349000 0.4830340 + 6 26.2470000 0.3398560 +S 6 + 1 491.7650000 -0.0022974 + 2 116.9840000 -0.0307140 + 3 37.4153000 -0.1125280 + 4 13.7834000 0.0450160 + 5 5.4521500 0.5893530 + 6 2.2258800 0.4652060 +P 6 + 1 491.7650000 0.0039894 + 2 116.9840000 0.0303180 + 3 37.4153000 0.1298800 + 4 13.7834000 0.3279510 + 5 5.4521500 0.4535270 + 6 2.2258800 0.2521540 +S 3 + 1 3.1864900 -0.2518300 + 2 1.1442700 0.0615890 + 3 0.4203770 1.0601800 +P 3 + 1 3.1864900 -0.0142990 + 2 1.1442700 0.3235720 + 3 0.4203770 0.7435070 +S 1 + 1 0.1426570 1.0000000 +P 1 + 1 0.1426570 1.0000000 +S 1 + 1 0.0483000 1.0000000 +P 1 + 1 0.0483000 1.0000000 + +ARGON +S 6 + 1 28348.3000000 0.00182526 + 2 4257.6200000 0.01396860 + 3 969.8570000 0.06870730 + 4 273.2630000 0.23620400 + 5 87.3695000 0.48221400 + 6 29.6867000 0.34204300 +S 6 + 1 575.8910000 -0.00215972 + 2 136.8160000 -0.02907750 + 3 43.8098000 -0.11082700 + 4 16.2094000 0.02769990 + 5 6.4608400 0.57761300 + 6 2.6511400 0.48868800 +P 6 + 1 575.8910000 0.00380665 + 2 136.8160000 0.02923050 + 3 43.8098000 0.12646700 + 4 16.2094000 0.32351000 + 5 6.4608400 0.45489600 + 6 2.6511400 0.25663000 +S 3 + 1 3.8602800 -0.2555920 + 2 1.4137300 0.0378066 + 3 0.5166460 1.0805600 +P 3 + 1 3.8602800 -0.01591970 + 2 1.4137300 0.32464600 + 3 0.5166460 0.74399000 +S 1 + 1 0.1738880 1.0000000 +P 1 + 1 0.1738880 1.0000000 +S 1 + 1 0.0600000 1.0000000 +P 1 + 1 0.0600000 1.0000000 + +POTASSIUM +S 6 + 1 31594.4200000 1.828010E-03 + 2 4744.3300000 1.399403E-02 + 3 1080.4190000 6.887129E-02 + 4 304.2338000 2.369760E-01 + 5 97.2458600 4.829040E-01 + 6 33.0249500 3.404795E-01 +S 6 + 1 622.7625000 -2.502976E-03 + 2 147.8839000 -3.315550E-02 + 3 47.3273500 -1.226387E-01 + 4 17.5149500 5.353643E-02 + 5 6.9227220 6.193860E-01 + 6 2.7682770 4.345878E-01 +P 6 + 1 622.7625000 4.094637E-03 + 2 147.8839000 3.145199E-02 + 3 47.3273500 1.351558E-01 + 4 17.5149500 3.390500E-01 + 5 6.9227220 4.629455E-01 + 6 2.7682770 2.242638E-01 +S 6 + 1 11.8480200 1.277689E-02 + 2 4.0792110 2.098767E-01 + 3 1.7634810 -3.095274E-03 + 4 0.7889270 -5.593884E-01 + 5 0.3503870 -5.134760E-01 + 6 0.1463440 -6.598035E-02 +P 6 + 1 11.8480200 -1.221377E-02 + 2 4.0792110 -6.900537E-03 + 3 1.7634810 2.007466E-01 + 4 0.7889270 4.281332E-01 + 5 0.3503870 3.970156E-01 + 6 0.1463440 1.104718E-01 +S 3 + 1 0.7168010 -5.237772E-02 + 2 0.2337410 -2.798503E-01 + 3 0.0386750 1.141547E+00 +P 3 + 1 0.7168010 0.0316430 + 2 0.2337410 -0.0404616 + 3 0.0386750 1.0120290 +S 1 + 1 0.0165210 1.000000E+00 +P 1 + 1 0.0165210 1.000000E+00 +S 1 + 1 0.0047000 1.0000000 +P 1 + 1 0.0047000 1.0000000 + +CALCIUM +S 6 + 1 35264.8600000 1.813501E-03 + 2 5295.5030000 1.388493E-02 + 3 1206.0200000 6.836162E-02 + 4 339.6839000 2.356188E-01 + 5 108.6264000 4.820639E-01 + 6 36.9210300 3.429819E-01 +S 6 + 1 706.3096000 2.448225E-03 + 2 167.8187000 3.241504E-02 + 3 53.8255800 1.226219E-01 + 4 20.0163800 -4.316965E-02 + 5 7.9702790 -6.126995E-01 + 6 3.2120590 -4.487540E-01 +P 6 + 1 706.3096000 4.020371E-03 + 2 167.8187000 3.100601E-02 + 3 53.8255800 1.337279E-01 + 4 20.0163800 3.367983E-01 + 5 7.9702790 4.631281E-01 + 6 3.2120590 2.257532E-01 +S 6 + 1 14.1951800 1.084500E-02 + 2 4.8808280 2.088333E-01 + 3 2.1603900 3.150338E-02 + 4 0.9878990 -5.526518E-01 + 5 0.4495170 -5.437997E-01 + 6 0.1873870 -6.669342E-02 +P 6 + 1 14.1951800 -1.289621E-02 + 2 4.8808280 -1.025198E-02 + 3 2.1603900 1.959781E-01 + 4 0.9878990 4.357933E-01 + 5 0.4495170 3.996452E-01 + 6 0.1873870 9.713636E-02 +S 3 + 1 1.0322710 -4.439720E-02 + 2 0.3811710 -3.284563E-01 + 3 0.0651310 1.163010E+00 +P 3 + 1 1.0322710 -0.4298621 + 2 0.3811710 0.006935829 + 3 0.0651310 0.9705933 +S 1 + 1 0.0260100 1.000000E+00 +P 1 + 1 0.0260100 1.000000E+00 +S 1 + 1 0.0071000 1.0000000 +P 1 + 1 0.0071000 1.0000000 +$END + + + diff --git a/data/basis/ncsu-vdz b/data/basis/ncsu-vdz new file mode 100644 index 00000000..7ae71203 --- /dev/null +++ b/data/basis/ncsu-vdz @@ -0,0 +1,1303 @@ +CARBON +S 9 1.00 +1 13.073594 0.0051583 +2 6.541187 0.0603424 +3 4.573411 -0.1978471 +4 1.637494 -0.0810340 +5 0.819297 0.2321726 +6 0.409924 0.2914643 +7 0.231300 0.4336405 +8 0.102619 0.2131940 +9 0.051344 0.0049848 +S 1 1.00 +1 0.127852 1.000000 +P 9 1.00 +1 9.934169 0.0209076 +2 3.886955 0.0572698 +3 1.871016 0.1122682 +4 0.935757 0.2130082 +5 0.468003 0.2835815 +6 0.239473 0.3011207 +7 0.117063 0.2016934 +8 0.058547 0.0453575 +9 0.029281 0.0029775 +P 1 1.00 +1 0.149161 1.000000 +D 1 1.00 +1 0.561160 1.000000 + +CHLORINE +S 10 1.000 + 1 0.122096 0.175451 + 2 0.289394 0.607210 + 3 0.657228 0.465346 + 4 1.167709 -0.079460 + 5 2.719209 -0.339622 + 6 5.564288 0.092975 + 7 11.667080 -0.010906 + 8 25.009418 -0.000807 + 9 53.798061 -0.000189 +10 99.938947 0.000063 +S 1 1.000 +1 0.116260 1.000 +P 10 1.000 + 1 0.075272 0.093475 + 2 0.177298 0.343672 + 3 0.389880 0.404212 + 4 0.775457 0.251867 + 5 1.391339 0.073840 + 6 3.017894 -0.068164 + 7 6.140684 0.014679 + 8 12.639835 0.000722 + 9 26.439040 -0.001040 + 10 52.945707 -0.000037 +P 1 1.000 +1 0.163092 1.000 +D 1 1.000 +1 0.636871 1.000 + +COBALT +S 13 1.000 +1 90.138338 0.000870 +2 46.360154 -0.012889 +3 23.733997 0.114398 +4 14.381697 -0.098019 +5 8.774183 -0.352394 +6 4.485868 -0.094570 +7 2.536663 0.500662 +8 1.239271 0.608796 +9 0.599131 0.189026 +10 0.224507 0.005508 +11 0.124709 -0.000242 +12 0.060740 -0.000070 +13 0.028274 0.000031 +S 13 1.000 +1 90.138338 -0.000171 +2 46.360154 0.002859 +3 23.733997 -0.027465 +4 14.381697 0.026028 +5 8.774183 0.087563 +6 4.485868 0.018143 +7 2.536663 -0.134608 +8 1.239271 -0.233508 +9 0.599131 -0.163697 +10 0.224507 0.120841 +11 0.124709 0.394955 +12 0.060740 0.509928 +13 0.028274 0.150457 +S 13 1.000 +1 90.138338 -0.000093 +2 46.360154 0.004385 +3 23.733997 -0.052442 +4 14.381697 0.044798 +5 8.774183 0.213744 +6 4.485868 -0.005708 +7 2.536663 -0.327530 +8 1.239271 -0.679295 +9 0.599131 0.252601 +10 0.224507 1.215183 +11 0.124709 0.250644 +12 0.060740 -0.593655 +13 0.028274 -0.588728 +S 1 1.000 +1 0.028274 1.0 +S 1 1.000 +1 0.014 1.0 +P 13 1.000 +1 139.014951 0.000085 +2 71.647198 -0.000721 +3 37.453971 0.006545 +4 20.948358 -0.009990 +5 13.091607 -0.084075 +6 6.797915 0.009770 +7 3.804866 0.282493 +8 1.960048 0.436288 +9 1.003909 0.313331 +10 0.508607 0.089041 +11 0.234227 0.007472 +12 0.083922 0.000983 +13 0.040103 0.000275 +P 13 1.000 +1 139.014951 0.000025 +2 71.647198 -0.000075 +3 37.453971 -0.000603 +4 20.948358 0.000027 +5 13.091607 0.022667 +6 6.797915 -0.011149 +7 3.804866 -0.056513 +8 1.960048 -0.127222 +9 1.003909 -0.059476 +10 0.508607 -0.037982 +11 0.234227 0.352856 +12 0.083922 0.508744 +13 0.040103 0.292061 +P 13 1.000 +1 139.014951 -0.000240 +2 71.647198 0.001541 +3 37.453971 -0.009509 +4 20.948358 0.025569 +5 13.091607 0.060650 +6 6.797915 -0.016616 +7 3.804866 -0.429847 +8 1.960048 -0.412446 +9 1.003909 0.088445 +10 0.508607 1.072784 +11 0.234227 0.014565 +12 0.083922 -0.720502 +13 0.040103 -0.024392 +P 1 1.000 +1 0.040103 1.0 +P 1 1.000 +1 0.019 1.0 +D 11 1.000 +1 160.454443 0.000034 +2 52.961426 0.006240 +3 27.614188 0.034177 +4 12.737767 0.082700 +5 6.178095 0.177253 +6 3.025327 0.264353 +7 1.472888 0.292424 +8 0.714500 0.249507 +9 0.348985 0.171514 +10 0.173869 0.082044 +11 0.086676 0.040249 +D 11 1.000 +1 160.454443 -0.000033 +2 52.961426 -0.007451 +3 27.614188 -0.039607 +4 12.737767 -0.100623 +5 6.178095 -0.216952 +6 3.025327 -0.284736 +7 1.472888 -0.128478 +8 0.714500 0.176611 +9 0.348985 0.374429 +10 0.173869 0.291413 +11 0.086676 0.196435 +D 1 1.000 +1 0.086676 1.0 +D 1 1.000 +1 0.043 1.0 +F 1 1.000 +1 0.557366 1.0 +F 1 1.000 +1 2.011165 1.0 + +CHROMIUM +S 13 1.000 +1 73.977737 0.000864 +2 37.684349 -0.011595 +3 19.278723 0.090467 +4 12.130763 -0.024837 +5 7.453002 -0.330407 +6 3.756296 -0.200598 +7 2.084137 0.449766 +8 0.993314 0.647575 +9 0.483094 0.229025 +10 0.225854 0.009217 +11 0.115338 0.001132 +12 0.052134 -0.000367 +13 0.023679 0.000092 +S 13 1.000 +1 73.977737 -0.000183 +2 37.684349 0.002704 +3 19.278723 -0.022650 +4 12.130763 0.007181 +5 7.453002 0.087705 +6 3.756296 0.047616 +7 2.084137 -0.125672 +8 0.993314 -0.244571 +9 0.483094 -0.198419 +10 0.225854 0.030889 +11 0.115338 0.423935 +12 0.052134 0.576941 +13 0.023679 0.148323 +S 13 1.000 +1 73.977737 -0.000327 +2 37.684349 0.005309 +3 19.278723 -0.046905 +4 12.130763 0.015411 +5 7.453002 0.191697 +6 3.756296 0.099759 +7 2.084137 -0.338994 +8 0.993314 -0.695806 +9 0.483094 -0.007315 +10 0.225854 1.118599 +11 0.115338 0.717257 +12 0.052134 -0.868565 +13 0.023679 -0.467186 +S 1 1.000 +1 0.023679 1.0 +S 1 1.000 +1 0.011 1.0 +P 13 1.000 +1 101.951240 0.000088 +2 52.309865 -0.000747 +3 27.142574 0.007135 +4 15.066862 -0.014702 +5 9.693669 -0.073353 +6 4.985710 0.012007 +7 2.761266 0.283117 +8 1.417673 0.440786 +9 0.728201 0.306775 +10 0.378189 0.081804 +11 0.189359 0.008839 +12 0.072301 0.001022 +13 0.037471 0.000325 +P 13 1.000 +1 101.951240 0.000028 +2 52.309865 -0.000085 +3 27.142574 -0.000751 +4 15.066862 0.000844 +5 9.693669 0.022656 +6 4.985710 -0.012781 +7 2.761266 -0.062386 +8 1.417673 -0.143581 +9 0.728201 -0.062281 +10 0.378189 -0.054471 +11 0.189359 0.377135 +12 0.072301 0.471633 +13 0.037471 0.311624 +P 13 1.000 +1 101.951240 -0.000137 +2 52.309865 0.000932 +3 27.142574 -0.006845 +4 15.066862 0.019831 +5 9.693669 0.043647 +6 4.985710 -0.019289 +7 2.761266 -0.281187 +8 1.417673 -0.370298 +9 0.728201 -0.199873 +10 0.378189 1.028552 +11 0.189359 0.423711 +12 0.072301 -0.800926 +13 0.037471 -0.141910 +P 1 1.000 +1 0.037471 1.0 +P 1 1.000 +1 0.018 1.0 +D 11 1.000 +1 120.683729 -0.000006 +2 42.646591 0.003111 +3 21.154405 0.028641 +4 9.708242 0.076222 +5 4.614990 0.170595 +6 2.243726 0.266908 +7 1.086491 0.311039 +8 0.524700 0.267312 +9 0.255752 0.163336 +10 0.121497 0.062782 +11 0.054339 0.007872 +D 11 1.000 +1 120.683729 0.000017 +2 42.646591 -0.003576 +3 21.154405 -0.031476 +4 9.708242 -0.087583 +5 4.614990 -0.195740 +6 2.243726 -0.270132 +7 1.086491 -0.170034 +8 0.524700 0.143412 +9 0.255752 0.408687 +10 0.121497 0.370257 +11 0.054339 0.123112 +D 1 1.000 +1 0.054339 1.0 +D 1 1.000 +1 0.026 1.0 +F 1 1.000 +1 0.311720 1.0 +F 1 1.000 +1 1.112997 1.0 + +FLUORINE +S 9 +1 71.1739093 -0.0000571 +2 33.3990384 0.0003627 +3 15.6728186 0.0095329 +4 7.35462020 -0.1270651 +5 3.45122590 0.0115271 +6 1.61952080 0.2905840 +7 0.75997570 0.4485667 +8 0.35662590 0.3123056 +9 0.16735010 0.0656252 +S 1 +1 0.344569 1.000000 +P 9 +1 27.8630509 0.0037577 +2 13.6624747 0.0434953 +3 6.69931000 0.0930502 +4 3.28496520 0.1772930 +5 1.61076240 0.2617590 +6 0.78982740 0.2896868 +7 0.38728700 0.2433414 +8 0.18990380 0.1254957 +9 0.09311810 0.0268434 +P 1 +1 0.364831 1.000000 +D 1 +1 1.722479 1.000000 + +IRON +S 13 1.000 +1 84.322332 0.000785 +2 44.203528 -0.012781 +3 23.288963 0.104635 +4 13.385163 -0.119385 +5 7.518052 -0.339804 +6 4.101835 -0.049994 +7 2.253571 0.476955 +8 1.134924 0.593222 +9 0.561550 0.200151 +10 0.201961 0.008591 +11 0.108698 -0.002188 +12 0.053619 0.000677 +13 0.025823 -0.000144 +S 13 1.000 +1 84.322332 -0.000162 +2 44.203528 0.002921 +3 23.288963 -0.025466 +4 13.385163 0.031182 +5 7.518052 0.086849 +6 4.101835 0.006846 +7 2.253571 -0.131856 +8 1.134924 -0.227746 +9 0.561550 -0.173079 +10 0.201961 0.136142 +11 0.108698 0.434013 +12 0.053619 0.477555 +13 0.025823 0.128804 +S 13 1.000 +1 84.322332 0.000002 +2 44.203528 0.004103 +3 23.288963 -0.046840 +4 13.385163 0.052833 +5 7.518052 0.218094 +6 4.101835 -0.044999 +7 2.253571 -0.287386 +8 1.134924 -0.713220 +9 0.561550 0.249174 +10 0.201961 1.299872 +11 0.108698 0.192119 +12 0.053619 -0.658616 +13 0.025823 -0.521047 +S 1 1.000 +1 0.025823 1.0 +S 1 1.000 +1 0.012 1.0 +P 13 1.000 +1 125.092775 0.000056 +2 65.211589 -0.000572 +3 34.437599 0.007388 +4 18.930704 -0.028481 +5 10.873415 -0.063005 +6 6.012172 0.024855 +7 3.372205 0.277474 +8 1.768641 0.425386 +9 0.914516 0.314145 +10 0.460895 0.090422 +11 0.204490 0.006977 +12 0.074741 0.001154 +13 0.035671 0.000303 +P 13 1.000 +1 125.092775 0.000025 +2 65.211589 -0.000070 +3 34.437599 -0.001042 +4 18.930704 0.005127 +5 10.873415 0.018404 +6 6.012172 -0.014692 +7 3.372205 -0.061307 +8 1.768641 -0.128638 +9 0.914516 -0.070637 +10 0.460895 -0.016314 +11 0.204490 0.380702 +12 0.074741 0.523071 +13 0.035671 0.235765 +P 13 1.000 +1 125.092775 -0.000197 +2 65.211589 0.001251 +3 34.437599 -0.009154 +4 18.930704 0.038201 +5 10.873415 0.043097 +6 6.012172 -0.029475 +7 3.372205 -0.426996 +8 1.768641 -0.394840 +9 0.914516 0.077230 +10 0.460895 1.119881 +11 0.204490 -0.066494 +12 0.074741 -0.721583 +13 0.035671 -0.005695 +P 1 1.000 +1 0.035671 1.0 +P 1 1.000 +1 0.017 1.0 +D 11 1.000 +1 152.736742 0.000029 +2 50.772485 0.005238 +3 26.253589 0.029325 +4 12.137022 0.074901 +5 5.853719 0.163411 +6 2.856224 0.251057 +7 1.386132 0.287603 +8 0.670802 0.251862 +9 0.330280 0.186736 +10 0.170907 0.093570 +11 0.086794 0.073811 +D 11 1.000 +1 152.736742 -0.000026 +2 50.772485 -0.006329 +3 26.253589 -0.034398 +4 12.137022 -0.091765 +5 5.853719 -0.201592 +6 2.856224 -0.283930 +7 1.386132 -0.161981 +8 0.670802 0.128822 +9 0.330280 0.360160 +10 0.170907 0.277592 +11 0.086794 0.261403 +D 1 1.000 +1 0.086794 1.0 +D 1 1.000 +1 0.04 1.0 +F 1 1.000 +1 0.463696 1.0 +F 1 1.000 +1 1.696126 1.0 + +MANGANESE +S 13 1.000 +1 76.015816 0.000992 +2 39.287425 -0.014765 +3 20.413997 0.120351 +4 12.220632 -0.123547 +5 7.180198 -0.319950 +6 3.850598 -0.106021 +7 2.142243 0.472317 +8 1.049440 0.620499 +9 0.508652 0.204890 +10 0.192102 0.005983 +11 0.108912 -0.000130 +12 0.053405 -0.000175 +13 0.025223 0.000059 +S 13 1.000 +1 76.015816 -0.000199 +2 39.287425 0.003344 +3 20.413997 -0.029317 +4 12.220632 0.031960 +5 7.180198 0.083084 +6 3.850598 0.021364 +7 2.142243 -0.129827 +8 1.049440 -0.238808 +9 0.508652 -0.180485 +10 0.192102 0.109481 +11 0.108912 0.404375 +12 0.053405 0.517748 +13 0.025223 0.148273 +S 13 1.000 +1 76.015816 -0.000091 +2 39.287425 0.005358 +3 20.413997 -0.058289 +4 12.220632 0.056077 +5 7.180198 0.227722 +6 3.850598 -0.008293 +7 2.142243 -0.320247 +8 1.049440 -0.812449 +9 0.508652 0.324723 +10 0.192102 1.446872 +11 0.108912 0.022988 +12 0.053405 -0.677035 +13 0.025223 -0.454415 +S 1 1.000 +1 0.025223 1.0 +S 1 1.000 +1 0.012 1.0 +P 13 1.000 +1 113.478683 0.000103 +2 58.149046 -0.000896 +3 30.029824 0.008851 +4 16.750395 -0.019576 +5 10.714033 -0.069249 +6 5.558478 0.011297 +7 3.080496 0.282218 +8 1.582818 0.438781 +9 0.810731 0.309937 +10 0.413383 0.083951 +11 0.195719 0.007553 +12 0.072184 0.001106 +13 0.035923 0.000285 +P 13 1.000 +1 113.478683 0.000021 +2 58.149046 -0.000034 +3 30.029824 -0.001184 +4 16.750395 0.002162 +5 10.714033 0.020978 +6 5.558478 -0.011826 +7 3.080496 -0.062380 +8 1.582818 -0.137615 +9 0.810731 -0.065755 +10 0.413383 -0.033911 +11 0.195719 0.382515 +12 0.072184 0.508959 +13 0.035923 0.257840 +P 13 1.000 +1 113.478683 -0.000200 +2 58.149046 0.001371 +3 30.029824 -0.010181 +4 16.750395 0.030762 +5 10.714033 0.045983 +6 5.558478 -0.017031 +7 3.080496 -0.397037 +8 1.582818 -0.418005 +9 0.810731 0.073119 +10 0.413383 1.095819 +11 0.195719 0.003833 +12 0.072184 -0.756970 +13 0.035923 -0.040676 +P 1 1.000 +1 0.035923 1.0 +P 1 1.000 +1 0.017 1.0 +D 11 1.000 +1 132.688043 0.000030 +2 45.257740 0.005308 +3 23.264934 0.029187 +4 10.604446 0.076880 +5 5.075071 0.168742 +6 2.470085 0.256971 +7 1.206045 0.289895 +8 0.590669 0.257087 +9 0.292045 0.181613 +10 0.149158 0.089726 +11 0.076548 0.034455 +D 11 1.000 +1 132.688043 -0.000021 +2 45.257740 -0.005463 +3 23.264934 -0.029079 +4 10.604446 -0.079946 +5 5.075071 -0.174638 +6 2.470085 -0.253480 +7 1.206045 -0.173991 +8 0.590669 0.045744 +9 0.292045 0.346287 +10 0.149158 0.263668 +11 0.076548 0.370832 +D 1 1.000 +1 0.076548 1.0 +D 1 1.000 +1 0.03 1.0 +F 1 1.000 +1 0.374592 1.0 +F 1 1.000 +1 1.361579 1.0 + +NICKEL +S 13 1.000 +1 97.609231 0.000688 +2 51.795589 -0.014336 +3 27.566909 0.121035 +4 15.531444 -0.144503 +5 8.990857 -0.360791 +6 4.804810 -0.003243 +7 2.574616 0.497736 +8 1.332789 0.552240 +9 0.678890 0.196852 +10 0.231285 0.010794 +11 0.120013 -0.003782 +12 0.057871 0.001393 +13 0.027793 -0.000334 +S 13 1.000 +1 97.609231 -0.000136 +2 51.795589 0.003181 +3 27.566909 -0.028405 +4 15.531444 0.036601 +5 8.990857 0.086336 +6 4.804810 -0.001113 +7 2.574616 -0.136410 +8 1.332789 -0.206882 +9 0.678890 -0.163365 +10 0.231285 0.143310 +11 0.120013 0.450561 +12 0.057871 0.458900 +13 0.027793 0.116636 +S 13 1.000 +1 97.609231 -0.000144 +2 51.795589 0.003299 +3 27.566909 -0.029379 +4 15.531444 0.038039 +5 8.990857 0.088752 +6 4.804810 -0.001605 +7 2.574616 -0.142926 +8 1.332789 -0.206444 +9 0.678890 -0.160922 +10 0.231285 0.137129 +11 0.120013 0.452051 +12 0.057871 0.453964 +13 0.027793 0.122926 +S 1 1.000 +1 0.027793 1.0 +S 1 1.000 +1 0.013 1.0 +P 13 1.000 +1 148.055334 0.000088 +2 72.086134 -0.001119 +3 34.462396 0.021186 +4 19.703322 -0.070032 +5 15.218321 -0.047471 +6 7.500730 0.023137 +7 4.198271 0.275852 +8 2.159830 0.433799 +9 1.103715 0.310152 +10 0.573058 0.089124 +11 0.296213 0.010970 +12 0.087733 0.001132 +13 0.036681 0.000101 +P 13 1.000 +1 148.055334 0.000055 +2 72.086134 -0.000191 +3 34.462396 -0.002043 +4 19.703322 0.003428 +5 15.218321 0.023890 +6 7.500730 -0.019526 +7 4.198271 -0.041199 +8 2.159830 -0.138172 +9 1.103715 -0.018608 +10 0.573058 -0.118437 +11 0.296213 0.355825 +12 0.087733 0.604126 +13 0.036681 0.252636 +P 13 1.000 +1 148.055334 -0.000165 +2 72.086134 0.001444 +3 34.462396 -0.022779 +4 19.703322 0.103668 +5 15.218321 -0.002949 +6 7.500730 -0.008709 +7 4.198271 -0.449059 +8 2.159830 -0.387352 +9 1.103715 0.075969 +10 0.573058 1.025025 +11 0.296213 0.064695 +12 0.087733 -0.729963 +13 0.036681 -0.002806 +P 1 1.000 +1 0.036681 1.0 +P 1 1.000 +1 0.018 1.0 +D 11 1.000 +1 177.801510 -0.000015 +2 61.108038 0.002224 +3 30.508234 0.026045 +4 14.144383 0.092837 +5 6.846193 0.186362 +6 3.363485 0.268726 +7 1.645977 0.295256 +8 0.795663 0.251833 +9 0.384212 0.161292 +10 0.189273 0.070970 +11 0.091549 0.022879 +D 11 1.000 +1 177.801510 0.000016 +2 61.108038 -0.002556 +3 30.508234 -0.029764 +4 14.144383 -0.108691 +5 6.846193 -0.223408 +6 3.363485 -0.283618 +7 1.645977 -0.120676 +8 0.795663 0.193509 +9 0.384212 0.377891 +10 0.189273 0.297292 +11 0.091549 0.174221 +D 1 1.000 +1 0.091549 1.0 +D 1 1.000 +1 0.04 1.0 +F 1 1.000 +1 0.665953 1.0 +F 1 1.000 +1 2.380651 1.0 + +OXYGEN +S 9 1 +1 54.775216 -0.0012444 +2 25.616801 0.0107330 +3 11.980245 0.0018889 +4 6.992317 -0.1742537 +5 2.620277 0.0017622 +6 1.225429 0.3161846 +7 0.577797 0.4512023 +8 0.268022 0.3121534 +9 0.125346 0.0511167 +S 1 1 +1 0.258551 1.0000000 +P 9 1 +1 22.217266 0.0104866 +2 10.74755 0.0366435 +3 5.315785 0.0803674 +4 2.660761 0.1627010 +5 1.331816 0.2377791 +6 0.678626 0.2811422 +7 0.333673 0.2643189 +8 0.167017 0.1466014 +9 0.083598 0.0458145 +P 1 1 +1 0.267865 1.0000000 +D 1 1 +1 1.232753 1.0000000 + +SULFUR +s 11 +1 315.24967840 0.000233 +2 141.17315500 -0.000557 +3 63.21928635 0.007846 +4 28.31046857 -0.139746 +5 12.67781838 0.011705 +6 5.67730197 0.400954 +7 2.54237414 0.562552 +8 1.13851021 0.135102 +9 0.50984058 0.004551 +10 0.22831365 0.000131 +11 0.10224200 0.000385 +s 11 +1 315.24967840 -0.000035 +2 141.17315500 -0.000046 +3 63.21928635 -0.001545 +4 28.31046857 0.046561 +5 12.67781838 -0.007204 +6 5.67730197 -0.163807 +7 2.54237414 -0.356328 +8 1.13851021 -0.102388 +9 0.50984058 0.476460 +10 0.22831365 0.568771 +11 0.10224200 0.183715 +s 1 +1 0.152826 1.000000 +p 11 +1 105.77262714 -0.000130 +2 50.58545925 0.016880 +3 24.19235256 0.158150 +4 11.56992407 0.258667 +5 5.53328341 0.356166 +6 2.64627711 0.294147 +7 1.26557453 0.091060 +8 0.60525743 0.007367 +9 0.28946265 0.000547 +10 0.13843469 0.000553 +11 0.06620600 -0.000031 +p 11 +1 105.77262714 -0.000224 +2 50.58545925 0.005129 +3 24.19235256 0.038613 +4 11.56992407 0.068551 +5 5.53328341 0.100274 +6 2.64627711 0.091605 +7 1.26557453 -0.063653 +8 0.60525743 -0.290231 +9 0.28946265 -0.414484 +10 0.13843469 -0.297929 +11 0.06620600 -0.101003 +p 1 +1 0.152826 1.000000 +d 1 +1 0.481035 1.000000 + +SCANDIUM +S 13 1.000 +1 66.885341 0.000530 +2 33.819599 -0.004820 +3 18.254490 0.001497 +4 11.808446 0.125425 +5 6.900398 -0.270066 +6 3.228933 -0.326605 +7 1.773981 0.289735 +8 0.840523 0.630457 +9 0.472620 0.269883 +10 0.314717 0.139047 +11 0.100371 0.008111 +12 0.048701 -0.002666 +13 0.022635 0.000614 +S 13 1.000 +1 66.885341 -0.000134 +2 33.819599 0.001271 +3 18.254490 -0.000752 +4 11.808446 -0.033037 +5 6.900398 0.075355 +6 3.228933 0.090312 +7 1.773981 -0.089219 +8 0.840523 -0.216505 +9 0.472620 -0.176500 +10 0.314717 -0.131181 +11 0.100371 0.341614 +12 0.048701 0.608966 +13 0.022635 0.240473 +S 13 1.000 +1 66.885341 -0.000687 +2 33.819599 0.005444 +3 18.254490 -0.015884 +4 11.808446 -0.032814 +5 6.900398 0.108358 +6 3.228933 0.235631 +7 1.773981 -0.311150 +8 0.840523 -0.234723 +9 0.472620 -1.200718 +10 0.314717 1.048196 +11 0.100371 1.607623 +12 0.048701 -0.643134 +13 0.022635 -0.837339 +S 1 1.000 +1 0.022635 1.0 +S 1 1.000 +1 0.011 1.0 +P 13 1.000 +1 77.687965 0.000088 +2 39.720143 -0.000755 +3 20.588415 0.006537 +4 11.552484 -0.005944 +5 7.633071 -0.070539 +6 3.765354 -0.014599 +7 2.056424 0.249676 +8 1.048311 0.436532 +9 0.549190 0.325322 +10 0.304981 0.103373 +11 0.166817 0.018978 +12 0.061588 0.001353 +13 0.024836 0.000122 +P 13 1.000 +1 77.687965 0.000012 +2 39.720143 0.000002 +3 20.588415 -0.000950 +4 11.552484 -0.000472 +5 7.633071 0.021251 +6 3.765354 -0.002758 +7 2.056424 -0.060262 +8 1.048311 -0.141394 +9 0.549190 -0.081787 +10 0.304981 -0.099327 +11 0.166817 0.309280 +12 0.061588 0.623105 +13 0.024836 0.261500 +P 13 1.000 +1 77.687965 -0.000053 +2 39.720143 0.000499 +3 20.588415 -0.004884 +4 11.552484 0.005449 +5 7.633071 0.055621 +6 3.765354 0.002727 +7 2.056424 -0.232938 +8 1.048311 -0.500050 +9 0.549190 -0.218611 +10 0.304981 0.886574 +11 0.166817 0.657112 +12 0.061588 -0.824086 +13 0.024836 -0.171436 +P 1 1.000 +1 0.024836 1.0 +P 1 1.000 +1 0.012 1.0 +D 11 1.000 +1 60.996922 0.000056 +2 22.088926 0.005065 +3 10.187383 0.031740 +4 4.631390 0.082146 +5 2.148130 0.159084 +6 1.015784 0.228110 +7 0.487874 0.244131 +8 0.247348 0.234199 +9 0.129854 0.196760 +10 0.062998 0.212891 +11 0.021310 0.072798 +D 11 1.000 +1 60.996922 -0.000073 +2 22.088926 -0.006086 +3 10.187383 -0.038466 +4 4.631390 -0.100226 +5 2.148130 -0.193890 +6 1.015784 -0.253318 +7 0.487874 -0.214480 +8 0.247348 0.054136 +9 0.129854 0.267168 +10 0.062998 0.517020 +11 0.021310 0.163524 +D 1 1.000 +1 0.021310 1.0 +D 1 1.000 +1 0.01 1.0 +F 1 1.000 +1 0.083504 1.0 +F 1 1.000 +1 0.279955 1.0 + +TITANIUM +S 13 1.000 +1 68.910511 0.000616 +2 33.720700 -0.007501 +3 18.159676 0.012218 +4 12.419305 0.144739 +5 7.532195 -0.328621 +6 3.504444 -0.317517 +7 1.910727 0.357422 +8 0.888840 0.671406 +9 0.447198 0.282226 +10 0.281192 0.038673 +11 0.100258 0.004559 +12 0.046525 -0.001565 +13 0.021840 0.000398 +S 13 1.000 +1 68.910511 -0.000156 +2 33.720700 0.001966 +3 18.159676 -0.003994 +4 12.419305 -0.036377 +5 7.532195 0.088593 +6 3.504444 0.085630 +7 1.910727 -0.105993 +8 0.888840 -0.237421 +9 0.447198 -0.235359 +10 0.281192 -0.012960 +11 0.100258 0.433582 +12 0.046525 0.577873 +13 0.021840 0.164360 +S 13 1.000 +1 68.910511 0.000635 +2 33.720700 -0.006468 +3 18.159676 0.023444 +4 12.419305 0.038921 +5 7.532195 -0.141180 +6 3.504444 -0.214765 +7 1.910727 0.320151 +8 0.888840 0.451062 +9 0.447198 0.855191 +10 0.281192 -1.209224 +11 0.100258 -1.319481 +12 0.046525 0.866517 +13 0.021840 0.618916 +S 1 1.000 +1 0.021840 1.0 +S 1 1.000 +1 0.01 1.0 +P 13 1.000 +1 84.914002 0.000093 +2 42.855051 -0.000836 +3 21.700131 0.008679 +4 12.214690 -0.011178 +5 8.319164 -0.077767 +6 4.091071 -0.006113 +7 2.286543 0.271828 +8 1.159810 0.459585 +9 0.591343 0.315900 +10 0.312862 0.071683 +11 0.184828 0.010541 +12 0.068590 0.000045 +13 0.026791 -0.000837 +P 13 1.000 +1 84.914002 0.000020 +2 42.855051 -0.000049 +3 21.700131 -0.000761 +4 12.214690 -0.000575 +5 8.319164 0.018284 +6 4.091071 -0.005943 +7 2.286543 -0.043212 +8 1.159810 -0.112513 +9 0.591343 -0.052073 +10 0.312862 -0.092263 +11 0.184828 0.243946 +12 0.068590 0.413101 +13 0.026791 0.543985 +P 13 1.000 +1 84.914002 0.000019 +2 42.855051 0.000138 +3 21.700131 -0.004622 +4 12.214690 0.004465 +5 8.319164 0.065760 +6 4.091071 -0.018927 +7 2.286543 -0.222524 +8 1.159810 -0.523890 +9 0.591343 -0.071277 +10 0.312862 0.812712 +11 0.184828 0.625498 +12 0.068590 -0.812189 +13 0.026791 -0.185796 +P 1 1.000 +1 0.026791 1.0 +P 1 1.000 +1 0.013 1.0 +D 11 1.000 +1 77.434559 0.000022 +2 27.708477 0.004218 +3 12.914284 0.030087 +4 6.062674 0.084821 +5 2.863898 0.171110 +6 1.386559 0.247451 +7 0.677058 0.277310 +8 0.329864 0.261077 +9 0.159474 0.190336 +10 0.076174 0.119385 +11 0.028570 0.031297 +D 11 1.000 +1 77.434559 -0.000025 +2 27.708477 -0.004311 +3 12.914284 -0.030913 +4 6.062674 -0.088049 +5 2.863898 -0.178330 +6 1.386559 -0.234335 +7 0.677058 -0.195775 +8 0.329864 0.065872 +9 0.159474 0.330536 +10 0.076174 0.461229 +11 0.028570 0.184273 +D 1 1.000 +1 0.028570 1.0 +D 1 1.000 +1 0.014 1.0 +F 1 1.000 +1 0.146931 1.0 +F 1 1.000 +1 0.499717 1.0 + +VANADIUM +S 13 1.000 +1 68.577621 0.000804 +2 34.937147 -0.011594 +3 17.939491 0.092209 +4 11.262123 -0.045477 +5 6.776264 -0.287983 +6 3.524091 -0.217648 +7 1.938421 0.407509 +8 0.927153 0.658193 +9 0.448420 0.255234 +10 0.209668 0.008620 +11 0.103660 0.002734 +12 0.050630 -0.001161 +13 0.024201 0.000294 +S 13 1.000 +1 68.577621 -0.000177 +2 34.937147 0.002791 +3 17.939491 -0.023650 +4 11.262123 0.012504 +5 6.776264 0.078761 +6 3.524091 0.054974 +7 1.938421 -0.118955 +8 0.927153 -0.245341 +9 0.448420 -0.222959 +10 0.209668 0.047809 +11 0.103660 0.415374 +12 0.050630 0.540880 +13 0.024201 0.183421 +S 13 1.000 +1 68.577621 -0.000583 +2 34.937147 0.009570 +3 17.939491 -0.085606 +4 11.262123 0.048426 +5 6.776264 0.331239 +6 3.524091 0.140352 +7 1.938421 -0.907962 +8 0.927153 -0.503878 +9 0.448420 0.398938 +10 0.209668 0.971131 +11 0.103660 0.423999 +12 0.050630 -0.628646 +13 0.024201 -0.467495 +S 1 1.000 +1 0.024201 1.0 +S 1 1.000 +1 0.012 1.0 +P 13 1.000 +1 96.215967 0.000069 +2 49.579340 -0.000672 +3 25.638009 0.008199 +4 14.025942 -0.027108 +5 8.740334 -0.053021 +6 4.634840 0.005002 +7 2.553374 0.261986 +8 1.321166 0.433544 +9 0.681285 0.324947 +10 0.349458 0.092342 +11 0.172773 0.008964 +12 0.063300 0.001185 +13 0.033969 0.000104 +P 13 1.000 +1 96.215967 0.000040 +2 49.579340 -0.000133 +3 25.638009 -0.000955 +4 14.025942 0.003719 +5 8.740334 0.018866 +6 4.634840 -0.012074 +7 2.553374 -0.057107 +8 1.321166 -0.146433 +9 0.681285 -0.067365 +10 0.349458 -0.068254 +11 0.172773 0.403103 +12 0.063300 0.502668 +13 0.033969 0.261291 +P 13 1.000 +1 96.215967 -0.000053 +2 49.579340 0.000023 +3 25.638009 0.004629 +4 14.025942 -0.007755 +5 8.740334 -0.104133 +6 4.634840 -0.017762 +7 2.553374 0.728212 +8 1.321166 0.218826 +9 0.681285 -0.493223 +10 0.349458 -0.838192 +11 0.172773 0.398401 +12 0.063300 0.664589 +13 0.033969 0.033011 +P 1 1.000 +1 0.033969 1.0 +P 1 1.000 +1 0.016 1.0 +D 11 1.000 +1 89.989649 0.000051 +2 33.132961 0.004804 +3 15.879656 0.029485 +4 7.465803 0.086249 +5 3.551993 0.179728 +6 1.728185 0.261850 +7 0.850498 0.291794 +8 0.417673 0.259356 +9 0.201523 0.174944 +10 0.100711 0.062278 +11 0.058959 0.027653 +D 11 1.000 +1 89.989649 -0.000038 +2 33.132961 -0.004590 +3 15.879656 -0.027563 +4 7.465803 -0.082775 +5 3.551993 -0.173494 +6 1.728185 -0.236188 +7 0.850498 -0.149226 +8 0.417673 0.044145 +9 0.201523 0.390500 +10 0.100711 0.203064 +11 0.058959 0.398002 +D 1 1.000 +1 0.058959 1.0 +D 1 1.000 +1 0.027 1.0 +F 1 1.000 +1 0.308388 1.0 +F 1 1.000 +1 1.138450 1.0 + +ZINC +S 13 1.000 +1 114.485022 0.000429 +2 61.996430 -0.019339 +3 40.117132 0.086254 +4 20.119649 -0.088955 +5 10.171676 -0.402671 +6 5.601641 0.067304 +7 2.864122 0.479215 +8 1.592779 0.503960 +9 0.826525 0.222088 +10 0.263975 0.012203 +11 0.145302 -0.004300 +12 0.068195 0.001243 +13 0.031465 -0.000267 +S 13 1.000 +1 114.485022 -0.000109 +2 61.996430 0.004459 +3 40.117132 -0.020067 +4 20.119649 0.022338 +5 10.171676 0.096698 +6 5.601641 -0.021966 +7 2.864122 -0.128768 +8 1.592779 -0.181706 +9 0.826525 -0.162311 +10 0.263975 0.116264 +11 0.145302 0.411314 +12 0.068195 0.494257 +13 0.031465 0.138103 +S 13 1.000 +1 114.485022 0.000666 +2 61.996430 0.006269 +3 40.117132 -0.046603 +4 20.119649 0.050399 +5 10.171676 0.363493 +6 5.601641 -0.242840 +7 2.864122 -0.382281 +8 1.592779 -0.861567 +9 0.826525 0.706077 +10 0.263975 1.495001 +11 0.145302 -0.453994 +12 0.068195 -0.597822 +13 0.031465 -0.256117 +S 1 1.000 +1 0.031465 1.0 +S 1 1.000 +1 0.015 1.0 +P 13 1.000 +1 158.770986 -0.000153 +2 75.802876 0.001893 +3 44.547824 0.010461 +4 31.445269 -0.045141 +5 13.080125 -0.084201 +6 7.788616 0.104973 +7 4.195040 0.307714 +8 2.362276 0.368563 +9 1.302584 0.286336 +10 0.660704 0.095156 +11 0.249042 0.005851 +12 0.091781 -0.000034 +13 0.048931 0.000252 +P 13 1.000 +1 158.770986 0.000053 +2 75.802876 -0.000571 +3 44.547824 -0.001073 +4 31.445269 0.007463 +5 13.080125 0.018676 +6 7.788616 -0.028090 +7 4.195040 -0.054438 +8 2.362276 -0.093744 +9 1.302584 -0.054169 +10 0.660704 -0.007972 +11 0.249042 0.356198 +12 0.091781 0.412399 +13 0.048931 0.361321 +P 13 1.000 +1 158.770986 -0.000170 +2 75.802876 0.000604 +3 44.547824 -0.019987 +4 31.445269 0.061153 +5 13.080125 0.067317 +6 7.788616 -0.139211 +7 4.195040 -0.527041 +8 2.362276 -0.176194 +9 1.302584 0.037129 +10 0.660704 1.079322 +11 0.249042 -0.050149 +12 0.091781 -0.688971 +13 0.048931 0.037331 +P 1 1.000 +1 0.048931 1.0 +P 1 1.000 +1 0.024 1.0 +D 11 1.000 +1 270.014061 -0.000016 +2 100.161579 0.000696 +3 43.530609 0.013536 +4 21.262419 0.069350 +5 10.577821 0.149559 +6 5.343620 0.239588 +7 2.704857 0.286744 +8 1.353018 0.271459 +9 0.660873 0.202426 +10 0.309149 0.103307 +11 0.133879 0.023211 +D 11 1.000 +1 270.014061 0.000013 +2 100.161579 -0.000889 +3 43.530609 -0.018640 +4 21.262419 -0.094646 +5 10.577821 -0.215659 +6 5.343620 -0.322469 +7 2.704857 -0.197529 +8 1.353018 0.164448 +9 0.660873 0.410017 +10 0.309149 0.327838 +11 0.133879 0.105749 +D 1 1.000 +1 0.133879 1.0 +D 1 1.000 +1 0.06 1.0 +F 1 1.000 +1 0.893402 1.0 +F 1 1.000 +1 3.171936 1.0 diff --git a/data/basis/ncsu-vtz b/data/basis/ncsu-vtz new file mode 100644 index 00000000..9b189e1b --- /dev/null +++ b/data/basis/ncsu-vtz @@ -0,0 +1,1960 @@ +HYDROGEN +S 6 + 1 6.359201 -0.004943 + 2 3.546637 0.049579 + 3 1.493442 0.037176 + 4 0.551948 0.287908 + 5 0.207203 0.009543 + 6 0.079234 0.770084 +S 6 + 1 6.359201 -0.016672 + 2 3.546637 -0.005774 + 3 1.493442 -0.227982 + 4 0.551948 -0.285652 + 5 0.207203 -1.071579 + 6 0.079234 1.423767 +S 6 + 1 6.359201 -0.018886 + 2 3.546637 -0.058854 + 3 1.493442 -0.556988 + 4 0.551948 -1.084022 + 5 0.207203 2.721525 + 6 0.079234 -1.458091 +S 1 + 1 0.102700 1.000000 +P 1 + 1 1.407000 1.000000 +P 1 + 1 0.388000 1.000000 +D 1 + 1 1.057000 1.000000 + +CARBON +S 9 + 1 13.073594 0.0051583 + 2 6.541187 0.0603424 + 3 4.573411 -0.1978471 + 4 1.637494 -0.0810340 + 5 0.819297 0.2321726 + 6 0.409924 0.2914643 + 7 0.231300 0.4336405 + 8 0.102619 0.2131940 + 9 0.051344 0.0049848 +S 1 + 1 0.921552 1.000000 +S 1 + 1 0.132800 1.000000 +P 9 + 1 9.934169 0.0209076 + 2 3.886955 0.0572698 + 3 1.871016 0.1122682 + 4 0.935757 0.2130082 + 5 0.468003 0.2835815 + 6 0.239473 0.3011207 + 7 0.117063 0.2016934 + 8 0.058547 0.0453575 + 9 0.029281 0.0029775 +P 1 + 1 0.376742 1.000000 +P 1 + 1 0.126772 1.000000 +D 1 + 1 1.141611 1.000000 +D 1 + 1 0.329486 1.000000 +F 1 + 1 0.773485 1.000000 + +CHLORINE +S 10 + 1 0.122096 0.175451 + 2 0.289394 0.607210 + 3 0.657228 0.465346 + 4 1.167709 -0.079460 + 5 2.719209 -0.339622 + 6 5.564288 0.092975 + 7 11.667080 -0.010906 + 8 25.009418 -0.000807 + 9 53.798061 -0.000189 +10 99.938947 0.000063 +S 1 +1 0.188703 1.000 +S 1 +1 1.003905 1.000 +P 10 + 1 0.075272 0.093475 + 2 0.177298 0.343672 + 3 0.389880 0.404212 + 4 0.775457 0.251867 + 5 1.391339 0.073840 + 6 3.017894 -0.068164 + 7 6.140684 0.014679 + 8 12.639835 0.000722 + 9 26.439040 -0.001040 + 10 52.945707 -0.000037 +P 1 +1 0.122186 1.000 +P 1 +1 0.341503 1.000 +D 1 +1 0.361259 1.000 +D 1 +1 1.165615 1.000 +F 1 +1 0.721855 1.000 + +COBALT +S 13 +1 90.138338 0.000870 +2 46.360154 -0.012889 +3 23.733997 0.114398 +4 14.381697 -0.098019 +5 8.774183 -0.352394 +6 4.485868 -0.094570 +7 2.536663 0.500662 +8 1.239271 0.608796 +9 0.599131 0.189026 +10 0.224507 0.005508 +11 0.124709 -0.000242 +12 0.060740 -0.000070 +13 0.028274 0.000031 +S 13 +1 90.138338 -0.000171 +2 46.360154 0.002859 +3 23.733997 -0.027465 +4 14.381697 0.026028 +5 8.774183 0.087563 +6 4.485868 0.018143 +7 2.536663 -0.134608 +8 1.239271 -0.233508 +9 0.599131 -0.163697 +10 0.224507 0.120841 +11 0.124709 0.394955 +12 0.060740 0.509928 +13 0.028274 0.150457 +S 13 +1 90.138338 -0.000093 +2 46.360154 0.004385 +3 23.733997 -0.052442 +4 14.381697 0.044798 +5 8.774183 0.213744 +6 4.485868 -0.005708 +7 2.536663 -0.327530 +8 1.239271 -0.679295 +9 0.599131 0.252601 +10 0.224507 1.215183 +11 0.124709 0.250644 +12 0.060740 -0.593655 +13 0.028274 -0.588728 +S 13 +1 90.138338 -0.000342 +2 46.360154 0.009084 +3 23.733997 -0.110827 +4 14.381697 0.131865 +5 8.774183 0.389649 +6 4.485868 -0.021196 +7 2.536663 -1.176422 +8 1.239271 -0.747459 +9 0.599131 2.309439 +10 0.224507 0.259142 +11 0.124709 -1.979997 +12 0.060740 0.123168 +13 0.028274 0.937568 +S 1 +1 0.028274 1.0 +S 1 +1 0.014 1.0 +P 13 +1 139.014951 0.000085 +2 71.647198 -0.000721 +3 37.453971 0.006545 +4 20.948358 -0.009990 +5 13.091607 -0.084075 +6 6.797915 0.009770 +7 3.804866 0.282493 +8 1.960048 0.436288 +9 1.003909 0.313331 +10 0.508607 0.089041 +11 0.234227 0.007472 +12 0.083922 0.000983 +13 0.040103 0.000275 +P 13 +1 139.014951 0.000025 +2 71.647198 -0.000075 +3 37.453971 -0.000603 +4 20.948358 0.000027 +5 13.091607 0.022667 +6 6.797915 -0.011149 +7 3.804866 -0.056513 +8 1.960048 -0.127222 +9 1.003909 -0.059476 +10 0.508607 -0.037982 +11 0.234227 0.352856 +12 0.083922 0.508744 +13 0.040103 0.292061 +P 13 +1 139.014951 -0.000240 +2 71.647198 0.001541 +3 37.453971 -0.009509 +4 20.948358 0.025569 +5 13.091607 0.060650 +6 6.797915 -0.016616 +7 3.804866 -0.429847 +8 1.960048 -0.412446 +9 1.003909 0.088445 +10 0.508607 1.072784 +11 0.234227 0.014565 +12 0.083922 -0.720502 +13 0.040103 -0.024392 +P 13 +1 139.014951 -0.000032 +2 71.647198 -0.000195 +3 37.453971 0.005702 +4 20.948358 -0.022947 +5 13.091607 -0.125808 +6 6.797915 0.144929 +7 3.804866 0.804637 +8 1.960048 0.233167 +9 1.003909 -1.665718 +10 0.508607 0.275574 +11 0.234227 1.339764 +12 0.083922 -0.879771 +13 0.040103 -0.132801 +P 1 +1 0.040103 1.0 +P 1 +1 0.019 1.0 +D 11 +1 160.454443 0.000034 +2 52.961426 0.006240 +3 27.614188 0.034177 +4 12.737767 0.082700 +5 6.178095 0.177253 +6 3.025327 0.264353 +7 1.472888 0.292424 +8 0.714500 0.249507 +9 0.348985 0.171514 +10 0.173869 0.082044 +11 0.086676 0.040249 +D 11 +1 160.454443 -0.000033 +2 52.961426 -0.007451 +3 27.614188 -0.039607 +4 12.737767 -0.100623 +5 6.178095 -0.216952 +6 3.025327 -0.284736 +7 1.472888 -0.128478 +8 0.714500 0.176611 +9 0.348985 0.374429 +10 0.173869 0.291413 +11 0.086676 0.196435 +D 11 +1 160.454443 0.000054 +2 52.961426 0.009948 +3 27.614188 0.052544 +4 12.737767 0.139860 +5 6.178095 0.306445 +6 3.025327 0.246555 +7 1.472888 -0.284006 +8 0.714500 -0.594724 +9 0.348985 -0.024539 +10 0.173869 0.360938 +11 0.086676 0.447303 +D 1 +1 0.086676 1.0 +D 1 +1 0.043 1.0 +F 1 +1 0.240278 1.0 +F 1 +1 0.974322 1.0 +F 1 +1 3.95085 1.0 +G 1 +1 0.828387 1.0 +G 1 +1 2.524816 1.0 + +CHROMIUM +S 13 +1 73.977737 0.000864 +2 37.684349 -0.011595 +3 19.278723 0.090467 +4 12.130763 -0.024837 +5 7.453002 -0.330407 +6 3.756296 -0.200598 +7 2.084137 0.449766 +8 0.993314 0.647575 +9 0.483094 0.229025 +10 0.225854 0.009217 +11 0.115338 0.001132 +12 0.052134 -0.000367 +13 0.023679 0.000092 +S 13 +1 73.977737 -0.000183 +2 37.684349 0.002704 +3 19.278723 -0.022650 +4 12.130763 0.007181 +5 7.453002 0.087705 +6 3.756296 0.047616 +7 2.084137 -0.125672 +8 0.993314 -0.244571 +9 0.483094 -0.198419 +10 0.225854 0.030889 +11 0.115338 0.423935 +12 0.052134 0.576941 +13 0.023679 0.148323 +S 13 +1 73.977737 -0.000327 +2 37.684349 0.005309 +3 19.278723 -0.046905 +4 12.130763 0.015411 +5 7.453002 0.191697 +6 3.756296 0.099759 +7 2.084137 -0.338994 +8 0.993314 -0.695806 +9 0.483094 -0.007315 +10 0.225854 1.118599 +11 0.115338 0.717257 +12 0.052134 -0.868565 +13 0.023679 -0.467186 +S 13 +1 73.977737 -0.000698 +2 37.684349 0.010207 +3 19.278723 -0.091261 +4 12.130763 0.052207 +5 7.453002 0.342164 +6 3.756296 0.174866 +7 2.084137 -0.994258 +8 0.993314 -1.190604 +9 0.483094 2.271834 +10 0.225854 1.003013 +11 0.115338 -2.605235 +12 0.052134 0.265158 +13 0.023679 0.902286 +S 1 +1 0.023679 1.0 +S 1 +1 0.011 1.0 +P 13 +1 101.951240 0.000088 +2 52.309865 -0.000747 +3 27.142574 0.007135 +4 15.066862 -0.014702 +5 9.693669 -0.073353 +6 4.985710 0.012007 +7 2.761266 0.283117 +8 1.417673 0.440786 +9 0.728201 0.306775 +10 0.378189 0.081804 +11 0.189359 0.008839 +12 0.072301 0.001022 +13 0.037471 0.000325 +P 13 +1 101.951240 0.000028 +2 52.309865 -0.000085 +3 27.142574 -0.000751 +4 15.066862 0.000844 +5 9.693669 0.022656 +6 4.985710 -0.012781 +7 2.761266 -0.062386 +8 1.417673 -0.143581 +9 0.728201 -0.062281 +10 0.378189 -0.054471 +11 0.189359 0.377135 +12 0.072301 0.471633 +13 0.037471 0.311624 +P 13 +1 101.951240 -0.000137 +2 52.309865 0.000932 +3 27.142574 -0.006845 +4 15.066862 0.019831 +5 9.693669 0.043647 +6 4.985710 -0.019289 +7 2.761266 -0.281187 +8 1.417673 -0.370298 +9 0.728201 -0.199873 +10 0.378189 1.028552 +11 0.189359 0.423711 +12 0.072301 -0.800926 +13 0.037471 -0.141910 +P 13 +1 101.951240 0.000027 +2 52.309865 0.000180 +3 27.142574 -0.005742 +4 15.066862 0.020419 +5 9.693669 0.100527 +6 4.985710 -0.100608 +7 2.761266 -0.607746 +8 1.417673 -0.601705 +9 0.728201 1.450905 +10 0.378189 0.672299 +11 0.189359 -1.904823 +12 0.072301 0.665814 +13 0.037471 0.348522 +P 1 +1 0.037471 1.0 +P 1 +1 0.018 1.0 +D 11 +1 120.683729 -0.000006 +2 42.646591 0.003111 +3 21.154405 0.028641 +4 9.708242 0.076222 +5 4.614990 0.170595 +6 2.243726 0.266908 +7 1.086491 0.311039 +8 0.524700 0.267312 +9 0.255752 0.163336 +10 0.121497 0.062782 +11 0.054339 0.007872 +D 11 +1 120.683729 0.000017 +2 42.646591 -0.003576 +3 21.154405 -0.031476 +4 9.708242 -0.087583 +5 4.614990 -0.195740 +6 2.243726 -0.270132 +7 1.086491 -0.170034 +8 0.524700 0.143412 +9 0.255752 0.408687 +10 0.121497 0.370257 +11 0.054339 0.123112 +D 11 +1 120.683729 0.000040 +2 42.646591 -0.005181 +3 21.154405 -0.043393 +4 9.708242 -0.127734 +5 4.614990 -0.282070 +6 2.243726 -0.288390 +7 1.086491 0.168269 +8 0.524700 0.673062 +9 0.255752 0.099196 +10 0.121497 -0.570612 +11 0.054339 -0.297197 +D 1 +1 0.054339 1.0 +D 1 +1 0.026 1.0 +F 1 +1 0.133195 1.0 +F 1 +1 0.558910 1.0 +F 1 +1 2.34529 1.0 +G 1 +1 0.436321 1.0 +G 1 +1 1.422099 1.0 + +FLUORINE +S 9 + 1 71.1739093 -0.0000571 + 2 33.3990384 0.0003627 + 3 15.6728186 0.0095329 + 4 7.35462020 -0.1270651 + 5 3.45122590 0.0115271 + 6 1.61952080 0.2905840 + 7 0.75997570 0.4485667 + 8 0.35662590 0.3123056 + 9 0.16735010 0.0656252 +S 1 + 1 2.289795 1.000000 +S 1 +1 0.327712 1.000000 +P 9 + 1 27.8630509 0.0037577 + 2 13.6624747 0.0434953 + 3 6.69931000 0.0930502 + 4 3.28496520 0.1772930 + 5 1.61076240 0.2617590 + 6 0.78982740 0.2896868 + 7 0.38728700 0.2433414 + 8 0.18990380 0.1254957 + 9 0.09311810 0.0268434 +P 1 + 1 0.804181 1.000000 +P 1 + 1 0.243660 1.000000 +D 1 + 1 3.297425 1.000000 +D 1 + 1 0.900763 1.000000 +F 1 + 1 1.859274 1.000000 + +IRON +S 13 +1 84.322332 0.000785 +2 44.203528 -0.012781 +3 23.288963 0.104635 +4 13.385163 -0.119385 +5 7.518052 -0.339804 +6 4.101835 -0.049994 +7 2.253571 0.476955 +8 1.134924 0.593222 +9 0.561550 0.200151 +10 0.201961 0.008591 +11 0.108698 -0.002188 +12 0.053619 0.000677 +13 0.025823 -0.000144 +S 13 +1 84.322332 -0.000162 +2 44.203528 0.002921 +3 23.288963 -0.025466 +4 13.385163 0.031182 +5 7.518052 0.086849 +6 4.101835 0.006846 +7 2.253571 -0.131856 +8 1.134924 -0.227746 +9 0.561550 -0.173079 +10 0.201961 0.136142 +11 0.108698 0.434013 +12 0.053619 0.477555 +13 0.025823 0.128804 +S 13 +1 84.322332 0.000002 +2 44.203528 0.004103 +3 23.288963 -0.046840 +4 13.385163 0.052833 +5 7.518052 0.218094 +6 4.101835 -0.044999 +7 2.253571 -0.287386 +8 1.134924 -0.713220 +9 0.561550 0.249174 +10 0.201961 1.299872 +11 0.108698 0.192119 +12 0.053619 -0.658616 +13 0.025823 -0.521047 +S 13 +1 84.322332 0.000012 +2 44.203528 0.007598 +3 23.288963 -0.094133 +4 13.385163 0.127655 +5 7.518052 0.435598 +6 4.101835 -0.147911 +7 2.253571 -1.084477 +8 1.134924 -0.887003 +9 0.561550 2.449946 +10 0.201961 0.167976 +11 0.108698 -2.114668 +12 0.053619 0.452579 +13 0.025823 0.801444 +S 1 +1 0.025823 1.0 +S 1 +1 0.012 1.0 +P 13 +1 125.092775 0.000056 +2 65.211589 -0.000572 +3 34.437599 0.007388 +4 18.930704 -0.028481 +5 10.873415 -0.063005 +6 6.012172 0.024855 +7 3.372205 0.277474 +8 1.768641 0.425386 +9 0.914516 0.314145 +10 0.460895 0.090422 +11 0.204490 0.006977 +12 0.074741 0.001154 +13 0.035671 0.000303 +P 13 +1 125.092775 0.000025 +2 65.211589 -0.000070 +3 34.437599 -0.001042 +4 18.930704 0.005127 +5 10.873415 0.018404 +6 6.012172 -0.014692 +7 3.372205 -0.061307 +8 1.768641 -0.128638 +9 0.914516 -0.070637 +10 0.460895 -0.016314 +11 0.204490 0.380702 +12 0.074741 0.523071 +13 0.035671 0.235765 +P 13 +1 125.092775 -0.000197 +2 65.211589 0.001251 +3 34.437599 -0.009154 +4 18.930704 0.038201 +5 10.873415 0.043097 +6 6.012172 -0.029475 +7 3.372205 -0.426996 +8 1.768641 -0.394840 +9 0.914516 0.077230 +10 0.460895 1.119881 +11 0.204490 -0.066494 +12 0.074741 -0.721583 +13 0.035671 -0.005695 +P 13 +1 125.092775 0.000264 +2 65.211589 -0.001076 +3 34.437599 -0.002591 +4 18.930704 0.035519 +5 10.873415 0.119554 +6 6.012172 -0.204714 +7 3.372205 -0.760627 +8 1.768641 -0.262740 +9 0.914516 1.779030 +10 0.460895 -0.462742 +11 0.204490 -1.241030 +12 0.074741 0.940987 +13 0.035671 0.083496 +P 1 +1 0.035671 1.0 +P 1 +1 0.017 1.0 +D 11 +1 152.736742 0.000029 +2 50.772485 0.005238 +3 26.253589 0.029325 +4 12.137022 0.074901 +5 5.853719 0.163411 +6 2.856224 0.251057 +7 1.386132 0.287603 +8 0.670802 0.251862 +9 0.330280 0.186736 +10 0.170907 0.093570 +11 0.086794 0.073811 +D 11 +1 152.736742 -0.000026 +2 50.772485 -0.006329 +3 26.253589 -0.034398 +4 12.137022 -0.091765 +5 5.853719 -0.201592 +6 2.856224 -0.283930 +7 1.386132 -0.161981 +8 0.670802 0.128822 +9 0.330280 0.360160 +10 0.170907 0.277592 +11 0.086794 0.261403 +D 11 +1 152.736742 0.000051 +2 50.772485 0.008769 +3 26.253589 0.047921 +4 12.137022 0.132475 +5 5.853719 0.297279 +6 2.856224 0.275018 +7 1.386132 -0.222842 +8 0.670802 -0.619067 +9 0.330280 -0.076290 +10 0.170907 0.256056 +11 0.086794 0.541482 +D 1 +1 0.086794 1.0 +D 1 +1 0.04 1.0 +F 1 +1 0.200905 1.0 +F 1 +1 0.824745 1.0 +F 1 +1 3.385699 1.0 +G 1 +1 0.679723 1.0 +G 1 +1 2.137024 1.0 + +MANGANESE +S 13 +1 76.015816 0.000992 +2 39.287425 -0.014765 +3 20.413997 0.120351 +4 12.220632 -0.123547 +5 7.180198 -0.319950 +6 3.850598 -0.106021 +7 2.142243 0.472317 +8 1.049440 0.620499 +9 0.508652 0.204890 +10 0.192102 0.005983 +11 0.108912 -0.000130 +12 0.053405 -0.000175 +13 0.025223 0.000059 +S 13 +1 76.015816 -0.000199 +2 39.287425 0.003344 +3 20.413997 -0.029317 +4 12.220632 0.031960 +5 7.180198 0.083084 +6 3.850598 0.021364 +7 2.142243 -0.129827 +8 1.049440 -0.238808 +9 0.508652 -0.180485 +10 0.192102 0.109481 +11 0.108912 0.404375 +12 0.053405 0.517748 +13 0.025223 0.148273 +S 13 +1 76.015816 -0.000091 +2 39.287425 0.005358 +3 20.413997 -0.058289 +4 12.220632 0.056077 +5 7.180198 0.227722 +6 3.850598 -0.008293 +7 2.142243 -0.320247 +8 1.049440 -0.812449 +9 0.508652 0.324723 +10 0.192102 1.446872 +11 0.108912 0.022988 +12 0.053405 -0.677035 +13 0.025223 -0.454415 +S 13 +1 76.015816 -0.000522 +2 39.287425 0.011330 +3 20.413997 -0.115565 +4 12.220632 0.148466 +5 7.180198 0.360618 +6 3.850598 0.024570 +7 2.142243 -1.167352 +8 1.049440 -0.874860 +9 0.508652 2.547289 +10 0.192102 0.100010 +11 0.108912 -2.213201 +12 0.053405 0.464675 +13 0.025223 0.834977 +S 1 +1 0.025223 1.0 +S 1 +1 0.012 1.0 +P 13 +1 113.478683 0.000103 +2 58.149046 -0.000896 +3 30.029824 0.008851 +4 16.750395 -0.019576 +5 10.714033 -0.069249 +6 5.558478 0.011297 +7 3.080496 0.282218 +8 1.582818 0.438781 +9 0.810731 0.309937 +10 0.413383 0.083951 +11 0.195719 0.007553 +12 0.072184 0.001106 +13 0.035923 0.000285 +P 13 +1 113.478683 0.000021 +2 58.149046 -0.000034 +3 30.029824 -0.001184 +4 16.750395 0.002162 +5 10.714033 0.020978 +6 5.558478 -0.011826 +7 3.080496 -0.062380 +8 1.582818 -0.137615 +9 0.810731 -0.065755 +10 0.413383 -0.033911 +11 0.195719 0.382515 +12 0.072184 0.508959 +13 0.035923 0.257840 +P 13 +1 113.478683 -0.000200 +2 58.149046 0.001371 +3 30.029824 -0.010181 +4 16.750395 0.030762 +5 10.714033 0.045983 +6 5.558478 -0.017031 +7 3.080496 -0.397037 +8 1.582818 -0.418005 +9 0.810731 0.073119 +10 0.413383 1.095819 +11 0.195719 0.003833 +12 0.072184 -0.756970 +13 0.035923 -0.040676 +P 13 +1 113.478683 0.000014 +2 58.149046 0.000421 +3 30.029824 -0.008582 +4 16.750395 0.038725 +5 10.714033 0.099454 +6 5.558478 -0.144661 +7 3.080496 -0.821188 +8 1.582818 -0.249872 +9 0.810731 1.789394 +10 0.413383 -0.399933 +11 0.195719 -1.289110 +12 0.072184 0.845789 +13 0.035923 0.147713 +P 1 +1 0.035923 1.0 +P 1 +1 0.017 1.0 +D 11 +1 132.688043 0.000030 +2 45.257740 0.005308 +3 23.264934 0.029187 +4 10.604446 0.076880 +5 5.075071 0.168742 +6 2.470085 0.256971 +7 1.206045 0.289895 +8 0.590669 0.257087 +9 0.292045 0.181613 +10 0.149158 0.089726 +11 0.076548 0.034455 +D 11 +1 132.688043 -0.000021 +2 45.257740 -0.005463 +3 23.264934 -0.029079 +4 10.604446 -0.079946 +5 5.075071 -0.174638 +6 2.470085 -0.253480 +7 1.206045 -0.173991 +8 0.590669 0.045744 +9 0.292045 0.346287 +10 0.149158 0.263668 +11 0.076548 0.370832 +D 11 +1 132.688043 0.000060 +2 45.257740 0.008408 +3 23.264934 0.045875 +4 10.604446 0.129436 +5 5.075071 0.284631 +6 2.470085 0.270459 +7 1.206045 -0.102755 +8 0.590669 -0.580996 +9 0.292045 -0.180748 +10 0.149158 0.022553 +11 0.076548 0.722502 +D 1 +1 0.076548 1.0 +D 1 +1 0.03 1.0 +F 1 +1 0.162649 1.0 +F 1 +1 0.678412 1.0 +F 1 +1 2.829664 1.0 +G 1 +1 0.542598 1.0 +G 1 +1 1.744831 1.0 + +NICKEL +S 13 +1 97.609231 0.000688 +2 51.795589 -0.014336 +3 27.566909 0.121035 +4 15.531444 -0.144503 +5 8.990857 -0.360791 +6 4.804810 -0.003243 +7 2.574616 0.497736 +8 1.332789 0.552240 +9 0.678890 0.196852 +10 0.231285 0.010794 +11 0.120013 -0.003782 +12 0.057871 0.001393 +13 0.027793 -0.000334 +S 13 +1 97.609231 -0.000136 +2 51.795589 0.003181 +3 27.566909 -0.028405 +4 15.531444 0.036601 +5 8.990857 0.086336 +6 4.804810 -0.001113 +7 2.574616 -0.136410 +8 1.332789 -0.206882 +9 0.678890 -0.163365 +10 0.231285 0.143310 +11 0.120013 0.450561 +12 0.057871 0.458900 +13 0.027793 0.116636 +S 13 +1 97.609231 -0.000144 +2 51.795589 0.003299 +3 27.566909 -0.029379 +4 15.531444 0.038039 +5 8.990857 0.088752 +6 4.804810 -0.001605 +7 2.574616 -0.142926 +8 1.332789 -0.206444 +9 0.678890 -0.160922 +10 0.231285 0.137129 +11 0.120013 0.452051 +12 0.057871 0.453964 +13 0.027793 0.122926 +S 13 +1 97.609231 0.000165 +2 51.795589 0.004044 +3 27.566909 -0.051760 +4 15.531444 0.062082 +5 8.990857 0.222547 +6 4.804810 -0.077776 +7 2.574616 -0.289946 +8 1.332789 -0.660866 +9 0.678890 0.279645 +10 0.231285 1.245781 +11 0.120013 0.119337 +12 0.057871 -0.566533 +13 0.027793 -0.560143 +S 1 +1 0.027793 1.0 +S 1 +1 0.013 1.0 +P 13 +1 148.055334 0.000088 +2 72.086134 -0.001119 +3 34.462396 0.021186 +4 19.703322 -0.070032 +5 15.218321 -0.047471 +6 7.500730 0.023137 +7 4.198271 0.275852 +8 2.159830 0.433799 +9 1.103715 0.310152 +10 0.573058 0.089124 +11 0.296213 0.010970 +12 0.087733 0.001132 +13 0.036681 0.000101 +P 13 +1 148.055334 0.000055 +2 72.086134 -0.000191 +3 34.462396 -0.002043 +4 19.703322 0.003428 +5 15.218321 0.023890 +6 7.500730 -0.019526 +7 4.198271 -0.041199 +8 2.159830 -0.138172 +9 1.103715 -0.018608 +10 0.573058 -0.118437 +11 0.296213 0.355825 +12 0.087733 0.604126 +13 0.036681 0.252636 +P 13 +1 148.055334 -0.000165 +2 72.086134 0.001444 +3 34.462396 -0.022779 +4 19.703322 0.103668 +5 15.218321 -0.002949 +6 7.500730 -0.008709 +7 4.198271 -0.449059 +8 2.159830 -0.387352 +9 1.103715 0.075969 +10 0.573058 1.025025 +11 0.296213 0.064695 +12 0.087733 -0.729963 +13 0.036681 -0.002806 +P 13 +1 148.055334 0.000029 +2 72.086134 -0.000760 +3 34.462396 0.024992 +4 19.703322 -0.139884 +5 15.218321 -0.010167 +6 7.500730 0.082158 +7 4.198271 0.887724 +8 2.159830 0.082508 +9 1.103715 -1.396107 +10 0.573058 -0.189149 +11 0.296213 1.539261 +12 0.087733 -0.786978 +13 0.036681 -0.131069 +P 1 +1 0.036681 1.0 +P 1 +1 0.018 1.0 +D 11 +1 177.801510 -0.000015 +2 61.108038 0.002224 +3 30.508234 0.026045 +4 14.144383 0.092837 +5 6.846193 0.186362 +6 3.363485 0.268726 +7 1.645977 0.295256 +8 0.795663 0.251833 +9 0.384212 0.161292 +10 0.189273 0.070970 +11 0.091549 0.022879 +D 11 +1 177.801510 0.000016 +2 61.108038 -0.002556 +3 30.508234 -0.029764 +4 14.144383 -0.108691 +5 6.846193 -0.223408 +6 3.363485 -0.283618 +7 1.645977 -0.120676 +8 0.795663 0.193509 +9 0.384212 0.377891 +10 0.189273 0.297292 +11 0.091549 0.174221 +D 11 +1 177.801510 -0.000004 +2 61.108038 0.003190 +3 30.508234 0.038575 +4 14.144383 0.144009 +5 6.846193 0.306792 +6 3.363485 0.241988 +7 1.645977 -0.292647 +8 0.795663 -0.584145 +9 0.384212 -0.027638 +10 0.189273 0.403706 +11 0.091549 0.421169 +D 1 +1 0.091549 1.0 +D 1 +1 0.04 1.0 +F 1 +1 0.283943 1.0 +F 1 +1 1.149919 1.0 +F 1 +1 4.656966 1.0 +G 1 +1 0.995016 1.0 +G 1 +1 2.993316 1.0 + +OXYGEN +S 9 +1 54.775216 -0.0012444 +2 25.616801 0.0107330 +3 11.980245 0.0018889 +4 6.992317 -0.1742537 +5 2.620277 0.0017622 +6 1.225429 0.3161846 +7 0.577797 0.4512023 +8 0.268022 0.3121534 +9 0.125346 0.0511167 +S 1 +1 1.686633 1.0000000 +S 1 +1 0.237997 1.0000000 +P 9 +1 22.217266 0.0104866 +2 10.74755 0.0366435 +3 5.315785 0.0803674 +4 2.660761 0.1627010 +5 1.331816 0.2377791 +6 0.678626 0.2811422 +7 0.333673 0.2643189 +8 0.167017 0.1466014 +9 0.083598 0.0458145 +P 1 +1 0.600621 1.0000000 +P 1 +1 0.184696 1.0000000 +D 1 +1 2.404278 1.0000000 +D 1 +1 0.669340 1.0000000 +F 1 +1 1.423104 1.0000000 + +SULFUR +S 11 +1 315.24967840 0.000233 +2 141.17315500 -0.000557 +3 63.21928635 0.007846 +4 28.31046857 -0.139746 +5 12.67781838 0.011705 +6 5.67730197 0.400954 +7 2.54237414 0.562552 +8 1.13851021 0.135102 +9 0.50984058 0.004551 +10 0.22831365 0.000131 +11 0.10224200 0.000385 +S 11 +1 315.24967840 -0.000035 +2 141.17315500 -0.000046 +3 63.21928635 -0.001545 +4 28.31046857 0.046561 +5 12.67781838 -0.007204 +6 5.67730197 -0.163807 +7 2.54237414 -0.356328 +8 1.13851021 -0.102388 +9 0.50984058 0.476460 +10 0.22831365 0.568771 +11 0.10224200 0.183715 +S 1 +1 0.154095 1.000000 +S 1 +1 0.998096 1.000000 +P 11 +1 105.77262714 -0.000130 +2 50.58545925 0.016880 +3 24.19235256 0.158150 +4 11.56992407 0.258667 +5 5.53328341 0.356166 +6 2.64627711 0.294147 +7 1.26557453 0.091060 +8 0.60525743 0.007367 +9 0.28946265 0.000547 +10 0.13843469 0.000553 +11 0.06620600 -0.000031 +P 11 +1 105.77262714 -0.000224 +2 50.58545925 0.005129 +3 24.19235256 0.038613 +4 11.56992407 0.068551 +5 5.53328341 0.100274 +6 2.64627711 0.091605 +7 1.26557453 -0.063653 +8 0.60525743 -0.290231 +9 0.28946265 -0.414484 +10 0.13843469 -0.297929 +11 0.06620600 -0.101003 +P 1 +1 0.118377 1.000000 +P 1 +1 0.806689 1.000000 +D 1 +1 0.803728 1.000000 +D 1 +1 0.269530 1.000000 +F 1 +1 0.559459 1.000000 + +SCANDIUM +S 13 +1 66.885341 0.000530 +2 33.819599 -0.004820 +3 18.254490 0.001497 +4 11.808446 0.125425 +5 6.900398 -0.270066 +6 3.228933 -0.326605 +7 1.773981 0.289735 +8 0.840523 0.630457 +9 0.472620 0.269883 +10 0.314717 0.139047 +11 0.100371 0.008111 +12 0.048701 -0.002666 +13 0.022635 0.000614 +S 13 +1 66.885341 -0.000134 +2 33.819599 0.001271 +3 18.254490 -0.000752 +4 11.808446 -0.033037 +5 6.900398 0.075355 +6 3.228933 0.090312 +7 1.773981 -0.089219 +8 0.840523 -0.216505 +9 0.472620 -0.176500 +10 0.314717 -0.131181 +11 0.100371 0.341614 +12 0.048701 0.608966 +13 0.022635 0.240473 +S 13 +1 66.885341 -0.000687 +2 33.819599 0.005444 +3 18.254490 -0.015884 +4 11.808446 -0.032814 +5 6.900398 0.108358 +6 3.228933 0.235631 +7 1.773981 -0.311150 +8 0.840523 -0.234723 +9 0.472620 -1.200718 +10 0.314717 1.048196 +11 0.100371 1.607623 +12 0.048701 -0.643134 +13 0.022635 -0.837339 +S 13 +1 66.885341 -0.001496 +2 33.819599 0.011574 +3 18.254490 -0.039542 +4 11.808446 -0.025971 +5 6.900398 0.153997 +6 3.228933 0.460404 +7 1.773981 -0.772294 +8 0.840523 -0.578586 +9 0.472620 -1.812898 +10 0.314717 3.681098 +11 0.100371 -0.583535 +12 0.048701 -2.233456 +13 0.022635 1.905246 +S 1 +1 0.022635 1.0 +S 1 +1 0.011 1.0 +P 13 +1 77.687965 0.000088 +2 39.720143 -0.000755 +3 20.588415 0.006537 +4 11.552484 -0.005944 +5 7.633071 -0.070539 +6 3.765354 -0.014599 +7 2.056424 0.249676 +8 1.048311 0.436532 +9 0.549190 0.325322 +10 0.304981 0.103373 +11 0.166817 0.018978 +12 0.061588 0.001353 +13 0.024836 0.000122 +P 13 +1 77.687965 0.000012 +2 39.720143 0.000002 +3 20.588415 -0.000950 +4 11.552484 -0.000472 +5 7.633071 0.021251 +6 3.765354 -0.002758 +7 2.056424 -0.060262 +8 1.048311 -0.141394 +9 0.549190 -0.081787 +10 0.304981 -0.099327 +11 0.166817 0.309280 +12 0.061588 0.623105 +13 0.024836 0.261500 +P 13 +1 77.687965 -0.000053 +2 39.720143 0.000499 +3 20.588415 -0.004884 +4 11.552484 0.005449 +5 7.633071 0.055621 +6 3.765354 0.002727 +7 2.056424 -0.232938 +8 1.048311 -0.500050 +9 0.549190 -0.218611 +10 0.304981 0.886574 +11 0.166817 0.657112 +12 0.061588 -0.824086 +13 0.024836 -0.171436 +P 13 +1 77.687965 -0.000269 +2 39.720143 0.001710 +3 20.588415 -0.010083 +4 11.552484 0.018798 +5 7.633071 0.049498 +6 3.765354 0.048059 +7 2.056424 -0.409386 +8 1.048311 -0.813409 +9 0.549190 0.676043 +10 0.304981 2.270655 +11 0.166817 -2.757013 +12 0.061588 0.557954 +13 0.024836 0.499453 +P 1 +1 0.024836 1.0 +P 1 +1 0.012 1.0 +D 11 +1 60.996922 0.000056 +2 22.088926 0.005065 +3 10.187383 0.031740 +4 4.631390 0.082146 +5 2.148130 0.159084 +6 1.015784 0.228110 +7 0.487874 0.244131 +8 0.247348 0.234199 +9 0.129854 0.196760 +10 0.062998 0.212891 +11 0.021310 0.072798 +D 11 +1 60.996922 -0.000073 +2 22.088926 -0.006086 +3 10.187383 -0.038466 +4 4.631390 -0.100226 +5 2.148130 -0.193890 +6 1.015784 -0.253318 +7 0.487874 -0.214480 +8 0.247348 0.054136 +9 0.129854 0.267168 +10 0.062998 0.517020 +11 0.021310 0.163524 +D 11 +1 60.996922 0.000057 +2 22.088926 0.008199 +3 10.187383 0.049365 +4 4.631390 0.135710 +5 2.148130 0.246153 +6 1.015784 0.258979 +7 0.487874 -0.122052 +8 0.247348 -0.447750 +9 0.129854 -0.469557 +10 0.062998 0.534917 +11 0.021310 0.466434 +D 1 +1 0.021310 1.0 +D 1 +1 0.01 1.0 +F 1 +1 0.04021 1.0 +F 1 +1 0.172508 1.0 +F 1 +1 0.740081 1.0 +G 1 +1 0.132194 1.0 +G 1 +1 0.411857 1.0 + +TITANIUM +S 13 +1 68.910511 0.000616 +2 33.720700 -0.007501 +3 18.159676 0.012218 +4 12.419305 0.144739 +5 7.532195 -0.328621 +6 3.504444 -0.317517 +7 1.910727 0.357422 +8 0.888840 0.671406 +9 0.447198 0.282226 +10 0.281192 0.038673 +11 0.100258 0.004559 +12 0.046525 -0.001565 +13 0.021840 0.000398 +S 13 +1 68.910511 -0.000156 +2 33.720700 0.001966 +3 18.159676 -0.003994 +4 12.419305 -0.036377 +5 7.532195 0.088593 +6 3.504444 0.085630 +7 1.910727 -0.105993 +8 0.888840 -0.237421 +9 0.447198 -0.235359 +10 0.281192 -0.012960 +11 0.100258 0.433582 +12 0.046525 0.577873 +13 0.021840 0.164360 +S 13 +1 68.910511 0.000635 +2 33.720700 -0.006468 +3 18.159676 0.023444 +4 12.419305 0.038921 +5 7.532195 -0.141180 +6 3.504444 -0.214765 +7 1.910727 0.320151 +8 0.888840 0.451062 +9 0.447198 0.855191 +10 0.281192 -1.209224 +11 0.100258 -1.319481 +12 0.046525 0.866517 +13 0.021840 0.618916 +S 13 +1 68.910511 -0.001178 +2 33.720700 0.011877 +3 18.159676 -0.047240 +4 12.419305 -0.050922 +5 7.532195 0.237746 +6 3.504444 0.403185 +7 1.910727 -0.790961 +8 0.888840 -1.102276 +9 0.447198 0.209446 +10 0.281192 2.527352 +11 0.100258 -1.789041 +12 0.046525 -0.867842 +13 0.021840 1.427395 +S 1 +1 0.021840 1.0 +S 1 +1 0.01 1.0 +P 13 +1 84.914002 0.000093 +2 42.855051 -0.000836 +3 21.700131 0.008679 +4 12.214690 -0.011178 +5 8.319164 -0.077767 +6 4.091071 -0.006113 +7 2.286543 0.271828 +8 1.159810 0.459585 +9 0.591343 0.315900 +10 0.312862 0.071683 +11 0.184828 0.010541 +12 0.068590 0.000045 +13 0.026791 -0.000837 +P 13 +1 84.914002 0.000020 +2 42.855051 -0.000049 +3 21.700131 -0.000761 +4 12.214690 -0.000575 +5 8.319164 0.018284 +6 4.091071 -0.005943 +7 2.286543 -0.043212 +8 1.159810 -0.112513 +9 0.591343 -0.052073 +10 0.312862 -0.092263 +11 0.184828 0.243946 +12 0.068590 0.413101 +13 0.026791 0.543985 +P 13 +1 84.914002 0.000019 +2 42.855051 0.000138 +3 21.700131 -0.004622 +4 12.214690 0.004465 +5 8.319164 0.065760 +6 4.091071 -0.018927 +7 2.286543 -0.222524 +8 1.159810 -0.523890 +9 0.591343 -0.071277 +10 0.312862 0.812712 +11 0.184828 0.625498 +12 0.068590 -0.812189 +13 0.026791 -0.185796 +P 13 +1 84.914002 -0.000257 +2 42.855051 0.001725 +3 21.700131 -0.012646 +4 12.214690 0.029062 +5 8.319164 0.058979 +6 4.091071 0.030806 +7 2.286543 -0.524373 +8 1.159810 -0.720968 +9 0.591343 1.023204 +10 0.312862 1.973874 +11 0.184828 -2.805092 +12 0.068590 0.607954 +13 0.026791 0.447653 +P 1 +1 0.026791 1.0 +P 1 +1 0.013 1.0 +D 11 +1 77.434559 0.000022 +2 27.708477 0.004218 +3 12.914284 0.030087 +4 6.062674 0.084821 +5 2.863898 0.171110 +6 1.386559 0.247451 +7 0.677058 0.277310 +8 0.329864 0.261077 +9 0.159474 0.190336 +10 0.076174 0.119385 +11 0.028570 0.031297 +D 11 +1 77.434559 -0.000025 +2 27.708477 -0.004311 +3 12.914284 -0.030913 +4 6.062674 -0.088049 +5 2.863898 -0.178330 +6 1.386559 -0.234335 +7 0.677058 -0.195775 +8 0.329864 0.065872 +9 0.159474 0.330536 +10 0.076174 0.461229 +11 0.028570 0.184273 +D 11 +1 77.434559 0.000010 +2 27.708477 0.006187 +3 12.914284 0.042630 +4 6.062674 0.127524 +5 2.863898 0.248289 +6 1.386559 0.259761 +7 0.677058 -0.070794 +8 0.329864 -0.519396 +9 0.159474 -0.373658 +10 0.076174 0.455067 +11 0.028570 0.489586 +D 1 +1 0.028570 1.0 +D 1 +1 0.014 1.0 +F 1 +1 0.066981 1.0 +F 1 +1 0.291553 1.0 +F 1 +1 1.269061 1.0 +G 1 +1 0.227422 1.0 +G 1 +1 0.707265 1.0 + +VANADIUM +S 13 +1 68.577621 0.000804 +2 34.937147 -0.011594 +3 17.939491 0.092209 +4 11.262123 -0.045477 +5 6.776264 -0.287983 +6 3.524091 -0.217648 +7 1.938421 0.407509 +8 0.927153 0.658193 +9 0.448420 0.255234 +10 0.209668 0.008620 +11 0.103660 0.002734 +12 0.050630 -0.001161 +13 0.024201 0.000294 +S 13 +1 68.577621 -0.000177 +2 34.937147 0.002791 +3 17.939491 -0.023650 +4 11.262123 0.012504 +5 6.776264 0.078761 +6 3.524091 0.054974 +7 1.938421 -0.118955 +8 0.927153 -0.245341 +9 0.448420 -0.222959 +10 0.209668 0.047809 +11 0.103660 0.415374 +12 0.050630 0.540880 +13 0.024201 0.183421 +S 13 +1 68.577621 -0.000583 +2 34.937147 0.009570 +3 17.939491 -0.085606 +4 11.262123 0.048426 +5 6.776264 0.331239 +6 3.524091 0.140352 +7 1.938421 -0.907962 +8 0.927153 -0.503878 +9 0.448420 0.398938 +10 0.209668 0.971131 +11 0.103660 0.423999 +12 0.050630 -0.628646 +13 0.024201 -0.467495 +S 13 +1 68.577621 -0.000765 +2 34.937147 0.014529 +3 17.939491 -0.139618 +4 11.262123 0.063073 +5 6.776264 0.704193 +6 3.524091 -0.011602 +7 1.938421 -2.311604 +8 0.927153 0.768269 +9 0.448420 2.168920 +10 0.209668 -1.062671 +11 0.103660 -1.218151 +12 0.050630 0.340809 +13 0.024201 0.713322 +S 1 +1 0.024201 1.0 +S 1 +1 0.012 1.0 +P 13 +1 96.215967 0.000069 +2 49.579340 -0.000672 +3 25.638009 0.008199 +4 14.025942 -0.027108 +5 8.740334 -0.053021 +6 4.634840 0.005002 +7 2.553374 0.261986 +8 1.321166 0.433544 +9 0.681285 0.324947 +10 0.349458 0.092342 +11 0.172773 0.008964 +12 0.063300 0.001185 +13 0.033969 0.000104 +P 13 +1 96.215967 0.000040 +2 49.579340 -0.000133 +3 25.638009 -0.000955 +4 14.025942 0.003719 +5 8.740334 0.018866 +6 4.634840 -0.012074 +7 2.553374 -0.057107 +8 1.321166 -0.146433 +9 0.681285 -0.067365 +10 0.349458 -0.068254 +11 0.172773 0.403103 +12 0.063300 0.502668 +13 0.033969 0.261291 +P 13 +1 96.215967 -0.000053 +2 49.579340 0.000023 +3 25.638009 0.004629 +4 14.025942 -0.007755 +5 8.740334 -0.104133 +6 4.634840 -0.017762 +7 2.553374 0.728212 +8 1.321166 0.218826 +9 0.681285 -0.493223 +10 0.349458 -0.838192 +11 0.172773 0.398401 +12 0.063300 0.664589 +13 0.033969 0.033011 +P 13 +1 96.215967 -0.001262 +2 49.579340 0.006419 +3 25.638009 -0.021229 +4 14.025942 0.115777 +5 8.740334 -0.420740 +6 4.634840 0.197742 +7 2.553374 1.575600 +8 1.321166 -1.067913 +9 0.681285 -1.310083 +10 0.349458 1.191147 +11 0.172773 0.550516 +12 0.063300 -0.718788 +13 0.033969 -0.157441 +P 1 +1 0.033969 1.0 +P 1 +1 0.016 1.0 +D 11 +1 89.989649 0.000051 +2 33.132961 0.004804 +3 15.879656 0.029485 +4 7.465803 0.086249 +5 3.551993 0.179728 +6 1.728185 0.261850 +7 0.850498 0.291794 +8 0.417673 0.259356 +9 0.201523 0.174944 +10 0.100711 0.062278 +11 0.058959 0.027653 +D 11 +1 89.989649 -0.000038 +2 33.132961 -0.004590 +3 15.879656 -0.027563 +4 7.465803 -0.082775 +5 3.551993 -0.173494 +6 1.728185 -0.236188 +7 0.850498 -0.149226 +8 0.417673 0.044145 +9 0.201523 0.390500 +10 0.100711 0.203064 +11 0.058959 0.398002 +D 11 +1 89.989649 0.000128 +2 33.132961 0.006652 +3 15.879656 0.044635 +4 7.465803 0.122559 +5 3.551993 0.311147 +6 1.728185 0.288813 +7 0.850498 -0.142246 +8 0.417673 -0.613737 +9 0.201523 -0.123916 +10 0.100711 -0.020235 +11 0.058959 0.733259 +D 1 +1 0.058959 1.0 +D 1 +1 0.027 1.0 +F 1 +1 0.131136 1.0 +F 1 +1 0.552620 1.0 +F 1 +1 2.328788 1.0 +G 1 +1 0.616440 1.0 +G 1 +1 1.977796 1.0 + +ZINC +S 13 + 1 114.485022 0.000429 + 2 61.996430 -0.019339 + 3 40.117132 0.086254 + 4 20.119649 -0.088955 + 5 10.171676 -0.402671 + 6 5.601641 0.067304 + 7 2.864122 0.479215 + 8 1.592779 0.503960 + 9 0.826525 0.222088 + 10 0.263975 0.012203 + 11 0.145302 -0.004300 + 12 0.068195 0.001243 + 13 0.031465 -0.000267 +S 13 + 1 114.485022 -0.000109 + 2 61.996430 0.004459 + 3 40.117132 -0.020067 + 4 20.119649 0.022338 + 5 10.171676 0.096698 + 6 5.601641 -0.021966 + 7 2.864122 -0.128768 + 8 1.592779 -0.181706 + 9 0.826525 -0.162311 + 10 0.263975 0.116264 + 11 0.145302 0.411314 + 12 0.068195 0.494257 + 13 0.031465 0.138103 +S 13 + 1 114.485022 0.000666 + 2 61.996430 0.006269 + 3 40.117132 -0.046603 + 4 20.119649 0.050399 + 5 10.171676 0.363493 + 6 5.601641 -0.242840 + 7 2.864122 -0.382281 + 8 1.592779 -0.861567 + 9 0.826525 0.706077 + 10 0.263975 1.495001 + 11 0.145302 -0.453994 + 12 0.068195 -0.597822 + 13 0.031465 -0.256117 +S 13 + 1 114.485022 0.000704 + 2 61.996430 0.012841 + 3 40.117132 -0.085910 + 4 20.119649 0.117982 + 5 10.171676 0.630164 + 6 5.601641 -0.600344 + 7 2.864122 -1.249060 + 8 1.592779 -0.329498 + 9 0.826525 2.592469 + 10 0.263975 -1.004481 + 11 0.145302 -1.379514 + 12 0.068195 1.046842 + 13 0.031465 0.324676 +S 1 + 1 0.031465 1.0 +S 1 + 1 0.015 1.0 +P 13 + 1 158.770986 -0.000153 + 2 75.802876 0.001893 + 3 44.547824 0.010461 + 4 31.445269 -0.045141 + 5 13.080125 -0.084201 + 6 7.788616 0.104973 + 7 4.195040 0.307714 + 8 2.362276 0.368563 + 9 1.302584 0.286336 + 10 0.660704 0.095156 + 11 0.249042 0.005851 + 12 0.091781 -0.000034 + 13 0.048931 0.000252 +P 13 + 1 158.770986 0.000053 + 2 75.802876 -0.000571 + 3 44.547824 -0.001073 + 4 31.445269 0.007463 + 5 13.080125 0.018676 + 6 7.788616 -0.028090 + 7 4.195040 -0.054438 + 8 2.362276 -0.093744 + 9 1.302584 -0.054169 + 10 0.660704 -0.007972 + 11 0.249042 0.356198 + 12 0.091781 0.412399 + 13 0.048931 0.361321 +P 13 + 1 158.770986 -0.000170 + 2 75.802876 0.000604 + 3 44.547824 -0.019987 + 4 31.445269 0.061153 + 5 13.080125 0.067317 + 6 7.788616 -0.139211 + 7 4.195040 -0.527041 + 8 2.362276 -0.176194 + 9 1.302584 0.037129 + 10 0.660704 1.079322 + 11 0.249042 -0.050149 + 12 0.091781 -0.688971 + 13 0.048931 0.037331 +P 13 + 1 158.770986 -0.000781 + 2 75.802876 0.007855 + 3 44.547824 -0.008671 + 4 31.445269 -0.040553 + 5 13.080125 -0.200062 + 6 7.788616 0.528599 + 7 4.195040 0.528552 + 8 2.362276 0.243576 + 9 1.302584 -1.807182 + 10 0.660704 0.629496 + 11 0.249042 1.137613 + 12 0.091781 -1.067150 + 13 0.048931 0.022190 +P 1 + 1 0.048931 1.0 +P 1 + 1 0.024 1.0 +D 11 + 1 270.014061 -0.000016 + 2 100.161579 0.000696 + 3 43.530609 0.013536 + 4 21.262419 0.069350 + 5 10.577821 0.149559 + 6 5.343620 0.239588 + 7 2.704857 0.286744 + 8 1.353018 0.271459 + 9 0.660873 0.202426 + 10 0.309149 0.103307 + 11 0.133879 0.023211 +D 11 + 1 270.014061 0.000013 + 2 100.161579 -0.000889 + 3 43.530609 -0.018640 + 4 21.262419 -0.094646 + 5 10.577821 -0.215659 + 6 5.343620 -0.322469 + 7 2.704857 -0.197529 + 8 1.353018 0.164448 + 9 0.660873 0.410017 + 10 0.309149 0.327838 + 11 0.133879 0.105749 +D 11 + 1 270.014061 0.000007 + 2 100.161579 0.000868 + 3 43.530609 0.021631 + 4 21.262419 0.107748 + 5 10.577821 0.278997 + 6 5.343620 0.314543 + 7 2.704857 -0.241926 + 8 1.353018 -0.602415 + 9 0.660873 -0.118013 + 10 0.309149 0.545482 + 11 0.133879 0.363829 +D 1 + 1 0.133879 1.0 +D 1 + 1 0.06 1.0 +F 1 + 1 0.385246 1.0 +F 1 + 1 1.520399 1.0 +F 1 + 1 6.000349 1.0 +G 1 + 1 1.418972 1.0 +G 1 + 1 4.099533 1.0 + +COPPER +S 13 +1 104.471138 0.000741 +2 55.955221 -0.013953 +3 30.553953 0.105266 +4 16.942394 -0.129399 +5 9.452707 -0.362738 +6 5.174537 0.013266 +7 2.779171 0.489288 +8 1.441817 0.562088 +9 0.710674 0.190047 +10 0.241540 0.005635 +11 0.129621 -0.000582 +12 0.059229 -0.000024 +13 0.027110 0.000030 +S 13 +1 104.471138 -0.000133 +2 55.955221 0.002999 +3 30.553953 -0.024310 +4 16.942394 0.031986 +5 9.452707 0.089149 +6 5.174537 -0.010750 +7 2.779171 -0.128224 +8 1.441817 -0.215720 +9 0.710674 -0.149559 +10 0.241540 0.142917 +11 0.129621 0.446307 +12 0.059229 0.484643 +13 0.027110 0.093069 +S 13 +1 104.471138 0.000210 +2 55.955221 0.003806 +3 30.553953 -0.047312 +4 16.942394 0.059957 +5 9.452707 0.250642 +6 5.174537 -0.119102 +7 2.779171 -0.314069 +8 1.441817 -0.689300 +9 0.710674 0.403050 +10 0.241540 1.270440 +11 0.129621 -0.029029 +12 0.059229 -0.622157 +13 0.027110 -0.442074 +S 13 +1 104.471138 0.000366 +2 55.955221 0.006720 +3 30.553953 -0.091493 +4 16.942394 0.142263 +5 9.452707 0.471881 +6 5.174537 -0.319708 +7 2.779171 -1.068255 +8 1.441817 -0.615049 +9 0.710674 2.261282 +10 0.241540 -0.020059 +11 0.129621 -1.815746 +12 0.059229 0.474174 +13 0.027110 0.713597 +S 1 +1 0.027110 1.0 +S 1 +1 0.013 1.0 +P 13 +1 159.152840 0.000026 +2 83.322776 -0.000402 +3 44.840311 0.007405 +4 25.020360 -0.030714 +5 13.610016 -0.074348 +6 7.761318 0.043430 +7 4.303947 0.289703 +8 2.290080 0.413467 +9 1.202173 0.303762 +10 0.607647 0.093494 +11 0.257656 0.006663 +12 0.090897 0.000567 +13 0.041925 0.000176 +P 13 +1 159.152840 0.000034 +2 83.322776 -0.000129 +3 44.840311 -0.000802 +4 25.020360 0.004747 +5 13.610016 0.018595 +6 7.761318 -0.017692 +7 4.303947 -0.052614 +8 2.290080 -0.110349 +9 1.202173 -0.054701 +10 0.607647 -0.026655 +11 0.257656 0.335880 +12 0.090897 0.509478 +13 0.041925 0.302559 +P 13 +1 159.152840 -0.000228 +2 83.322776 0.001414 +3 44.840311 -0.010290 +4 25.020360 0.043896 +5 13.610016 0.052865 +6 7.761318 -0.056565 +7 4.303947 -0.480715 +8 2.290080 -0.315984 +9 1.202173 0.075679 +10 0.607647 1.060747 +11 0.257656 -0.008061 +12 0.090897 -0.701601 +13 0.041925 0.006941 +P 13 +1 159.152840 -0.000412 +2 83.322776 0.001957 +3 44.840311 0.000640 +4 25.020360 -0.036753 +5 13.610016 -0.147193 +6 7.761318 0.297782 +7 4.303947 0.705271 +8 2.290080 0.196466 +9 1.202173 -1.659406 +10 0.607647 0.391500 +11 0.257656 1.243284 +12 0.090897 -0.957529 +13 0.041925 -0.056091 +P 1 +1 0.041925 1.0 +P 1 +1 0.02 1.0 +D 11 +1 226.693527 0.000015 +2 73.010278 0.004108 +3 38.536518 0.028223 +4 18.726700 0.069323 +5 9.155485 0.156045 +6 4.540884 0.251238 +7 2.241175 0.297463 +8 1.085869 0.274981 +9 0.510612 0.193098 +10 0.229608 0.086393 +11 0.095781 0.014645 +D 11 +1 226.693527 -0.000013 +2 73.010278 -0.005252 +3 38.536518 -0.034982 +4 18.726700 -0.088950 +5 9.155485 -0.207194 +6 4.540884 -0.302597 +7 2.241175 -0.179327 +8 1.085869 0.169069 +9 0.510612 0.405904 +10 0.229608 0.341871 +11 0.095781 0.117080 +D 11 +1 226.693527 0.000016 +2 73.010278 0.006157 +3 38.536518 0.040361 +4 18.726700 0.106038 +5 9.155485 0.263299 +6 4.540884 0.288496 +7 2.241175 -0.186745 +8 1.085869 -0.591539 +9 0.510612 -0.138681 +10 0.229608 0.547749 +11 0.095781 0.362353 +D 1 +1 0.095781 1.0 +D 1 +1 0.045 1.0 +F 1 +1 0.331485 1.0 +F 1 +1 1.316717 1.0 +F 1 +1 5.230236 1.0 +G 1 +1 1.168290 1.0 +G 1 +1 3.445758 1.0 diff --git a/data/pseudo/ncsu b/data/pseudo/ncsu new file mode 100644 index 00000000..ee17ba13 --- /dev/null +++ b/data/pseudo/ncsu @@ -0,0 +1,183 @@ +H GEN 0 1 +3 +-10.851924053 2 21.7769665504 +1.0 1 21.2435950826 +21.2435950826 3 21.2435950826 +1 +0.0 2 1.0 + +C GEN 2 1 +3 +4.0 1 14.43502 +57.74008 3 8.39889 +-25.81955 2 7.38188 +1 +52.13345 2 7.76079 + +Cl GEN 10 2 +3 +7.0 1 22.71655173 +159.01586213 3 78.57185685 +-15.6531065 2 7.47352436 +2 +6.50888648 2 17.23708573 +46.763467 2 4.31148447 +2 +2.9946477 2 11.38275704 +28.0170341 2 3.83218762 + +Co GEN 10 2 +4 +17.0 1 24.7400138129 +420.580234819 3 23.5426031368 +-194.630579018 2 24.0406241364 +-2.94301943013 2 10.237411369 +2 +270.86974114 2 23.0205711168 +54.1910212498 2 10.9219568474 +2 +200.63032558 2 25.3244045243 +38.9480947892 2 10.6533915029 + +Cr GEN 10 2 +4 +14.0 1 18.2809107439 +255.932750414 3 17.0980065531 +-132.018263171 2 16.7226727605 +-0.773887613451 2 5.02865105891 +2 +219.481462096 2 16.9007876081 +28.079331766 2 7.33662150761 +2 +139.983968717 2 17.3197451654 +19.5483578632 2 6.92409757503 + +F GEN 2 1 +3 +7.0 1 11.3954401213 +79.7680808491 3 10.49201883 +-49.4990068225 2 10.2868054098 +1 +51.3934743997 2 11.3903478843 + +Fe GEN 10 2 +4 +16.0 1 23.2209171361 +371.534674178 3 23.5471467972 +-181.226034452 2 23.4725634461 +-2.3730523614 2 9.85238815041 +2 +277.500325475 2 22.2106269743 +46.2049558527 2 9.51515800919 +2 +194.998750566 2 24.5700087185 +31.6794513291 2 8.86648776669 + +Mn GEN 10 2 +4 +15.0 1 21.9061889166 +328.592833748 3 21.3460106503 +-162.049880237 2 21.2709151562 +-1.85679609726 2 7.90771171833 +2 +244.669998154 2 18.9263045646 +33.5399867643 2 8.31114792811 +2 +162.350195446 2 20.162449313 +24.1593874179 2 7.79269955633 + +Ni GEN 10 2 +4 +18.0 1 37.839331506 +681.107967108 3 23.875701156 +-173.162219465 2 19.8803935987 +0.34274858261 2 3.56565870195 +2 +91.6513902571 2 13.545098213 +331.659352198 2 27.7907700999 +2 +7.5147228016 2 6.46792786898 +265.586894944 2 23.6921476759 + +O GEN 2 1 +3 +6.0 1 12.30997 +73.85984 3 14.76962 +-47.876 2 13.71419 +1 +85.86406 2 13.65512 + +S GEN 2 1 +3 + 14.00000000 1 17.46806994 + 244.55297916 3 16.40396851 + -128.37752591 2 16.71429998 +2 + 30.00006536 2 54.87912854 + 125.50010056 2 31.32968867 + +Sc GEN 10 2 +4 +11.0 1 16.0484863686 +176.533350054 3 14.07764439 +-83.673420518 2 11.993486653 +0.331064789149 2 3.75115298216 +2 +153.959870288 2 11.4712713921 +14.9643185607 2 5.00756742752 +2 +97.2094454291 2 11.4449481137 +10.8162163087 2 4.78509457131 + +Ti GEN 10 2 +4 +12.0 1 18.4136620219 +220.963944263 3 15.9229241432 +-94.2902582468 2 13.6500062314 +0.0979114248227 2 5.0955521057 +2 +173.946572359 2 12.7058061392 +18.8376833381 2 6.11178551988 +2 +111.45672882 2 12.6409192965 +11.1770268269 2 5.35437415684 + +V GEN 10 2 +4 +13.0 1 20.3216891426 +264.181958854 3 19.5969804012 +-115.292932083 2 17.3314734817 +-0.662887260057 2 5.12320657929 +2 +195.567138911 2 15.1250215054 +22.8864283476 2 6.2989891447 +2 +126.421195008 2 15.9385511327 +16.0359712766 2 5.74006266866 + +Zn GEN 10 2 +4 +20.0 1 35.8079761618 +716.159523235 3 34.536460837 +-204.683933235 2 28.6283017827 +0.760266144617 2 7.9623968256 +2 +95.8764043739 2 14.6349869153 +431.708043027 2 35.0214135667 +2 +74.0127004894 2 14.5742930415 +313.577705639 2 42.2297923499 + +Cu GEN 10 2 +4 +19.0 1 31.5381126304 +599.224139977 3 31.0692553147 +-244.689154841 2 30.5903586806 +-1.2934952584 2 14.0514106386 +2 +66.2756081341 2 12.7723591969 +370.71371825 2 29.355622426 +2 +49.7626505709 2 12.5247148487 +271.662810283 2 33.5169454376 + diff --git a/install/scripts/install_f77zmq.sh b/install/scripts/install_f77zmq.sh index 92388337..15d81c96 100755 --- a/install/scripts/install_f77zmq.sh +++ b/install/scripts/install_f77zmq.sh @@ -14,7 +14,7 @@ function _install() make -j 8 || exit 1 mv libf77zmq.a "${QP_ROOT}"/lib || exit 1 mv libf77zmq.so "${QP_ROOT}"/lib || exit 1 - cp f77_zmq.h "${QP_ROOT}"/src/ZMQ/ + cp f77_zmq_free.h "${QP_ROOT}"/src/ZMQ/f77_zmq.h cd - return 0 } diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index 91099fa2..cf5ad505 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -5,7 +5,7 @@ QP_ROOT=$PWD cd - # Normal installation -PACKAGES="core.v0.10.0 cryptokit ocamlfind sexplib.v0.10.0 ZMQ ppx_sexp_conv ppx_deriving jbuilder.1.0+beta17" +PACKAGES="core.v0.10.0 cryptokit ocamlfind sexplib.v0.10.0 zmq ppx_sexp_conv ppx_deriving jbuilder.1.0+beta17" # Needed for ZeroMQ export C_INCLUDE_PATH="${QP_ROOT}"/include:"${C_INCLUDE_PATH}" diff --git a/install/scripts/install_zeromq.sh b/install/scripts/install_zeromq.sh index f6596f9c..cd834672 100755 --- a/install/scripts/install_zeromq.sh +++ b/install/scripts/install_zeromq.sh @@ -11,7 +11,8 @@ function _install() set -u ORIG=$(pwd) cd "${BUILD}" - ./configure --prefix=$QP_ROOT --without-libsodium || exit 1 + ./autogen.sh + ./configure --prefix=$QP_ROOT --without-libsodium --disable-libunwind || exit 1 make -j 8 || exit 1 make install || exit 1 cd ${ORIG} diff --git a/lib64 b/lib64 deleted file mode 120000 index 7951405f..00000000 --- a/lib64 +++ /dev/null @@ -1 +0,0 @@ -lib \ No newline at end of file diff --git a/ocaml/Makefile b/ocaml/Makefile index b666187f..3a3d3411 100644 --- a/ocaml/Makefile +++ b/ocaml/Makefile @@ -12,7 +12,8 @@ endif LIBS= PKGS= OCAMLCFLAGS="-g" -OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS) +OCAMLOPTFLAGS="opt -O3 -remove-unused-arguments -rounds 16 -inline 100 -inline-max-unroll 100" +OCAMLBUILD=ocamlbuild -j 0 -cflags $(OCAMLCFLAGS) -lflags $(OCAMLCFLAGS) -ocamlopt $(OCAMLOPTFLAGS) MLLFILES=$(wildcard *.mll) MLFILES=$(wildcard *.ml) ezfio.ml Qptypes.ml Input_auto_generated.ml qp_edit.ml MLIFILES=$(wildcard *.mli) git diff --git a/ocaml/Symmetry.ml b/ocaml/Symmetry.ml index 7b088b73..4cf84f2d 100644 --- a/ocaml/Symmetry.ml +++ b/ocaml/Symmetry.ml @@ -16,30 +16,30 @@ let to_string = function | L -> "L" let of_string = function - | "S" -> S - | "P" -> P - | "D" -> D - | "F" -> F - | "G" -> G - | "H" -> H - | "I" -> I - | "J" -> J - | "K" -> K - | "L" -> L + | "S" | "s" -> S + | "P" | "p" -> P + | "D" | "d" -> D + | "F" | "f" -> F + | "G" | "g" -> G + | "H" | "h" -> H + | "I" | "i" -> I + | "J" | "j" -> J + | "K" | "k" -> K + | "L" | "l" -> L | x -> raise (Failure ("Symmetry should be S|P|D|F|G|H|I|J|K|L, not "^x^".")) let of_char = function - | 'S' -> S - | 'P' -> P - | 'D' -> D - | 'F' -> F - | 'G' -> G - | 'H' -> H - | 'I' -> I - | 'J' -> J - | 'K' -> K - | 'L' -> L + | 'S' | 's' -> S + | 'P' | 'p' -> P + | 'D' | 'd' -> D + | 'F' | 'f' -> F + | 'G' | 'g' -> G + | 'H' | 'h' -> H + | 'I' | 'i' -> I + | 'J' | 'j' -> J + | 'K' | 'k' -> K + | 'L' | 'l' -> L | x -> raise (Failure ("Symmetry should be S|P|D|F|G|H|I|J|K|L")) let to_l = function diff --git a/ocaml/TaskServer.ml b/ocaml/TaskServer.ml index ca295971..506b1639 100644 --- a/ocaml/TaskServer.ml +++ b/ocaml/TaskServer.ml @@ -47,10 +47,10 @@ let debug str = let zmq_context = - ZMQ.Context.create () + Zmq.Context.create () let () = - ZMQ.Context.set_io_threads zmq_context 8 + Zmq.Context.set_io_threads zmq_context 8 let bind_socket ~socket_type ~socket ~port = @@ -61,7 +61,7 @@ let bind_socket ~socket_type ~socket ~port = | -1 -> () | i -> try - ZMQ.Socket.bind socket @@ Printf.sprintf "tcp://*:%d" port; + Zmq.Socket.bind socket @@ Printf.sprintf "tcp://*:%d" port; loop (-1) with | Unix.Unix_error _ -> (Time.pause @@ Time.Span.of_sec 1. ; loop (i-1) ) @@ -105,31 +105,31 @@ let ip_address = lazy ( let reply_ok rep_socket = Message.Ok_msg.create |> Message.Ok_msg.to_string - |> ZMQ.Socket.send rep_socket + |> Zmq.Socket.send rep_socket let reply_wrong_state rep_socket = Message.Error_msg.create "Wrong state" |> Message.Error_msg.to_string - |> ZMQ.Socket.send rep_socket + |> Zmq.Socket.send rep_socket let stop ~port = debug "STOP"; let req_socket = - ZMQ.Socket.create zmq_context ZMQ.Socket.req + Zmq.Socket.create zmq_context Zmq.Socket.req and address = Printf.sprintf "tcp://localhost:%d" port in - ZMQ.Socket.set_linger_period req_socket 1_000_000; - ZMQ.Socket.connect req_socket address; + Zmq.Socket.set_linger_period req_socket 1_000_000; + Zmq.Socket.connect req_socket address; Message.Terminate (Message.Terminate_msg.create) |> Message.to_string - |> ZMQ.Socket.send req_socket ; + |> Zmq.Socket.send req_socket ; let msg = - ZMQ.Socket.recv req_socket + Zmq.Socket.recv req_socket |> Message.of_string in let () = @@ -137,8 +137,8 @@ let stop ~port = | Message.Ok _ -> () | _ -> failwith "Problem in termination" in - ZMQ.Socket.set_linger_period req_socket 1_000; - ZMQ.Socket.close req_socket + Zmq.Socket.set_linger_period req_socket 1_000; + Zmq.Socket.close req_socket let new_job msg program_state rep_socket pair_socket = @@ -166,7 +166,7 @@ let new_job msg program_state rep_socket pair_socket = in reply_ok rep_socket; string_of_pub_state Waiting - |> ZMQ.Socket.send pair_socket ; + |> Zmq.Socket.send pair_socket ; result let change_pub_state msg program_state rep_socket pair_socket = @@ -186,7 +186,7 @@ let change_pub_state msg program_state rep_socket pair_socket = in reply_ok rep_socket; string_of_pub_state msg - |> ZMQ.Socket.send pair_socket ; + |> Zmq.Socket.send pair_socket ; program_state @@ -216,7 +216,7 @@ let end_job msg program_state rep_socket pair_socket = Printf.sprintf "waiting for %d slaves..." n |> Message.Error_msg.create |> Message.Error_msg.to_string - |> ZMQ.Socket.send rep_socket ; + |> Zmq.Socket.send rep_socket ; program_state in @@ -227,13 +227,13 @@ let end_job msg program_state rep_socket pair_socket = if (msg.Message.Endjob_msg.state = force_state) then begin string_of_pub_state Waiting - |> ZMQ.Socket.send pair_socket ; + |> Zmq.Socket.send pair_socket ; success () end else if (msg.Message.Endjob_msg.state = state) then begin string_of_pub_state Waiting - |> ZMQ.Socket.send pair_socket ; + |> Zmq.Socket.send pair_socket ; if (Queuing_system.number_of_clients program_state.queue = 0) then success () else @@ -280,7 +280,7 @@ let connect msg program_state rep_socket = Message.ConnectReply (Message.ConnectReply_msg.create ~state:state ~client_id ~push_address) |> Message.to_string - |> ZMQ.Socket.send rep_socket ; + |> Zmq.Socket.send rep_socket ; { program_state with queue = new_queue } @@ -306,7 +306,7 @@ let disconnect msg program_state rep_socket = in Message.DisconnectReply (Message.DisconnectReply_msg.create ~state) |> Message.to_string - |> ZMQ.Socket.send rep_socket ; + |> Zmq.Socket.send rep_socket ; new_program_state in @@ -352,7 +352,7 @@ let del_task msg program_state rep_socket = in Message.DelTaskReply (Message.DelTaskReply_msg.create ~task_ids ~more) |> Message.to_string - |> ZMQ.Socket.send ~block:true rep_socket ; (** /!\ Has to be blocking *) + |> Zmq.Socket.send ~block:true rep_socket ; (** /!\ Has to be blocking *) new_program_state in @@ -426,10 +426,10 @@ let get_task msg program_state rep_socket pair_socket = if no_task then string_of_pub_state Waiting - |> ZMQ.Socket.send pair_socket + |> Zmq.Socket.send pair_socket else string_of_pub_state (Running (Message.State.to_string state)) - |> ZMQ.Socket.send pair_socket; + |> Zmq.Socket.send pair_socket; let new_program_state = { program_state with @@ -440,7 +440,7 @@ let get_task msg program_state rep_socket pair_socket = Message.GetTaskReply (Message.GetTaskReply_msg.create ~task ~task_id) |> Message.to_string - |> ZMQ.Socket.send rep_socket ; + |> Zmq.Socket.send rep_socket ; new_program_state in @@ -498,10 +498,10 @@ let get_tasks msg program_state rep_socket pair_socket = if no_task then string_of_pub_state Waiting - |> ZMQ.Socket.send pair_socket + |> Zmq.Socket.send pair_socket else string_of_pub_state (Running (Message.State.to_string state)) - |> ZMQ.Socket.send pair_socket; + |> Zmq.Socket.send pair_socket; let new_program_state = { program_state with @@ -512,7 +512,7 @@ let get_tasks msg program_state rep_socket pair_socket = Message.GetTasksReply (Message.GetTasksReply_msg.create result) |> Message.to_string_list - |> ZMQ.Socket.send_all rep_socket ; + |> Zmq.Socket.send_all rep_socket ; new_program_state in @@ -596,7 +596,7 @@ let put_data msg rest_of_msg program_state rep_socket = StringHashtbl.set program_state.data ~key ~data:value ; Message.PutDataReply (Message.PutDataReply_msg.create ()) |> Message.to_string - |> ZMQ.Socket.send rep_socket; + |> Zmq.Socket.send rep_socket; program_state and failure () = @@ -625,11 +625,11 @@ let get_data msg program_state rep_socket = let value = match StringHashtbl.find program_state.data key with | Some value -> value - | None -> "" + | None -> "\000" in Message.GetDataReply (Message.GetDataReply_msg.create ~value) |> Message.to_string_list - |> ZMQ.Socket.send_all rep_socket; + |> Zmq.Socket.send_all rep_socket; program_state and failure () = @@ -699,7 +699,7 @@ let abort program_state rep_socket = let error msg program_state rep_socket = Message.Error (Message.Error_msg.create msg) |> Message.to_string - |> ZMQ.Socket.send rep_socket ; + |> Zmq.Socket.send rep_socket ; program_state let start_pub_thread ~port = @@ -709,54 +709,54 @@ let start_pub_thread ~port = in let pair_socket = - ZMQ.Socket.create zmq_context ZMQ.Socket.pair + Zmq.Socket.create zmq_context Zmq.Socket.pair and address = "inproc://pair" in - ZMQ.Socket.connect pair_socket address; + Zmq.Socket.connect pair_socket address; let pub_socket = - ZMQ.Socket.create zmq_context ZMQ.Socket.pub + Zmq.Socket.create zmq_context Zmq.Socket.pub in bind_socket ~socket_type:"PUB" ~socket:pub_socket ~port; let pollitem = - ZMQ.Poll.mask_of - [| (pair_socket, ZMQ.Poll.In) |] + Zmq.Poll.mask_of + [| (pair_socket, Zmq.Poll.In) |] in let rec run state = let new_state = let polling = - ZMQ.Poll.poll ~timeout pollitem + Zmq.Poll.poll ~timeout pollitem in - if (polling.(0) = Some ZMQ.Poll.In) then - ZMQ.Socket.recv ~block:false pair_socket + if (polling.(0) = Some Zmq.Poll.In) then + Zmq.Socket.recv ~block:false pair_socket |> pub_state_of_string else state in - ZMQ.Socket.send pub_socket @@ string_of_pub_state new_state; + Zmq.Socket.send pub_socket @@ string_of_pub_state new_state; match state with | Stopped -> () | _ -> run new_state in run Waiting; - ZMQ.Socket.set_linger_period pair_socket 1000 ; - ZMQ.Socket.close pair_socket; - ZMQ.Socket.set_linger_period pub_socket 1000 ; - ZMQ.Socket.close pub_socket; + Zmq.Socket.set_linger_period pair_socket 1000 ; + Zmq.Socket.close pair_socket; + Zmq.Socket.set_linger_period pub_socket 1000 ; + Zmq.Socket.close pub_socket; ) let run ~port = (** Bind inproc socket for changing state of pub *) let pair_socket = - ZMQ.Socket.create zmq_context ZMQ.Socket.pair + Zmq.Socket.create zmq_context Zmq.Socket.pair and address = "inproc://pair" in - ZMQ.Socket.bind pair_socket address; + Zmq.Socket.bind pair_socket address; let pub_thread = start_pub_thread ~port:(port+1) () @@ -764,9 +764,9 @@ let run ~port = (** Bind REP socket *) let rep_socket = - ZMQ.Socket.create zmq_context ZMQ.Socket.rep + Zmq.Socket.create zmq_context Zmq.Socket.rep in - ZMQ.Socket.set_linger_period rep_socket 1_000_000; + Zmq.Socket.set_linger_period rep_socket 1_000_000; bind_socket "REP" rep_socket port; let initial_program_state = @@ -783,8 +783,8 @@ let run ~port = (** ZMR polling item *) let pollitem = - ZMQ.Poll.mask_of - [| (rep_socket, ZMQ.Poll.In) |] + Zmq.Poll.mask_of + [| (rep_socket, Zmq.Poll.In) |] in let address = @@ -798,9 +798,9 @@ let run ~port = | false -> () | true -> let polling = - ZMQ.Poll.poll ~timeout:1000 pollitem + Zmq.Poll.poll ~timeout:1000 pollitem in - if (polling.(0) <> Some ZMQ.Poll.In) then + if (polling.(0) <> Some Zmq.Poll.In) then main_loop program_state true else begin @@ -818,7 +818,7 @@ let run ~port = (** Extract message *) let raw_message, rest = - match ZMQ.Socket.recv_all rep_socket with + match Zmq.Socket.recv_all rep_socket with | x :: rest -> x, rest | [] -> failwith "Badly formed message" in @@ -874,9 +874,9 @@ let run ~port = end in main_loop initial_program_state true; - ZMQ.Socket.send pair_socket @@ string_of_pub_state Stopped; + Zmq.Socket.send pair_socket @@ string_of_pub_state Stopped; Thread.join pub_thread; - ZMQ.Socket.close rep_socket + Zmq.Socket.close rep_socket diff --git a/ocaml/TaskServer.mli b/ocaml/TaskServer.mli index c492756d..e3801423 100644 --- a/ocaml/TaskServer.mli +++ b/ocaml/TaskServer.mli @@ -19,14 +19,14 @@ val debug_env : bool (** Print a debug message *) val debug : string -> unit -(** {1} ZMQ *) +(** {1} Zmq *) (** ZeroMQ context *) -val zmq_context : ZMQ.Context.t +val zmq_context : Zmq.Context.t -(** Bind a ZMQ socket to a TCP port and to an IPC file /tmp/qp_run. *) +(** Bind a Zmq socket to a TCP port and to an IPC file /tmp/qp_run. *) val bind_socket : - socket_type:string -> socket:'a ZMQ.Socket.t -> port:int -> unit + socket_type:string -> socket:'a Zmq.Socket.t -> port:int -> unit (** Name of the host on which the server runs *) val hostname : string lazy_t @@ -35,8 +35,8 @@ val hostname : string lazy_t val ip_address : string lazy_t (** Standard messages *) -val reply_ok : [> `Req ] ZMQ.Socket.t -> unit -val reply_wrong_state : [> `Req ] ZMQ.Socket.t -> unit +val reply_ok : [> `Req ] Zmq.Socket.t -> unit +val reply_wrong_state : [> `Req ] Zmq.Socket.t -> unit (** Stop server *) val stop : port:int -> unit @@ -44,34 +44,34 @@ val stop : port:int -> unit (** {1} Server functions *) (** Create a new job *) -val new_job : Message.Newjob_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> [> `Pair] ZMQ.Socket.t -> t +val new_job : Message.Newjob_msg.t -> t -> [> `Req ] Zmq.Socket.t -> [> `Pair] Zmq.Socket.t -> t (** Finish a running job *) -val end_job : Message.Endjob_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> [> `Pair] ZMQ.Socket.t -> t +val end_job : Message.Endjob_msg.t -> t -> [> `Req ] Zmq.Socket.t -> [> `Pair] Zmq.Socket.t -> t (** Connect a client *) -val connect: Message.Connect_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t +val connect: Message.Connect_msg.t -> t -> [> `Req ] Zmq.Socket.t -> t (** Disconnect a client *) -val disconnect: Message.Disconnect_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t +val disconnect: Message.Disconnect_msg.t -> t -> [> `Req ] Zmq.Socket.t -> t (** Add a task to the pool *) -val add_task: Message.AddTask_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t +val add_task: Message.AddTask_msg.t -> t -> [> `Req ] Zmq.Socket.t -> t (** Mark the task as done by the client *) -val task_done: Message.TaskDone_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t +val task_done: Message.TaskDone_msg.t -> t -> [> `Req ] Zmq.Socket.t -> t (** Delete a task when it has been pulled by the collector *) -val del_task: Message.DelTask_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> t +val del_task: Message.DelTask_msg.t -> t -> [> `Req ] Zmq.Socket.t -> t (** The client get a new task to execute *) -val get_task: Message.GetTask_msg.t -> t -> [> `Req ] ZMQ.Socket.t -> [> `Pair] ZMQ.Socket.t -> t +val get_task: Message.GetTask_msg.t -> t -> [> `Req ] Zmq.Socket.t -> [> `Pair] Zmq.Socket.t -> t (** Terminate server *) -val terminate : t -> [> `Req ] ZMQ.Socket.t -> t +val terminate : t -> [> `Req ] Zmq.Socket.t -> t (** Reply an Error message *) -val error : string -> t -> [> `Req ] ZMQ.Socket.t -> t +val error : string -> t -> [> `Req ] Zmq.Socket.t -> t (** Run server *) val run : port:int -> unit diff --git a/ocaml/_tags b/ocaml/_tags index aa36989b..bf267415 100644 --- a/ocaml/_tags +++ b/ocaml/_tags @@ -1,3 +1,3 @@ -true: package(core,cryptokit,ZMQ,str,ppx_sexp_conv,ppx_deriving) +true: package(core,cryptokit,zmq,str,ppx_sexp_conv,ppx_deriving) true: thread false: profile diff --git a/ocaml/qp_find_pi_space.ml b/ocaml/qp_find_pi_space.ml index dcd671ce..b3702d42 100644 --- a/ocaml/qp_find_pi_space.ml +++ b/ocaml/qp_find_pi_space.ml @@ -2,7 +2,7 @@ open Core open Qputils open Qptypes -let run ?(sym="None") ezfio_filename = +let run ?(sym="None") ?(apply="no") fc ezfio_filename = Ezfio.set_file ezfio_filename ; let aos = @@ -72,28 +72,79 @@ let run ?(sym="None") ezfio_filename = | _ -> ([],[]) in - match sym with - | "x" | "X" | "y" | "Y" | "z" | "Z" -> - begin - Printf.printf "Pi: ["; - List.iter ~f:(fun mo_i -> Printf.printf "%d," mo_i) pi; - Printf.printf "\b]\n\nSigma: ["; - List.iter ~f:(fun mo_i -> Printf.printf "%d," mo_i) sigma; - Printf.printf "\b]\n" - end - | _ -> List.iter ~f:(fun (mo_i,x,y,z) -> Printf.printf "%d: (%f,%f,%f)\n" mo_i x y z) result - + begin + match sym with + | "x" | "X" | "y" | "Y" | "z" | "Z" -> + if apply = "cas" then + begin + let ne = Ezfio.get_electrons_elec_alpha_num () in + let command = + "qp_set_mo_class -act \"[" ^ + (String.concat ~sep:"," @@ List.map ~f:string_of_int pi) ^ + "]\" -core \"[" ^ + (String.concat ~sep:"," @@ List.map ~f:string_of_int @@ List.filter ~f:(fun mo_i -> mo_i <= ne) sigma) ^ + "]\" -del \"[" ^ + (String.concat ~sep:"," @@ List.map ~f:string_of_int @@ List.filter ~f:(fun mo_i -> mo_i > ne) sigma) ^ + "]\" " ^ ezfio_filename + in + print_endline command; + if Sys.command command <> 0 then + failwith "Command failed" + end + else if apply = "cassd" then + begin + let ne = Ezfio.get_electrons_elec_alpha_num () in + let nfc = + if fc then + let ic = + Unix.open_process_in ("qp_set_frozen_core.py -q "^ezfio_filename) + in + let result = int_of_string @@ input_line ic in + close_in ic; result + else 0 + in + let command = + "qp_set_mo_class" ^ + ( if nfc > 0 then + Printf.sprintf " -core \"[1-%d]\"" nfc else "") ^ + " -inact \"[" ^ + (String.concat ~sep:"," @@ List.map ~f:string_of_int @@ List.filter ~f:(fun mo_i -> mo_i > nfc && mo_i <= ne) sigma) ^ "]\"" ^ + " -act \"[" ^ (String.concat ~sep:"," @@ List.map ~f:string_of_int pi) ^ "]\"" ^ + " -virt \"[" ^ + (String.concat ~sep:"," @@ List.map ~f:string_of_int @@ List.filter ~f:(fun mo_i -> mo_i > ne) sigma) ^ "]\" " ^ ezfio_filename + in + print_endline command; + if Sys.command command <> 0 then + failwith "Command failed" + end + else + begin + Printf.printf "Pi: ["; + List.iter ~f:(fun mo_i -> Printf.printf "%d," mo_i) pi; + Printf.printf "\b]\n\nSigma: ["; + List.iter ~f:(fun mo_i -> Printf.printf "%d," mo_i) sigma; + Printf.printf "\b]\n" + end + | _ -> List.iter ~f:(fun (mo_i,x,y,z) -> Printf.printf "%d: (%f,%f,%f)\n" mo_i x y z) result + end + let spec = let open Command.Spec in empty - +> flag "sym" (optional string) ~doc:"{x,y,z} Axis perpendicular to the plane" + +> flag "sym" (optional string) + ~doc:"{x,y,z} Axis perpendicular to the plane" + +> flag "apply" (optional string) + ~doc:"[cas|cassd] Set the pi space as the active space, all other MOs frozen. If [cassd] is chosen, set inactive and virtual mos." + +> flag "fc" no_arg + ~doc:"freeze core MOs with -apply cassd" +> anon ("ezfio_filename" %: string) + let command = Command.basic_spec ~summary: "Quantum Package command" @@ -101,7 +152,7 @@ let command = "Find all the pi molecular orbitals to create a pi space. ") spec - (fun sym ezfio_filename () -> run ?sym ezfio_filename ) + (fun sym apply fc ezfio_filename () -> run ?sym ?apply fc ezfio_filename) let () = diff --git a/ocaml/qp_run.ml b/ocaml/qp_run.ml index f3f0b14e..49fa13d4 100644 --- a/ocaml/qp_run.ml +++ b/ocaml/qp_run.ml @@ -20,10 +20,10 @@ let run slave exe ezfio_file = (** Check availability of the ports *) let port_number = let zmq_context = - ZMQ.Context.create () + Zmq.Context.create () in let dummy_socket = - ZMQ.Socket.create zmq_context ZMQ.Socket.rep + Zmq.Socket.create zmq_context Zmq.Socket.rep in let rec try_new_port port_number = try @@ -31,8 +31,8 @@ let run slave exe ezfio_file = let address = Printf.sprintf "tcp://%s:%d" (Lazy.force TaskServer.ip_address) (port_number+i) in - ZMQ.Socket.bind dummy_socket address; - ZMQ.Socket.unbind dummy_socket address; + Zmq.Socket.bind dummy_socket address; + Zmq.Socket.unbind dummy_socket address; ); port_number with @@ -41,8 +41,8 @@ let run slave exe ezfio_file = let result = try_new_port 41279 in - ZMQ.Socket.close dummy_socket; - ZMQ.Context.terminate zmq_context; + Zmq.Socket.close dummy_socket; + Zmq.Context.terminate zmq_context; result in diff --git a/ocaml/qptypes_generator.ml b/ocaml/qptypes_generator.ml index d76120b8..3d5950a5 100644 --- a/ocaml/qptypes_generator.ml +++ b/ocaml/qptypes_generator.ml @@ -84,8 +84,8 @@ let input_data = " * MO_coef : float * MO_occ : float - if (x < 0.) || (x > 2.) then - raise (Invalid_argument (Printf.sprintf \"MO_occ : (0. <= x <= 2.) : x=%f\" x)); + if x < 0. then 0. else + if x > 2. then 2. else * AO_coef : float diff --git a/plugins/Bk/EZFIO.cfg b/plugins/Bk/EZFIO.cfg index 52d41568..c594bcf8 100644 --- a/plugins/Bk/EZFIO.cfg +++ b/plugins/Bk/EZFIO.cfg @@ -15,3 +15,9 @@ doc: Maximum number of dressed CI iterations interface: ezfio,provider,ocaml default: 10 +[h0_type] +type: Perturbation +doc: Type of zeroth-order Hamiltonian [ EN | Barycentric ] +interface: ezfio,provider,ocaml +default: EN + diff --git a/plugins/Bk/NEEDED_CHILDREN_MODULES b/plugins/Bk/NEEDED_CHILDREN_MODULES index 6bcca9aa..709c29ec 100644 --- a/plugins/Bk/NEEDED_CHILDREN_MODULES +++ b/plugins/Bk/NEEDED_CHILDREN_MODULES @@ -1,2 +1,2 @@ -Bitmask dress_zmq DavidsonDressed +Bitmask dress_zmq DavidsonDressed Generators_full Selectors_full diff --git a/plugins/Bk/dressing.irp.f b/plugins/Bk/dressing.irp.f index 0fbefda5..721a7554 100644 --- a/plugins/Bk/dressing.irp.f +++ b/plugins/Bk/dressing.irp.f @@ -53,7 +53,9 @@ subroutine dress_with_alpha_buffer(Nstates,Ndet,Nint,delta_ij_loc, i_gen, minili do i_state=1,N_states hdress = c_alpha(i_state) * i_h_alpha sdress = c_alpha(i_state) * i_s_alpha + !$OMP ATOMIC delta_ij_loc(i_state,j,1) = delta_ij_loc(i_state,j,1) + hdress + !$OMP ATOMIC delta_ij_loc(i_state,j,2) = delta_ij_loc(i_state,j,2) + sdress enddo enddo @@ -62,4 +64,3 @@ subroutine dress_with_alpha_buffer(Nstates,Ndet,Nint,delta_ij_loc, i_gen, minili end subroutine - diff --git a/plugins/Bk/extra_functions.irp.f b/plugins/Bk/extra_functions.irp.f new file mode 100644 index 00000000..f6d196be --- /dev/null +++ b/plugins/Bk/extra_functions.irp.f @@ -0,0 +1,58 @@ + BEGIN_PROVIDER [ integer, N_dress_int_buffer ] +&BEGIN_PROVIDER [ integer, N_dress_double_buffer ] +&BEGIN_PROVIDER [ integer, N_dress_det_buffer ] + implicit none + N_dress_int_buffer = 1 + N_dress_double_buffer = 1 + N_dress_det_buffer = 1 +END_PROVIDER + + + +subroutine delta_ij_done() + BEGIN_DOC + ! This subroutine is executed on the master when the dressing has been computed, + ! before the diagonalization. + END_DOC +end + +subroutine dress_pulled(ind, int_buf, double_buf, det_buf, N_buf) + use bitmasks + implicit none + BEGIN_DOC + ! Dress the contributions pulled from the slave. + END_DOC + + integer, intent(in) :: ind, N_buf(3) + integer, intent(in) :: int_buf(*) + double precision, intent(in) :: double_buf(*) + integer(bit_kind), intent(in) :: det_buf(N_int,2,*) +end + +subroutine generator_start(i_gen, iproc) + implicit none + BEGIN_DOC + ! This subroutine is executed on the slave before computing the contribution of a generator. + END_DOC + + integer, intent(in) :: i_gen, iproc + integer :: i +end + +subroutine generator_done(i_gen, int_buf, double_buf, det_buf, N_buf, iproc) + implicit none + BEGIN_DOC + ! This subroutine is executed on the slave after computing the contribution of a generator. + END_DOC + integer, intent(in) :: i_gen, iproc + integer, intent(out) :: int_buf(N_dress_int_buffer), N_buf(3) + double precision, intent(out) :: double_buf(N_dress_double_buffer) + integer(bit_kind), intent(out) :: det_buf(N_int, 2, N_dress_det_buffer) + N_buf(:) = 1 + int_buf(:) = 0 + double_buf(:) = 0.d0 + det_buf(:,:,:) = 0 +end + + + diff --git a/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f b/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f index 44f9afbc..0cef5d6f 100644 --- a/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f +++ b/plugins/CAS_SD_ZMQ/cassd_zmq.irp.f @@ -5,16 +5,28 @@ program cassd_zmq integer :: degree integer :: n_det_before, to_select double precision :: threshold_davidson_in + double precision :: error(N_states) allocate (pt2(N_states)) double precision :: hf_energy_ref logical :: has + integer :: N_states_p + character*(512) :: fmt + character*(8) :: pt2_string + pt2 = -huge(1.d0) + error = 0.d0 threshold_davidson_in = threshold_davidson threshold_davidson = threshold_davidson_in * 100.d0 SOFT_TOUCH threshold_davidson + if (do_pt2) then + pt2_string = ' ' + else + pt2_string = '(approx)' + endif + call diagonalize_CI call save_wavefunction @@ -45,7 +57,6 @@ program cassd_zmq double precision :: E_CI_before(N_states) - print*,'Beginning the selection ...' if (.True.) then ! Avoid pre-calculation of CI_energy E_CI_before(1:N_states) = CI_energy(1:N_states) endif @@ -60,6 +71,8 @@ program cassd_zmq (maxval(abs(pt2(1:N_states))) > pt2_max) .and. & (correlation_energy_ratio <= correlation_energy_ratio_max) & ) + write(*,'(A)') '--------------------------------------------------------------------------------' + correlation_energy_ratio = (CI_energy(1) - hf_energy_ref) / & (E_CI_before(1) + pt2(1) - hf_energy_ref) @@ -98,6 +111,67 @@ program cassd_zmq to_select = min(to_select, N_det_max-n_det_before) call ZMQ_selection(to_select, pt2) + N_states_p = min(N_det,N_states) + + print *, '' + print '(A,I12)', 'Summary at N_det = ', N_det + print '(A)', '-----------------------------------' + print *, '' + call write_double(6,correlation_energy_ratio, 'Correlation ratio') + print *, '' + + write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' + write(*,fmt) + write(fmt,*) '(12X,', N_states_p, '(6X,A7,1X,I6,10X))' + write(*,fmt) ('State',k, k=1,N_states_p) + write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' + write(*,fmt) + write(fmt,*) '(A12,', N_states_p, '(1X,F14.8,15X))' + write(*,fmt) '# E ', E_CI_before(1:N_states_p) + if (N_states_p > 1) then + write(*,fmt) '# Excit. (au)', E_CI_before(1:N_states_p)-E_CI_before(1) + write(*,fmt) '# Excit. (eV)', (E_CI_before(1:N_states_p)-E_CI_before(1))*27.211396641308d0 + endif + write(fmt,*) '(A12,', 2*N_states_p, '(1X,F14.8))' + write(*,fmt) '# PT2'//pt2_string, (pt2(k), error(k), k=1,N_states_p) + write(*,'(A)') '#' + write(*,fmt) '# E+PT2 ', (E_CI_before(k)+pt2(k),error(k), k=1,N_states_p) + if (N_states_p > 1) then + write(*,fmt) '# Excit. (au)', ( (E_CI_before(k)+pt2(k)-E_CI_before(1)-pt2(1)), & + dsqrt(error(k)*error(k)+error(1)*error(1)), k=1,N_states_p) + write(*,fmt) '# Excit. (eV)', ( (E_CI_before(k)+pt2(k)-E_CI_before(1)-pt2(1))*27.211396641308d0, & + dsqrt(error(k)*error(k)+error(1)*error(1))*27.211396641308d0, k=1,N_states_p) + endif + write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' + write(*,fmt) + print *, '' + + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print*, 'correlation_ratio = ', correlation_energy_ratio + + do k=1, N_states_p + print*,'State ',k + print *, 'PT2 = ', pt2(k) + print *, 'E = ', E_CI_before(k) + print *, 'E+PT2'//pt2_string//' = ', E_CI_before(k)+pt2(k), ' +/- ', error(k) + enddo + + print *, '-----' + if(N_states.gt.1)then + print *, 'Variational Energy difference (au | eV)' + do i=2, N_states_p + print*,'Delta E = ', (E_CI_before(i) - E_CI_before(1)), & + (E_CI_before(i) - E_CI_before(1)) * 27.211396641308d0 + enddo + print *, '-----' + print*, 'Variational + perturbative Energy difference (au | eV)' + do i=2, N_states_p + print*,'Delta E = ', (E_CI_before(i)+ pt2(i) - (E_CI_before(1) + pt2(1))), & + (E_CI_before(i)+ pt2(i) - (E_CI_before(1) + pt2(1))) * 27.211396641308d0 + enddo + endif + PROVIDE psi_coef PROVIDE psi_det PROVIDE psi_det_sorted diff --git a/plugins/CISD/H_apply.irp.f b/plugins/CISD/H_apply.irp.f index a66c997d..8e565c8f 100644 --- a/plugins/CISD/H_apply.irp.f +++ b/plugins/CISD/H_apply.irp.f @@ -3,7 +3,9 @@ BEGIN_SHELL [ /usr/bin/env python2 ] from generate_h_apply import H_apply -H = H_apply("cisd") +H = H_apply("cisd",do_double_exc=True) +print H +H = H_apply("cis",do_double_exc=False) print H END_SHELL diff --git a/plugins/CISD/cisd.irp.f b/plugins/CISD/cisd.irp.f index 0d5a8f75..53f111ee 100644 --- a/plugins/CISD/cisd.irp.f +++ b/plugins/CISD/cisd.irp.f @@ -1,20 +1,22 @@ -program cisd +program cis + implicit none + read_wf = .False. + SOFT_TOUCH read_wf + call run +end + +subroutine run implicit none integer :: i - print *, 'HF = ', HF_energy - print *, 'N_states = ', N_states - N_det = 1 - touch psi_det psi_coef N_det call H_apply_cisd print *, 'N_det = ', N_det do i = 1,N_states print *, 'energy = ',CI_energy(i) print *, 'E_corr = ',CI_electronic_energy(i) - ref_bitmask_energy enddo - - call ezfio_set_cisd_energy(CI_energy(1)) psi_coef = ci_eigenvectors SOFT_TOUCH psi_coef - call save_wavefunction + call save_wavefunction_truncated(1.d-12) + end diff --git a/plugins/DavidsonDressed/diagonalize_CI.irp.f b/plugins/DavidsonDressed/diagonalize_CI.irp.f index 2ee540e2..ddea2950 100644 --- a/plugins/DavidsonDressed/diagonalize_CI.irp.f +++ b/plugins/DavidsonDressed/diagonalize_CI.irp.f @@ -63,8 +63,8 @@ END_PROVIDER call davidson_diag_HS2(psi_det,CI_eigenvectors_dressed, CI_eigenvectors_s2_dressed,& size(CI_eigenvectors_dressed,1), CI_electronic_energy_dressed,& N_det,min(N_det,N_states),min(N_det,N_states_diag),N_int,1) - call u_0_S2_u_0(CI_eigenvectors_s2_dressed,CI_eigenvectors_dressed,N_det,psi_det,N_int,& - N_states_diag,size(CI_eigenvectors_dressed,1)) +! call u_0_S2_u_0(CI_eigenvectors_s2_dressed,CI_eigenvectors_dressed,N_det,psi_det,N_int,& +! N_states_diag,size(CI_eigenvectors_dressed,1)) else if (diag_algorithm == "Lapack") then diff --git a/plugins/Full_CI_ZMQ/fci_zmq.irp.f b/plugins/Full_CI_ZMQ/fci_zmq.irp.f index 7cb54841..933056d4 100644 --- a/plugins/Full_CI_ZMQ/fci_zmq.irp.f +++ b/plugins/Full_CI_ZMQ/fci_zmq.irp.f @@ -22,8 +22,8 @@ program fci_zmq threshold_davidson = threshold_davidson_in * 100.d0 SOFT_TOUCH threshold_davidson - call diagonalize_CI - call save_wavefunction +! call diagonalize_CI +! call save_wavefunction call ezfio_has_hartree_fock_energy(has) if (has) then @@ -52,6 +52,11 @@ program fci_zmq double precision :: error(N_states) correlation_energy_ratio = 0.d0 + if (do_pt2) then + pt2_string = ' ' + else + pt2_string = '(approx)' + endif if (.True.) then ! Avoid pre-calculation of CI_energy do while ( & @@ -63,17 +68,14 @@ program fci_zmq if (do_pt2) then - pt2_string = ' ' pt2 = 0.d0 threshold_selectors = 1.d0 - threshold_generators = 1d0 + threshold_generators = 1.d0 SOFT_TOUCH threshold_selectors threshold_generators call ZMQ_pt2(CI_energy, pt2,relative_error,absolute_error,error) ! Stochastic PT2 threshold_selectors = threshold_selectors_save threshold_generators = threshold_generators_save SOFT_TOUCH threshold_selectors threshold_generators - else - pt2_string = '(approx)' endif diff --git a/plugins/Full_CI_ZMQ/pt2_slave.irp.f b/plugins/Full_CI_ZMQ/pt2_slave.irp.f deleted file mode 100644 index 718884d1..00000000 --- a/plugins/Full_CI_ZMQ/pt2_slave.irp.f +++ /dev/null @@ -1,80 +0,0 @@ -program pt2_slave - implicit none - BEGIN_DOC -! Helper program to compute the PT2 in distributed mode. - END_DOC - - read_wf = .False. - distributed_davidson = .False. - SOFT_TOUCH read_wf distributed_davidson - call provide_everything - call switch_qp_run_to_master - call run_wf -end - -subroutine provide_everything - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context -end - -subroutine run_wf - use f77_zmq - implicit none - - integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket - integer(ZMQ_PTR) :: zmq_to_qp_run_socket - double precision :: energy(N_states_diag) - character*(64) :: states(1) - integer :: rc, i - - integer, external :: zmq_get_dvector - integer, external :: zmq_get_psi - - call provide_everything - - zmq_context = f77_zmq_ctx_new () - states(1) = 'pt2' - - zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() - - do - - call wait_for_states(states,zmq_state,1) - - if(trim(zmq_state) == 'Stopped') then - - exit - - else if (trim(zmq_state) == 'pt2') then - - ! Selection - ! --------- - - print *, 'PT2' - if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle - - PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique - PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order - PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns - PROVIDE psi_bilinear_matrix_transp_order - - !$OMP PARALLEL PRIVATE(i) - i = omp_get_thread_num() - call pt2_slave_tcp(i, energy) - !$OMP END PARALLEL - print *, 'PT2 done' - - endif - - end do -end - -subroutine pt2_slave_tcp(i,energy) - implicit none - double precision, intent(in) :: energy(N_states_diag) - integer, intent(in) :: i - logical :: lstop - lstop = .False. - call run_pt2_slave(0,i,energy,lstop) -end - diff --git a/plugins/Full_CI_ZMQ/pt2_stoch.irp.f b/plugins/Full_CI_ZMQ/pt2_stoch.irp.f index 99aaab6b..83146fb0 100644 --- a/plugins/Full_CI_ZMQ/pt2_stoch.irp.f +++ b/plugins/Full_CI_ZMQ/pt2_stoch.irp.f @@ -3,6 +3,7 @@ program pt2_stoch read_wf = .True. SOFT_TOUCH read_wf PROVIDE mo_bielec_integrals_in_map + PROVIDE psi_energy call run end @@ -19,15 +20,14 @@ subroutine run double precision :: E_CI_before, relative_error, absolute_error, eqt allocate (pt2(N_states)) - call diagonalize_CI() - pt2 = 0.d0 + pt2(:) = 0.d0 - E_CI_before = pt2_E0_denominator(1) + nuclear_repulsion + E_CI_before = psi_energy(1) + nuclear_repulsion threshold_selectors = 1.d0 - threshold_generators = 1d0 - relative_error = 1.d-9 - absolute_error = 1.d-9 - + threshold_generators = 1.d0 + relative_error=PT2_relative_error + absolute_error=PT2_absolute_error + call ZMQ_pt2(E_CI_before, pt2, relative_error, absolute_error, eqt) print *, 'Final step' print *, 'N_det = ', N_det diff --git a/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f b/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f index def4133d..73850950 100644 --- a/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f +++ b/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f @@ -95,10 +95,9 @@ subroutine ZMQ_pt2(E, pt2,relative_error, absolute_error, error) state_average_weight_save(:) = state_average_weight(:) do pt2_stoch_istate=1,N_states - SOFT_TOUCH pt2_stoch_istate state_average_weight(:) = 0.d0 state_average_weight(pt2_stoch_istate) = 1.d0 - TOUCH state_average_weight + TOUCH state_average_weight pt2_stoch_istate provide nproc pt2_F mo_bielec_integrals_in_map mo_mono_elec_integral pt2_w psi_selectors @@ -112,6 +111,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error, absolute_error, error) integer, external :: zmq_put_N_det_generators integer, external :: zmq_put_N_det_selectors integer, external :: zmq_put_dvector + integer, external :: zmq_put_ivector if (zmq_put_psi(zmq_to_qp_run_socket,1) == -1) then stop 'Unable to put psi on ZMQ server' endif @@ -124,7 +124,20 @@ subroutine ZMQ_pt2(E, pt2,relative_error, absolute_error, error) if (zmq_put_dvector(zmq_to_qp_run_socket,1,'energy',pt2_e0_denominator,size(pt2_e0_denominator)) == -1) then stop 'Unable to put energy on ZMQ server' endif - + if (zmq_put_dvector(zmq_to_qp_run_socket,1,'state_average_weight',state_average_weight,N_states) == -1) then + stop 'Unable to put state_average_weight on ZMQ server' + endif + if (zmq_put_ivector(zmq_to_qp_run_socket,1,'pt2_stoch_istate',pt2_stoch_istate,1) == -1) then + stop 'Unable to put pt2_stoch_istate on ZMQ server' + endif + if (zmq_put_dvector(zmq_to_qp_run_socket,1,'threshold_selectors',threshold_selectors,1) == -1) then + stop 'Unable to put threshold_selectors on ZMQ server' + endif + if (zmq_put_dvector(zmq_to_qp_run_socket,1,'threshold_generators',threshold_generators,1) == -1) then + stop 'Unable to put threshold_generators on ZMQ server' + endif + + integer, external :: add_task_to_taskserver @@ -143,7 +156,17 @@ subroutine ZMQ_pt2(E, pt2,relative_error, absolute_error, error) endif - !$OMP PARALLEL DEFAULT(shared) NUM_THREADS(nproc+1) & + integer :: nproc_target + nproc_target = nproc + double precision :: mem + mem = 8.d0 * N_det * (N_int * 2.d0 * 3.d0 + 3.d0 + 5.d0) / (1024.d0**3) + call write_double(6,mem,'Estimated memory/thread (Gb)') + if (qp_max_mem > 0) then + nproc_target = max(1,int(dble(qp_max_mem)/mem)) + nproc_target = min(nproc_target,nproc) + endif + + !$OMP PARALLEL DEFAULT(shared) NUM_THREADS(nproc_target+1) & !$OMP PRIVATE(i) i = omp_get_thread_num() if (i==0) then @@ -255,7 +278,7 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, absolute_error, pt2 end do avg = S(t) / dble(c) eqt = (S2(t) / c) - (S(t)/c)**2 - eqt = sqrt(eqt / dble(c-1)) + eqt = sqrt(eqt / dble(c-1+1)) pt2(pt2_stoch_istate) = E0-E+avg error(pt2_stoch_istate) = eqt time = omp_get_wtime() diff --git a/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f b/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f index 6808e553..6d8b6a8c 100644 --- a/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f +++ b/plugins/Full_CI_ZMQ/run_pt2_slave.irp.f @@ -39,13 +39,14 @@ subroutine run_pt2_slave(thread,iproc,energy) zmq_socket_push = new_zmq_push_socket(thread) buf%N = 0 - n_tasks = 0 + n_tasks = 1 call create_selection_buffer(0, 0, buf) done = .False. do while (.not.done) - n_tasks = min(n_tasks+1,pt2_n_tasks_max) + n_tasks = max(1,n_tasks) + n_tasks = min(n_tasks,pt2_n_tasks_max) integer, external :: get_tasks_from_taskserver if (get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id, task_id, task, n_tasks) == -1) then @@ -59,25 +60,35 @@ subroutine run_pt2_slave(thread,iproc,energy) read (task(k),*) subset(k), i_generator(k) enddo + double precision :: time0, time1 + call wall_time(time0) do k=1,n_tasks pt2(:,k) = 0.d0 buf%cur = 0 call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k),pt2_F(i_generator(k))) enddo + call wall_time(time1) + integer, external :: tasks_done_to_taskserver if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then done = .true. endif call push_pt2_results(zmq_socket_push, i_generator, pt2, task_id, n_tasks) + + ! Try to adjust n_tasks around 1 second per job + n_tasks = min(n_tasks,int( 1.d0*dble(n_tasks) / (time1 - time0 + 1.d-9)))+1 +! n_tasks = n_tasks+1 end do integer, external :: disconnect_from_taskserver - if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) == -1) then - continue - endif + do i=1,300 + if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) /= -2) exit + call sleep(1) + print *, 'Retry disconnect...' + end do - call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) call end_zmq_push_socket(zmq_socket_push,thread) + call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) call delete_selection_buffer(buf) end subroutine diff --git a/plugins/Full_CI_ZMQ/run_selection_slave.irp.f b/plugins/Full_CI_ZMQ/run_selection_slave.irp.f index c6f0fbd3..af5e4de0 100644 --- a/plugins/Full_CI_ZMQ/run_selection_slave.irp.f +++ b/plugins/Full_CI_ZMQ/run_selection_slave.irp.f @@ -1,5 +1,122 @@ - subroutine run_selection_slave(thread,iproc,energy) + implicit none + integer, intent(in) :: thread, iproc + double precision, intent(in) :: energy(N_states_diag) + call run_selection_slave_new(thread,iproc,energy) +end + +subroutine run_selection_slave_new(thread,iproc,energy) + use f77_zmq + use selection_types + implicit none + + integer, intent(in) :: thread, iproc + double precision, intent(in) :: energy(N_states_diag) + integer :: rc, i, N + logical :: buffer_ready + + integer :: worker_id, ltask + character*(512), allocatable :: task(:) + integer, allocatable :: task_id(:) + + integer(ZMQ_PTR),external :: new_zmq_to_qp_run_socket + integer(ZMQ_PTR) :: zmq_to_qp_run_socket + + integer(ZMQ_PTR), external :: new_zmq_push_socket + integer(ZMQ_PTR) :: zmq_socket_push + + type(selection_buffer) :: buf, buf2 + logical :: done + + double precision,allocatable :: pt2(:,:) + integer :: n_tasks, k, n_tasks_max + integer, allocatable :: i_generator(:), subset(:) + + PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique + PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order + PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns + PROVIDE psi_bilinear_matrix_transp_order + + buffer_ready = .False. + n_tasks_max = N_det_generators/100+1 + allocate(task_id(n_tasks_max), task(n_tasks_max)) + allocate(pt2(N_states,n_tasks_max), i_generator(n_tasks_max), subset(n_tasks_max)) + + zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() + + integer, external :: connect_to_taskserver + if (connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) == -1) then + call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) + return + endif + + zmq_socket_push = new_zmq_push_socket(thread) + + buf%N = 0 + n_tasks = 1 + call create_selection_buffer(0, 0, buf) + done = .False. + do while (.not.done) + + n_tasks = max(1,n_tasks) + n_tasks = min(n_tasks,n_tasks_max) + + integer, external :: get_tasks_from_taskserver + if (get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id, task_id, task, n_tasks) == -1) then + exit + endif + done = task_id(n_tasks) == 0 + if (done) n_tasks = n_tasks-1 + if (n_tasks == 0) exit + + do k=1,n_tasks + read (task(k),*) subset(k), i_generator(k), N + enddo + + if(buf%N == 0) then + ! Only first time + call create_selection_buffer(N, N*2, buf) + call create_selection_buffer(N, N*2, buf2) + buffer_ready = .True. + endif + + double precision :: time0, time1 + call wall_time(time0) + do k=1,n_tasks + pt2(:,k) = 0.d0 + buf%cur = 0 + call select_connected(i_generator(k),energy,pt2(1,k),buf,subset(k)) + enddo + call wall_time(time1) + + integer, external :: tasks_done_to_taskserver + if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then + done = .true. + endif + call sort_selection_buffer(buf) + call merge_selection_buffers(buf,buf2) + call push_selection_results(zmq_socket_push, pt2, buf, task_id, n_tasks) + buf%mini = buf2%mini + pt2(:,:) = 0d0 + buf%cur = 0 + +! ! Try to adjust n_tasks around 5 second per job +! n_tasks = min(n_tasks,int( 5.d0 * dble(n_tasks) / (time1 - time0 + 1.d-9)))+1 + n_tasks = n_tasks+1 + end do + + integer, external :: disconnect_from_taskserver + if (disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) == -1) then + continue + endif + + call end_zmq_push_socket(zmq_socket_push,thread) + call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) + call delete_selection_buffer(buf) + +end + +subroutine run_selection_slave_old(thread,iproc,energy) use f77_zmq use selection_types implicit none @@ -50,8 +167,8 @@ subroutine run_selection_slave(thread,iproc,energy) if (done) then ctask = ctask - 1 else - integer :: i_generator, N - read(task,*) i_generator, N + integer :: i_generator, N, subset + read(task,*) subset, i_generator, N if(buf%N == 0) then ! Only first time call create_selection_buffer(N, N*2, buf) @@ -60,7 +177,7 @@ subroutine run_selection_slave(thread,iproc,energy) else ASSERT (N == buf%N) end if - call select_connected(i_generator,energy,pt2,buf,1,1) + call select_connected(i_generator,energy,pt2,buf,subset,fragment_count) endif integer, external :: task_done_to_taskserver diff --git a/plugins/Full_CI_ZMQ/selection.irp.f b/plugins/Full_CI_ZMQ/selection.irp.f index 79ed1746..de6bd9f5 100644 --- a/plugins/Full_CI_ZMQ/selection.irp.f +++ b/plugins/Full_CI_ZMQ/selection.irp.f @@ -137,7 +137,7 @@ subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) puti = p(j, sp) if(bannedOrb(puti)) cycle pmob = p(turn2(j), sp) - hij = mo_bielec_integral(pfix, pmob, hfix, hmob) + hij = mo_bielec_integral(pmob, pfix, hmob, hfix) hij *= get_phase_bi(phasemask, sp, sfix, hmob, pmob, hfix, pfix) vect(:, puti) += hij * coefs end do @@ -191,17 +191,26 @@ subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) p2 = p(2, sp) lbanned(p2) = .true. + + double precision :: hij_cache(mo_tot_num,2) + call get_mo_bielec_integrals(hole,p1,p2,mo_tot_num,hij_cache(1,1),mo_integrals_map) + call get_mo_bielec_integrals(hole,p2,p1,mo_tot_num,hij_cache(1,2),mo_integrals_map) + do i=1,hole-1 if(lbanned(i)) cycle - hij = (mo_bielec_integral(p1, p2, i, hole) - mo_bielec_integral(p2, p1, i, hole)) - hij *= get_phase_bi(phasemask, sp, sp, i, p1, hole, p2) - vect(1:N_states,i) += hij * coefs(1:N_states) + hij = hij_cache(i,1)-hij_cache(i,2) + if (hij /= 0.d0) then + hij *= get_phase_bi(phasemask, sp, sp, i, p1, hole, p2) + vect(1:N_states,i) += hij * coefs(1:N_states) + endif end do do i=hole+1,mo_tot_num if(lbanned(i)) cycle - hij = (mo_bielec_integral(p1, p2, hole, i) - mo_bielec_integral(p2, p1, hole, i)) - hij *= get_phase_bi(phasemask, sp, sp, hole, p1, i, p2) - vect(1:N_states,i) += hij * coefs(1:N_states) + hij = hij_cache(i,2)-hij_cache(i,1) + if (hij /= 0.d0) then + hij *= get_phase_bi(phasemask, sp, sp, hole, p1, i, p2) + vect(1:N_states,i) += hij * coefs(1:N_states) + endif end do call apply_particle(mask, sp, p2, det, ok, N_int) @@ -209,11 +218,14 @@ subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) vect(1:N_states, p2) += hij * coefs(1:N_states) else p2 = p(1, sh) + call get_mo_bielec_integrals(hole,p1,p2,mo_tot_num,hij_cache(1,1),mo_integrals_map) do i=1,mo_tot_num if(lbanned(i)) cycle - hij = mo_bielec_integral(p1, p2, i, hole) - hij *= get_phase_bi(phasemask, sp, sh, i, p1, hole, p2) - vect(1:N_states,i) += hij * coefs(1:N_states) + hij = hij_cache(i,1) + if (hij /= 0.d0) then + hij *= get_phase_bi(phasemask, sp, sh, i, p1, hole, p2) + vect(1:N_states,i) += hij * coefs(1:N_states) + endif end do end if deallocate(lbanned) @@ -594,7 +606,7 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d logical :: ok integer :: s1, s2, p1, p2, ib, j, istate integer(bit_kind) :: mask(N_int, 2), det(N_int, 2) - double precision :: e_pert, delta_E, val, Hii, min_e_pert,tmp + double precision :: e_pert, delta_E, val, Hii, sum_e_pert, tmp double precision, external :: diag_H_mat_elem_fock logical, external :: detEq @@ -621,7 +633,7 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d call apply_particles(mask, s1, p1, s2, p2, det, ok, N_int) Hii = diag_H_mat_elem_fock(psi_det_generators(1,1,i_generator),det,fock_diag_tmp,N_int) - min_e_pert = 0d0 + sum_e_pert = 0d0 do istate=1,N_states delta_E = E0(istate) - Hii @@ -632,11 +644,11 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d endif e_pert = 0.5d0 * (tmp - delta_E) pt2(istate) = pt2(istate) + e_pert - min_e_pert = min(e_pert,min_e_pert) + sum_e_pert = sum_e_pert + e_pert * state_average_weight(istate) end do - if(min_e_pert <= buf%mini) then - call add_to_selection_buffer(buf, det, min_e_pert) + if(sum_e_pert <= buf%mini) then + call add_to_selection_buffer(buf, det, sum_e_pert) end if end do end do @@ -690,8 +702,8 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, intere if (interesting(i) == i_gen) then if(sp == 3) then - do j=1,mo_tot_num - do k=1,mo_tot_num + do k=1,mo_tot_num + do j=1,mo_tot_num banned(j,k,2) = banned(k,j,1) enddo enddo @@ -707,17 +719,17 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, intere call bitstring_to_list_in_selection(mobMask(1,1), p(1,1), p(0,1), N_int) call bitstring_to_list_in_selection(mobMask(1,2), p(1,2), p(0,2), N_int) - perMask(1,1) = iand(mask(1,1), not(det(1,1,i))) - perMask(1,2) = iand(mask(1,2), not(det(1,2,i))) - do j=2,N_int - perMask(j,1) = iand(mask(j,1), not(det(j,1,i))) - perMask(j,2) = iand(mask(j,2), not(det(j,2,i))) - end do - - call bitstring_to_list_in_selection(perMask(1,1), h(1,1), h(0,1), N_int) - call bitstring_to_list_in_selection(perMask(1,2), h(1,2), h(0,2), N_int) - if (interesting(i) >= i_gen) then + perMask(1,1) = iand(mask(1,1), not(det(1,1,i))) + perMask(1,2) = iand(mask(1,2), not(det(1,2,i))) + do j=2,N_int + perMask(j,1) = iand(mask(j,1), not(det(j,1,i))) + perMask(j,2) = iand(mask(j,2), not(det(j,2,i))) + end do + + call bitstring_to_list_in_selection(perMask(1,1), h(1,1), h(0,1), N_int) + call bitstring_to_list_in_selection(perMask(1,2), h(1,2), h(0,2), N_int) + call get_mask_phase(psi_det_sorted(1,1,interesting(i)), phasemask) if(nt == 4) then call get_d2(det(1,1,i), phasemask, bannedOrb, banned, mat, mask, h, p, sp, psi_selectors_coef_transp(1, interesting(i))) @@ -731,6 +743,7 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, intere if(nt == 3) call past_d1(bannedOrb, p) end if end do + end @@ -881,9 +894,11 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) integer, parameter :: turn3(2,3) = reshape((/2,3, 1,3, 1,2/), (/2,3/)) integer :: bant - + double precision, allocatable :: hij_cache(:,:) + PROVIDE mo_integrals_map allocate (lbanned(mo_tot_num, 2)) + allocate (hij_cache(mo_tot_num,2)) lbanned = bannedOrb do i=1, p(0,1) @@ -907,16 +922,26 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) p1 = p(1,ma) p2 = p(2,ma) if(.not. bannedOrb(puti, mi)) then + call get_mo_bielec_integrals(hfix,p1,p2,mo_tot_num,hij_cache(1,1),mo_integrals_map) + call get_mo_bielec_integrals(hfix,p2,p1,mo_tot_num,hij_cache(1,2),mo_integrals_map) tmp_row = 0d0 do putj=1, hfix-1 - if(lbanned(putj, ma) .or. banned(putj, puti,bant)) cycle - hij = (mo_bielec_integral(p1, p2, putj, hfix)-mo_bielec_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) - tmp_row(1:N_states,putj) += hij * coefs(1:N_states) + if(lbanned(putj, ma)) cycle + if(banned(putj, puti,bant)) cycle + hij = hij_cache(putj,1) - hij_cache(putj,2) + if (hij /= 0.d0) then + hij = hij * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) + tmp_row(1:N_states,putj) += hij * coefs(1:N_states) + endif end do do putj=hfix+1, mo_tot_num - if(lbanned(putj, ma) .or. banned(putj, puti,bant)) cycle - hij = (mo_bielec_integral(p1, p2, hfix, putj)-mo_bielec_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) - tmp_row(1:N_states,putj) += hij * coefs(1:N_states) + if(lbanned(putj, ma)) cycle + if(banned(putj, puti,bant)) cycle + hij = hij_cache(putj,2) - hij_cache(putj,1) + if (hij /= 0.d0) then + hij = hij * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) + tmp_row(1:N_states,putj) += hij * coefs(1:N_states) + endif end do if(ma == 1) then @@ -930,19 +955,27 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) pfix = p(1,mi) tmp_row = 0d0 tmp_row2 = 0d0 + call get_mo_bielec_integrals(hfix,pfix,p1,mo_tot_num,hij_cache(1,1),mo_integrals_map) + call get_mo_bielec_integrals(hfix,pfix,p2,mo_tot_num,hij_cache(1,2),mo_integrals_map) do puti=1,mo_tot_num if(lbanned(puti,mi)) cycle !p1 fixed putj = p1 if(.not. banned(putj,puti,bant)) then - hij = mo_bielec_integral(p2,pfix,hfix,puti) * get_phase_bi(phasemask, ma, mi, hfix, p2, puti, pfix) - tmp_row(:,puti) += hij * coefs(:) + hij = hij_cache(puti,2) + if (hij /= 0.d0) then + hij = hij * get_phase_bi(phasemask, ma, mi, hfix, p2, puti, pfix) + tmp_row(:,puti) += hij * coefs(:) + endif end if putj = p2 if(.not. banned(putj,puti,bant)) then - hij = mo_bielec_integral(p1,pfix,hfix,puti) * get_phase_bi(phasemask, ma, mi, hfix, p1, puti, pfix) - tmp_row2(:,puti) += hij * coefs(:) + hij = hij_cache(puti,1) + if (hij /= 0.d0) then + hij = hij * get_phase_bi(phasemask, ma, mi, hfix, p1, puti, pfix) + tmp_row2(:,puti) += hij * coefs(:) + endif end if end do @@ -953,23 +986,35 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) mat(:,p1,:) += tmp_row(:,:) mat(:,p2,:) += tmp_row2(:,:) end if - else + + else ! sp /= 3 + if(p(0,ma) == 3) then do i=1,3 hfix = h(1,ma) puti = p(i, ma) p1 = p(turn3(1,i), ma) p2 = p(turn3(2,i), ma) + call get_mo_bielec_integrals(hfix,p1,p2,mo_tot_num,hij_cache(1,1),mo_integrals_map) + call get_mo_bielec_integrals(hfix,p2,p1,mo_tot_num,hij_cache(1,2),mo_integrals_map) tmp_row = 0d0 do putj=1,hfix-1 - if(lbanned(putj,ma) .or. banned(puti,putj,1)) cycle - hij = (mo_bielec_integral(p1, p2, putj, hfix)-mo_bielec_integral(p2,p1,putj,hfix)) * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) - tmp_row(:,putj) += hij * coefs(:) + if(lbanned(putj,ma)) cycle + if(banned(putj,puti,1)) cycle + hij = hij_cache(putj,1) - hij_cache(putj,2) + if (hij /= 0.d0) then + hij = hij * get_phase_bi(phasemask, ma, ma, putj, p1, hfix, p2) + tmp_row(:,putj) += hij * coefs(:) + endif end do do putj=hfix+1,mo_tot_num - if(lbanned(putj,ma) .or. banned(puti,putj,1)) cycle - hij = (mo_bielec_integral(p1, p2, hfix, putj)-mo_bielec_integral(p2,p1,hfix,putj)) * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) - tmp_row(:,putj) += hij * coefs(:) + if(lbanned(putj,ma)) cycle + if(banned(putj,puti,1)) cycle + hij = hij_cache(putj,2) - hij_cache(putj,1) + if (hij /= 0.d0) then + hij = hij * get_phase_bi(phasemask, ma, ma, hfix, p1, putj, p2) + tmp_row(:,putj) += hij * coefs(:) + endif end do mat(:, :puti-1, puti) += tmp_row(:,:puti-1) @@ -982,18 +1027,26 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) p2 = p(2,ma) tmp_row = 0d0 tmp_row2 = 0d0 + call get_mo_bielec_integrals(hfix,p1,pfix,mo_tot_num,hij_cache(1,1),mo_integrals_map) + call get_mo_bielec_integrals(hfix,p2,pfix,mo_tot_num,hij_cache(1,2),mo_integrals_map) do puti=1,mo_tot_num if(lbanned(puti,ma)) cycle putj = p2 if(.not. banned(puti,putj,1)) then - hij = mo_bielec_integral(pfix, p1, hfix, puti) * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p1) - tmp_row(:,puti) += hij * coefs(:) + hij = hij_cache(puti,1) + if (hij /= 0.d0) then + hij = hij * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p1) + tmp_row(:,puti) += hij * coefs(:) + endif end if putj = p1 if(.not. banned(puti,putj,1)) then - hij = mo_bielec_integral(pfix, p2, hfix, puti) * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p2) - tmp_row2(:,puti) += hij * coefs(:) + hij = hij_cache(puti,2) + if (hij /= 0.d0) then + hij = hij * get_phase_bi(phasemask, mi, ma, hfix, pfix, puti, p2) + tmp_row2(:,puti) += hij * coefs(:) + endif end if end do mat(:,:p2-1,p2) += tmp_row(:,:p2-1) @@ -1002,7 +1055,7 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) mat(:,p1,p1:) += tmp_row2(:,p1:) end if end if - deallocate(lbanned) + deallocate(lbanned,hij_cache) !! MONO if(sp == 3) then @@ -1016,10 +1069,11 @@ subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) do i1=1,p(0,s1) ib = 1 if(s1 == s2) ib = i1+1 + p1 = p(i1,s1) + if(bannedOrb(p1, s1)) cycle do i2=ib,p(0,s2) - p1 = p(i1,s1) p2 = p(i2,s2) - if(bannedOrb(p1, s1) .or. bannedOrb(p2, s2) .or. banned(p1, p2, 1)) cycle + if(bannedOrb(p2, s2) .or. banned(p1, p2, 1)) cycle call apply_particles(mask, s1, p1, s2, p2, det, ok, N_int) call i_h_j(gen, det, N_int, hij) mat(:, p1, p2) += coefs(:) * hij @@ -1048,6 +1102,8 @@ subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) logical :: ok integer :: bant + double precision, allocatable :: hij_cache(:,:) + allocate (hij_cache(mo_tot_num,2)) bant = 1 @@ -1056,6 +1112,7 @@ subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) h2 = p(1,2) do p1=1, mo_tot_num if(bannedOrb(p1, 1)) cycle + call get_mo_bielec_integrals(p1,h2,h1,mo_tot_num,hij_cache(1,1),mo_integrals_map) do p2=1, mo_tot_num if(bannedOrb(p2,2)) cycle if(banned(p1, p2, bant)) cycle ! rentable? @@ -1064,7 +1121,7 @@ subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) call i_h_j(gen, det, N_int, hij) else phase = get_phase_bi(phasemask, 1, 2, h1, p1, h2, p2) - hij = mo_bielec_integral(p1, p2, h1, h2) * phase + hij = hij_cache(p2,1) * phase end if mat(:, p1, p2) += coefs(:) * hij end do @@ -1074,19 +1131,28 @@ subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) p2 = p(2,sp) do puti=1, mo_tot_num if(bannedOrb(puti, sp)) cycle + call get_mo_bielec_integrals(puti,p2,p1,mo_tot_num,hij_cache(1,1),mo_integrals_map) + call get_mo_bielec_integrals(puti,p1,p2,mo_tot_num,hij_cache(1,2),mo_integrals_map) do putj=puti+1, mo_tot_num if(bannedOrb(putj, sp)) cycle if(banned(puti, putj, bant)) cycle ! rentable? if(puti == p1 .or. putj == p2 .or. puti == p2 .or. putj == p1) then call apply_particles(mask, sp,puti,sp,putj, det, ok, N_int) call i_h_j(gen, det, N_int, hij) + if (hij /= 0.d0) then + mat(:, puti, putj) += coefs(:) * hij + endif else - hij = (mo_bielec_integral(p1, p2, puti, putj) - mo_bielec_integral(p2, p1, puti, putj))* get_phase_bi(phasemask, sp, sp, puti, p1 , putj, p2) + hij = hij_cache(putj,1) - hij_cache(putj,2) + if (hij /= 0.d0) then + hij *= get_phase_bi(phasemask, sp, sp, puti, p1 , putj, p2) + mat(:, puti, putj) += coefs(:) * hij + endif end if - mat(:, puti, putj) += coefs(:) * hij end do end do end if + deallocate(hij_cache) end diff --git a/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f b/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f index 49943ad1..88b30172 100644 --- a/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f +++ b/plugins/Full_CI_ZMQ/selection_davidson_slave.irp.f @@ -30,10 +30,12 @@ subroutine run_wf integer(ZMQ_PTR) :: zmq_to_qp_run_socket double precision :: energy(N_states) character*(64) :: states(3) + character*(64) :: old_state integer :: rc, i, ierr double precision :: t0, t1 integer, external :: zmq_get_dvector, zmq_get_N_det_generators + integer, external :: zmq_get_ivector integer, external :: zmq_get_psi, zmq_get_N_det_selectors integer, external :: zmq_get_N_states_diag @@ -43,29 +45,59 @@ subroutine run_wf states(1) = 'selection' states(2) = 'davidson' states(3) = 'pt2' + old_state = 'Waiting' zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() do - call wait_for_states(states,zmq_state,size(states)) - print *, trim(zmq_state) + if (mpi_master) then + call wait_for_states(states,zmq_state,size(states)) + if (zmq_state(1:64) == old_state(1:64)) then + call sleep(1) + cycle + else + old_state(1:64) = zmq_state(1:64) + endif + print *, trim(zmq_state) + endif + + IRP_IF MPI + call MPI_BCAST (zmq_state, 128, MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here, 'error in broadcast of zmq_state' + endif + IRP_ENDIF if(zmq_state(1:7) == 'Stopped') then - exit + endif - else if (zmq_state(1:9) == 'selection') then + + if (zmq_state(1:9) == 'selection') then ! Selection ! --------- call wall_time(t0) if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_generators',threshold_generators,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_selectors',threshold_selectors,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'state_average_weight',state_average_weight,N_states) == -1) cycle + psi_energy(1:N_states) = energy(1:N_states) + TOUCH psi_energy state_average_weight threshold_selectors threshold_generators + if (mpi_master) then + print *, 'N_det', N_det + print *, 'N_det_generators', N_det_generators + print *, 'N_det_selectors', N_det_selectors + print *, 'psi_energy', psi_energy + print *, 'pt2_stoch_istate', pt2_stoch_istate + print *, 'state_average_weight', state_average_weight + endif call wall_time(t1) call write_double(6,(t1-t0),'Broadcast time') @@ -74,37 +106,65 @@ subroutine run_wf call run_selection_slave(0,i,energy) !$OMP END PARALLEL print *, 'Selection done' + IRP_IF MPI + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here, 'error in barrier' + endif + IRP_ENDIF + print *, 'All selection done' else if (zmq_state(1:8) == 'davidson') then ! Davidson ! -------- - print *, 'Davidson' call wall_time(t0) if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle if (zmq_get_N_states_diag(zmq_to_qp_run_socket,1) == -1) cycle if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states_diag) == -1) cycle call wall_time(t1) - call write_double(6,(t1-t0),'Broadcast time') + if (mpi_master) then + call write_double(6,(t1-t0),'Broadcast time') + endif call omp_set_nested(.True.) call davidson_slave_tcp(0) call omp_set_nested(.False.) print *, 'Davidson done' + IRP_IF MPI + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here, 'error in barrier' + endif + IRP_ENDIF + print *, 'All Davidson done' else if (zmq_state(1:3) == 'pt2') then ! PT2 ! --- - print *, 'PT2' call wall_time(t0) if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_generators',threshold_generators,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_selectors',threshold_selectors,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle + if (zmq_get_ivector(zmq_to_qp_run_socket,1,'pt2_stoch_istate',pt2_stoch_istate,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'state_average_weight',state_average_weight,N_states) == -1) cycle + psi_energy(1:N_states) = energy(1:N_states) + TOUCH psi_energy state_average_weight pt2_stoch_istate threshold_selectors threshold_generators + if (mpi_master) then + print *, 'N_det', N_det + print *, 'N_det_generators', N_det_generators + print *, 'N_det_selectors', N_det_selectors + print *, 'psi_energy', psi_energy + print *, 'pt2_stoch_istate', pt2_stoch_istate + print *, 'state_average_weight', state_average_weight + endif call wall_time(t1) call write_double(6,(t1-t0),'Broadcast time') @@ -113,22 +173,24 @@ subroutine run_wf lstop = .False. !$OMP PARALLEL PRIVATE(i) i = omp_get_thread_num() - call run_pt2_slave(0,i,energy,lstop) + call run_pt2_slave(0,i,pt2_e0_denominator) !$OMP END PARALLEL print *, 'PT2 done' + FREE state_average_weight + + IRP_IF MPI + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here, 'error in barrier' + endif + IRP_ENDIF + print *, 'All PT2 done' endif - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in barrier' - endif - IRP_ENDIF - end do IRP_IF MPI - call MPI_finalize(i) + call MPI_finalize(ierr) IRP_ENDIF end diff --git a/plugins/Full_CI_ZMQ/selection_slave.irp.f b/plugins/Full_CI_ZMQ/selection_slave.irp.f index aa749151..8036985a 100644 --- a/plugins/Full_CI_ZMQ/selection_slave.irp.f +++ b/plugins/Full_CI_ZMQ/selection_slave.irp.f @@ -13,76 +13,144 @@ program selection_slave end subroutine provide_everything - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context - PROVIDE pt2_e0_denominator mo_tot_num N_int fragment_count + PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context n_states_diag + PROVIDE pt2_e0_denominator mo_tot_num N_int fragment_count ci_energy mpi_master zmq_state zmq_context + PROVIDE psi_det psi_coef end subroutine run_wf use f77_zmq - + implicit none + IRP_IF MPI + include 'mpif.h' + IRP_ENDIF integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket integer(ZMQ_PTR) :: zmq_to_qp_run_socket double precision :: energy(N_states) - character*(64) :: states(4) + character*(64) :: states(3) + character*(64) :: old_state integer :: rc, i, ierr - - integer, external :: zmq_get_dvector - integer, external :: zmq_get_psi + double precision :: t0, t1 + integer, external :: zmq_get_dvector, zmq_get_N_det_generators + integer, external :: zmq_get_ivector + integer, external :: zmq_get_psi, zmq_get_N_det_selectors + integer, external :: zmq_get_N_states_diag + call provide_everything zmq_context = f77_zmq_ctx_new () states(1) = 'selection' states(2) = 'davidson' states(3) = 'pt2' + old_state = 'Waiting' zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() do - call wait_for_states(states,zmq_state,3) + if (mpi_master) then + call wait_for_states(states,zmq_state,size(states)) + if (zmq_state(1:64) == old_state(1:64)) then + call sleep(1) + cycle + else + old_state(1:64) = zmq_state(1:64) + endif + print *, trim(zmq_state) + endif - if(trim(zmq_state) == 'Stopped') then + IRP_IF MPI + call MPI_BCAST (zmq_state, 128, MPI_CHARACTER, 0, MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here, 'error in broadcast of zmq_state' + endif + IRP_ENDIF + if(zmq_state(1:7) == 'Stopped') then exit + endif - else if (trim(zmq_state) == 'selection') then + + if (zmq_state(1:9) == 'selection') then ! Selection ! --------- - print *, 'Selection' + call wall_time(t0) if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_generators',threshold_generators,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'threshold_selectors',threshold_selectors,1) == -1) cycle if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle + if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle + if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'state_average_weight',state_average_weight,N_states) == -1) cycle + psi_energy(1:N_states) = energy(1:N_states) + TOUCH psi_energy state_average_weight threshold_selectors threshold_generators + + if (mpi_master) then + print *, 'N_det', N_det + print *, 'N_det_generators', N_det_generators + print *, 'N_det_selectors', N_det_selectors + print *, 'psi_energy', psi_energy + print *, 'pt2_stoch_istate', pt2_stoch_istate + print *, 'state_average_weight', state_average_weight + endif + call wall_time(t1) + call write_double(6,(t1-t0),'Broadcast time') !$OMP PARALLEL PRIVATE(i) i = omp_get_thread_num() call run_selection_slave(0,i,energy) !$OMP END PARALLEL print *, 'Selection done' + IRP_IF MPI + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here, 'error in barrier' + endif + IRP_ENDIF + print *, 'All selection done' + if (N_det < 100000) then + exit + endif - else if (trim(zmq_state) == 'pt2') then + else if (zmq_state(1:8) == 'davidson') then - ! PT2 - ! --- + ! Davidson + ! -------- - print *, 'PT2' + call wall_time(t0) if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle - if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle - - logical :: lstop - lstop = .False. - !$OMP PARALLEL PRIVATE(i) - i = omp_get_thread_num() - call run_pt2_slave(0,i,energy,lstop) - !$OMP END PARALLEL - print *, 'PT2 done' + if (zmq_get_N_states_diag(zmq_to_qp_run_socket,1) == -1) cycle + if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states_diag) == -1) cycle + + call wall_time(t1) + if (mpi_master) then + call write_double(6,(t1-t0),'Broadcast time') + endif + + call omp_set_nested(.True.) + call davidson_slave_tcp(0) + call omp_set_nested(.False.) + print *, 'Davidson done' + IRP_IF MPI + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here, 'error in barrier' + endif + IRP_ENDIF + print *, 'All Davidson done' + exit endif end do + IRP_IF MPI + call MPI_finalize(ierr) + IRP_ENDIF end diff --git a/plugins/Full_CI_ZMQ/zmq_selection.irp.f b/plugins/Full_CI_ZMQ/zmq_selection.irp.f index fec28ba7..b3a87e95 100644 --- a/plugins/Full_CI_ZMQ/zmq_selection.irp.f +++ b/plugins/Full_CI_ZMQ/zmq_selection.irp.f @@ -10,7 +10,6 @@ subroutine ZMQ_selection(N_in, pt2) integer :: i, N integer, external :: omp_get_thread_num double precision, intent(out) :: pt2(N_states) - integer, parameter :: maxtasks=10000 PROVIDE fragment_count @@ -21,7 +20,7 @@ subroutine ZMQ_selection(N_in, pt2) PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns - PROVIDE psi_bilinear_matrix_transp_order + PROVIDE psi_bilinear_matrix_transp_order fragment_count call new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,'selection') @@ -42,30 +41,54 @@ subroutine ZMQ_selection(N_in, pt2) if (zmq_put_dvector(zmq_to_qp_run_socket,1,'energy',pt2_e0_denominator,size(pt2_e0_denominator)) == -1) then stop 'Unable to put energy on ZMQ server' endif + if (zmq_put_dvector(zmq_to_qp_run_socket,1,'threshold_selectors',threshold_selectors,1) == -1) then + stop 'Unable to put threshold_selectors on ZMQ server' + endif + if (zmq_put_dvector(zmq_to_qp_run_socket,1,'state_average_weight',state_average_weight,N_states) == -1) then + stop 'Unable to put state_average_weight on ZMQ server' + endif + if (zmq_put_dvector(zmq_to_qp_run_socket,1,'threshold_generators',threshold_generators,1) == -1) then + stop 'Unable to put threshold_generators on ZMQ server' + endif call create_selection_buffer(N, N*2, b) endif integer, external :: add_task_to_taskserver - character*(20*maxtasks) :: task + character(len=64000) :: task + integer :: j,k,ipos + ipos=1 task = ' ' - integer :: k - k=0 do i= 1, N_det_generators - k = k+1 - write(task(20*(k-1)+1:20*k),'(I9,1X,I9,''|'')') i, N - if (k>=maxtasks) then - k=0 - if (add_task_to_taskserver(zmq_to_qp_run_socket,task) == -1) then - stop 'Unable to add task to task server' - endif - endif - end do - if (k > 0) then - if (add_task_to_taskserver(zmq_to_qp_run_socket,task) == -1) then +! /!\ Fragments don't work +! if (i>-ishft(N_det_generators,-2)) then + write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') 0, i, N + ipos += 30 + if (ipos > 63970) then + if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then + stop 'Unable to add task to task server' + endif + ipos=1 + endif +! else +! do j=1,fragment_count +! write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') j, i, N +! ipos += 30 +! if (ipos > 63970) then +! if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then +! stop 'Unable to add task to task server' +! endif +! ipos=1 +! endif +! end do +! endif + enddo + if (ipos > 1) then + if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then stop 'Unable to add task to task server' endif endif + ASSERT (associated(b%det)) ASSERT (associated(b%val)) @@ -75,7 +98,17 @@ subroutine ZMQ_selection(N_in, pt2) print *, irp_here, ': Failed in zmq_set_running' endif - !$OMP PARALLEL DEFAULT(shared) SHARED(b, pt2) PRIVATE(i) NUM_THREADS(nproc+1) + integer :: nproc_target + nproc_target = nproc + double precision :: mem + mem = 8.d0 * N_det * (N_int * 2.d0 * 3.d0 + 3.d0 + 5.d0) / (1024.d0**3) + call write_double(6,mem,'Estimated memory/thread (Gb)') + if (qp_max_mem > 0) then + nproc_target = max(1,int(dble(qp_max_mem)/mem)) + nproc_target = min(nproc_target,nproc) + endif + + !$OMP PARALLEL DEFAULT(shared) SHARED(b, pt2) PRIVATE(i) NUM_THREADS(nproc_target+1) i = omp_get_thread_num() if (i==0) then call selection_collector(zmq_socket_pull, b, N, pt2) @@ -130,6 +163,9 @@ subroutine selection_collector(zmq_socket_pull, b, N, pt2) integer(bit_kind), pointer :: det(:,:,:) integer, allocatable :: task_id(:) type(selection_buffer) :: b2 + + + zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() call create_selection_buffer(N, N*2, b2) diff --git a/plugins/Full_CI_ZMQ_GPI2/NEEDED_CHILDREN_MODULES b/plugins/Full_CI_ZMQ_GPI2/NEEDED_CHILDREN_MODULES deleted file mode 100644 index dd79ddf2..00000000 --- a/plugins/Full_CI_ZMQ_GPI2/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -Full_CI_ZMQ GPI2 diff --git a/plugins/Full_CI_ZMQ_GPI2/README.rst b/plugins/Full_CI_ZMQ_GPI2/README.rst deleted file mode 100644 index b3e89d9e..00000000 --- a/plugins/Full_CI_ZMQ_GPI2/README.rst +++ /dev/null @@ -1,15 +0,0 @@ -================ -Full_CI_ZMQ_GPI2 -================ - -GPI2 Slave for Full_CI with ZMQ. There should be one instance of the slave -per compute node. - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. diff --git a/plugins/Full_CI_ZMQ_GPI2/selection_davidson_slave_gpi2.irp.f b/plugins/Full_CI_ZMQ_GPI2/selection_davidson_slave_gpi2.irp.f deleted file mode 100644 index 52822e41..00000000 --- a/plugins/Full_CI_ZMQ_GPI2/selection_davidson_slave_gpi2.irp.f +++ /dev/null @@ -1,105 +0,0 @@ -program selection_slave - implicit none - BEGIN_DOC -! Helper program to compute the PT2 in distributed mode. - END_DOC - - read_wf = .False. - distributed_davidson = .False. - SOFT_TOUCH read_wf distributed_davidson - call provide_everything - call switch_qp_run_to_master - call run_wf -end - -subroutine provide_everything - PROVIDE H_apply_buffer_allocated mo_bielec_integrals_in_map psi_det_generators psi_coef_generators psi_det_sorted_bit psi_selectors n_det_generators n_states generators_bitmask zmq_context - PROVIDE pt2_e0_denominator mo_tot_num N_int fragment_count GASPI_is_Initialized -end - -subroutine run_wf - use f77_zmq - - implicit none - - integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket - integer(ZMQ_PTR) :: zmq_to_qp_run_socket - double precision :: energy(N_states) - character*(64) :: states(4) - integer :: rc, i, ierr - - call provide_everything - - zmq_context = f77_zmq_ctx_new () - states(1) = 'selection' - states(2) = 'davidson' - states(3) = 'pt2' - - zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() - - do - - call wait_for_states(states,zmq_state,3) - - if(trim(zmq_state) == 'Stopped') then - - exit - - else if (trim(zmq_state) == 'selection') then - - ! Selection - ! --------- - - print *, 'Selection' - if (is_gaspi_master) then - call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) - endif - call broadcast_wf(energy) - - !$OMP PARALLEL PRIVATE(i) - i = omp_get_thread_num() - call run_selection_slave(0,i,energy) - !$OMP END PARALLEL - print *, 'Selection done' - - else if (trim(zmq_state) == 'davidson') then - - ! Davidson - ! -------- - - print *, 'Davidson' - if (is_gaspi_master) then - call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) - endif - call broadcast_wf(energy) - call omp_set_nested(.True.) - call davidson_slave_tcp(0) - call omp_set_nested(.False.) - print *, 'Davidson done' - - else if (trim(zmq_state) == 'pt2') then - - ! PT2 - ! --- - - print *, 'PT2' - if (is_gaspi_master) then - call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) - endif - call broadcast_wf(energy) - - logical :: lstop - lstop = .False. - !$OMP PARALLEL PRIVATE(i) - i = omp_get_thread_num() - call run_pt2_slave(0,i,energy,lstop) - !$OMP END PARALLEL - print *, 'PT2 done' - - endif - - end do -end - - - diff --git a/plugins/GPI2/broadcast.irp.f b/plugins/GPI2/broadcast.irp.f deleted file mode 100644 index e9f421d8..00000000 --- a/plugins/GPI2/broadcast.irp.f +++ /dev/null @@ -1,254 +0,0 @@ -subroutine broadcast_wf(energy) - implicit none - BEGIN_DOC - ! Segment corresponding to the wave function. This is segment 0. - END_DOC - use bitmasks - use GASPI - use ISO_C_BINDING - - double precision, intent(inout) :: energy(N_states) - integer(gaspi_return_t) :: res - - if (is_gaspi_master) then - call broadcast_wf_put(energy) - else - call broadcast_wf_get(energy) - endif - - res = gaspi_barrier(GASPI_GROUP_ALL, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_barrier failed" - stop -1 - end if - - - integer(gaspi_segment_id_t) :: seg_id - do seg_id=0,3 - res = gaspi_segment_delete(seg_id) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_segment_delete failed", seg_id - stop -1 - end if - end do - -end - - - - - -subroutine broadcast_wf_put(energy) - implicit none - BEGIN_DOC - ! Initiates the broadcast of the wave function - END_DOC - use bitmasks - use GASPI - use ISO_C_BINDING - - double precision, intent(in) :: energy(N_states) - integer(gaspi_segment_id_t) :: seg_id - integer(gaspi_alloc_t) :: seg_alloc_policy - integer(gaspi_size_t) :: seg_size(0:3) - type(c_ptr) :: seg_ptr(0:3) - integer, pointer :: params_int(:) ! Segment 0 - double precision, pointer :: psi_coef_tmp(:,:) ! Segment 1 - integer(bit_kind), pointer :: psi_det_tmp(:,:,:) ! Segment 2 - double precision, pointer :: params_double(:) ! Segment 3 - - integer(gaspi_return_t) :: res - - - seg_alloc_policy = GASPI_MEM_UNINITIALIZED - - seg_size(0) = 4 * 5 - seg_id=0 - res = gaspi_segment_create(seg_id, seg_size(seg_id), GASPI_GROUP_ALL, & - GASPI_BLOCK, seg_alloc_policy) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_create_segment failed", gaspi_rank, seg_id - stop -1 - end if - - res = gaspi_segment_ptr(seg_id, seg_ptr(seg_id)) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_segment_ptr failed", gaspi_rank - stop -1 - end if - - call c_f_pointer(seg_ptr(0), params_int, shape=(/ 5 /)) - params_int(1) = N_states - params_int(2) = N_det - params_int(3) = psi_det_size - - res = gaspi_barrier(GASPI_GROUP_ALL, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_barrier failed", gaspi_rank - stop -1 - end if - - seg_size(1) = 8 * psi_det_size * N_states - seg_size(2) = bit_kind * psi_det_size * 2 * N_int - seg_size(3) = 8 * N_states - - do seg_id=1, 3 - res = gaspi_segment_create(seg_id, seg_size(seg_id), GASPI_GROUP_ALL, & - GASPI_BLOCK, seg_alloc_policy) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_create_segment failed", gaspi_rank, seg_id - stop -1 - end if - - res = gaspi_segment_ptr(seg_id, seg_ptr(seg_id)) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_segment_ptr failed", gaspi_rank - stop -1 - end if - end do - - call c_f_pointer(seg_ptr(1), psi_coef_tmp, shape=shape(psi_coef)) - call c_f_pointer(seg_ptr(2), psi_det_tmp, shape=shape(psi_det)) - call c_f_pointer(seg_ptr(3), params_double, shape=(/ N_states /)) - - psi_coef_tmp = psi_coef - psi_det_tmp = psi_det - params_double = energy - - res = gaspi_barrier(GASPI_GROUP_ALL, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_barrier failed", gaspi_rank - stop -1 - end if - -end - - - - - - - -subroutine broadcast_wf_get(energy) - implicit none - BEGIN_DOC - ! Gets the broadcasted wave function - END_DOC - use bitmasks - use GASPI - use ISO_C_BINDING - - double precision, intent(out) :: energy(N_states) - integer(gaspi_segment_id_t) :: seg_id - integer(gaspi_alloc_t) :: seg_alloc_policy - integer(gaspi_size_t) :: seg_size(0:3) - type(c_ptr) :: seg_ptr(0:3) - integer, pointer :: params_int(:) ! Segment 0 - double precision, pointer :: psi_coef_tmp(:,:) ! Segment 1 - integer(bit_kind), pointer :: psi_det_tmp(:,:,:) ! Segment 2 - double precision, pointer :: params_double(:) ! Segment 3 - - integer(gaspi_return_t) :: res - - - seg_alloc_policy = GASPI_MEM_UNINITIALIZED - - seg_size(0) = 4 * 5 - seg_id=0 - res = gaspi_segment_create(seg_id, seg_size(seg_id), GASPI_GROUP_ALL,& - GASPI_BLOCK, seg_alloc_policy) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_create_segment failed" - stop -1 - end if - - res = gaspi_segment_ptr(seg_id, seg_ptr(seg_id)) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_segment_ptr failed" - stop -1 - end if - - res = gaspi_barrier(GASPI_GROUP_ALL, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_barrier failed" - stop -1 - end if - - integer(gaspi_offset_t) :: localOff, remoteOff - integer(gaspi_rank_t) :: remoteRank - integer(gaspi_queue_id_t) :: queue - localOff = 0 - remoteRank = 0 - queue = 0 - res = gaspi_read(seg_id, localOff, remoteRank, & - seg_id, remoteOff, seg_size(seg_id), queue, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_read failed" - stop -1 - end if - - res = gaspi_wait(queue, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_wait failed" - stop -1 - end if - - call c_f_pointer(seg_ptr(0), params_int, shape=shape( (/ 5 /) )) - - N_states = params_int(1) - N_det = params_int(2) - psi_det_size = params_int(3) - TOUCH N_states N_det psi_det_size - - seg_size(1) = 8 * psi_det_size * N_states - seg_size(2) = bit_kind * psi_det_size * 2 * N_int - seg_size(3) = 8 * N_states - - do seg_id=1, 3 - res = gaspi_segment_create(seg_id, seg_size(seg_id), GASPI_GROUP_ALL, & - GASPI_BLOCK, seg_alloc_policy) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_create_segment failed" - stop -1 - end if - - res = gaspi_segment_ptr(seg_id, seg_ptr(seg_id)) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_segment_ptr failed" - stop -1 - end if - end do - - res = gaspi_barrier(GASPI_GROUP_ALL, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_barrier failed" - stop -1 - end if - - do seg_id=1, 3 - res = gaspi_read(seg_id, localOff, remoteRank, & - seg_id, remoteOff, seg_size(seg_id), queue, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_read failed" - stop -1 - end if - res = gaspi_wait(queue, GASPI_BLOCK) - if(res .ne. GASPI_SUCCESS) then - write(*,*) "gaspi_wait failed" - stop -1 - end if - end do - - call c_f_pointer(seg_ptr(1), psi_coef_tmp, shape=shape(psi_coef)) - call c_f_pointer(seg_ptr(2), psi_det_tmp, shape=shape(psi_det)) - call c_f_pointer(seg_ptr(3), params_double, shape=shape(energy)) - - psi_coef = psi_coef_tmp - psi_det = psi_det_tmp - energy = params_double - -end - - - - diff --git a/plugins/Generators_CAS/generators.irp.f b/plugins/Generators_CAS/generators.irp.f index 4be8c061..4d99f3a1 100644 --- a/plugins/Generators_CAS/generators.irp.f +++ b/plugins/Generators_CAS/generators.irp.f @@ -35,10 +35,10 @@ END_PROVIDER integer, external :: number_of_holes,number_of_particles integer, allocatable :: nongen(:) integer :: inongen - inongen = 0 allocate(nongen(N_det)) + inongen = 0 m=0 do i=1,N_det good = ( number_of_holes(psi_det_sorted(1,1,i)) ==0).and.(number_of_particles(psi_det_sorted(1,1,i))==0 ) diff --git a/plugins/Generators_full/generators.irp.f b/plugins/Generators_full/generators.irp.f index 16dade7e..2ce6f854 100644 --- a/plugins/Generators_full/generators.irp.f +++ b/plugins/Generators_full/generators.irp.f @@ -29,7 +29,6 @@ END_PROVIDER ! For Single reference wave functions, the generator is the ! Hartree-Fock determinant END_DOC - integer :: i, k psi_det_generators(1:N_int,1:2,1:N_det) = psi_det_sorted(1:N_int,1:2,1:N_det) psi_coef_generators(1:N_det,1:N_states) = psi_coef_sorted(1:N_det,1:N_states) @@ -44,12 +43,9 @@ END_PROVIDER ! For Single reference wave functions, the generator is the ! Hartree-Fock determinant END_DOC - integer :: i, k psi_det_sorted_gen = psi_det_sorted psi_coef_sorted_gen = psi_coef_sorted - !do i=1,N_det_generators - psi_det_sorted_gen_order = psi_det_sorted_order - !end do + psi_det_sorted_gen_order = psi_det_sorted_order END_PROVIDER diff --git a/plugins/Hartree_Fock/diagonalize_fock.irp.f b/plugins/Hartree_Fock/diagonalize_fock.irp.f index b3003985..bc874514 100644 --- a/plugins/Hartree_Fock/diagonalize_fock.irp.f +++ b/plugins/Hartree_Fock/diagonalize_fock.irp.f @@ -1,4 +1,4 @@ - BEGIN_PROVIDER [ double precision, diagonal_Fock_matrix_mo, (ao_num) ] + BEGIN_PROVIDER [ double precision, diagonal_Fock_matrix_mo, (mo_tot_num) ] &BEGIN_PROVIDER [ double precision, eigenvectors_Fock_matrix_mo, (ao_num,mo_tot_num) ] implicit none BEGIN_DOC diff --git a/plugins/Hartree_Fock/localize_mos.irp.f b/plugins/Hartree_Fock/localize_mos.irp.f index 8a665c64..27c97ddb 100644 --- a/plugins/Hartree_Fock/localize_mos.irp.f +++ b/plugins/Hartree_Fock/localize_mos.irp.f @@ -21,7 +21,7 @@ program localize_mos mo_coef(1,1),size(mo_coef,1),1.d-6,rank) print *, rank - if (elec_alpha_num>elec_alpha_num) then + if (elec_alpha_num>elec_beta_num) then W = 0.d0 do k=elec_beta_num+1,elec_alpha_num do j=1,ao_num diff --git a/plugins/MRCC_Utils/mrcc_utils.irp.f b/plugins/MRCC_Utils/mrcc_utils.irp.f index ad653c8c..dc739c75 100644 --- a/plugins/MRCC_Utils/mrcc_utils.irp.f +++ b/plugins/MRCC_Utils/mrcc_utils.irp.f @@ -1,6 +1,6 @@ use bitmasks - BEGIN_PROVIDER [ integer, mrmode ] +BEGIN_PROVIDER [ integer, mrmode ] mrmode = 0 END_PROVIDER diff --git a/plugins/MRPT_Utils/mrpt_utils.irp.f b/plugins/MRPT_Utils/mrpt_utils.irp.f index e186116d..dfb8f2c8 100644 --- a/plugins/MRPT_Utils/mrpt_utils.irp.f +++ b/plugins/MRPT_Utils/mrpt_utils.irp.f @@ -16,23 +16,23 @@ integer :: i,j,m integer :: i_state double precision :: accu(N_states) - double precision, allocatable :: delta_ij_tmp(:,:,:) + double precision, allocatable :: delta_ij_local(:,:,:) delta_ij_mrpt = 0.d0 - allocate (delta_ij_tmp(N_det,N_det,N_states)) + allocate (delta_ij_local(N_det,N_det,N_states)) ! 1h - delta_ij_tmp = 0.d0 - call H_apply_mrpt_1h(delta_ij_tmp,N_det) + delta_ij_local = 0.d0 + call H_apply_mrpt_1h(delta_ij_local,N_det) accu = 0.d0 do i_state = 1, N_states do i = 1, N_det do j = 1, N_det - accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) - delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) + accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) + delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) enddo enddo second_order_pt_new_1h(i_state) = accu(i_state) @@ -40,14 +40,14 @@ print*, '1h = ',accu ! 1p - delta_ij_tmp = 0.d0 - call H_apply_mrpt_1p(delta_ij_tmp,N_det) + delta_ij_local = 0.d0 + call H_apply_mrpt_1p(delta_ij_local,N_det) accu = 0.d0 do i_state = 1, N_states do i = 1, N_det do j = 1, N_det - accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) - delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) + accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) + delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) enddo enddo second_order_pt_new_1p(i_state) = accu(i_state) @@ -55,15 +55,15 @@ print*, '1p = ',accu ! 1h1p - delta_ij_tmp = 0.d0 - call H_apply_mrpt_1h1p(delta_ij_tmp,N_det) + delta_ij_local = 0.d0 + call H_apply_mrpt_1h1p(delta_ij_local,N_det) double precision :: e_corr_from_1h1p_singles(N_states) accu = 0.d0 do i_state = 1, N_states do i = 1, N_det do j = 1, N_det - accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) - delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) + accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) + delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) enddo enddo second_order_pt_new_1h1p(i_state) = accu(i_state) @@ -72,14 +72,14 @@ ! 1h1p third order if(do_third_order_1h1p)then - delta_ij_tmp = 0.d0 - call give_1h1p_sec_order_singles_contrib(delta_ij_tmp) + delta_ij_local = 0.d0 + call give_1h1p_sec_order_singles_contrib(delta_ij_local) accu = 0.d0 do i_state = 1, N_states do i = 1, N_det do j = 1, N_det - accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) - delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) + accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) + delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) enddo enddo second_order_pt_new_1h1p(i_state) = accu(i_state) @@ -88,14 +88,14 @@ endif ! 2h - delta_ij_tmp = 0.d0 - call H_apply_mrpt_2h(delta_ij_tmp,N_det) + delta_ij_local = 0.d0 + call H_apply_mrpt_2h(delta_ij_local,N_det) accu = 0.d0 do i_state = 1, N_states do i = 1, N_det do j = 1, N_det - accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) - delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) + accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) + delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) enddo enddo second_order_pt_new_2h(i_state) = accu(i_state) @@ -103,14 +103,14 @@ print*, '2h = ',accu ! 2p - delta_ij_tmp = 0.d0 - call H_apply_mrpt_2p(delta_ij_tmp,N_det) + delta_ij_local = 0.d0 + call H_apply_mrpt_2p(delta_ij_local,N_det) accu = 0.d0 do i_state = 1, N_states do i = 1, N_det do j = 1, N_det - accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) - delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) + accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) + delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) enddo enddo second_order_pt_new_2p(i_state) = accu(i_state) @@ -118,15 +118,15 @@ print*, '2p = ',accu ! 1h2p - delta_ij_tmp = 0.d0 - call give_1h2p_contrib(delta_ij_tmp) - call H_apply_mrpt_1h2p(delta_ij_tmp,N_det) + delta_ij_local = 0.d0 + call give_1h2p_contrib(delta_ij_local) + call H_apply_mrpt_1h2p(delta_ij_local,N_det) accu = 0.d0 do i_state = 1, N_states do i = 1, N_det do j = 1, N_det - accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) - delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) + accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) + delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) enddo enddo second_order_pt_new_1h2p(i_state) = accu(i_state) @@ -134,15 +134,15 @@ print*, '1h2p = ',accu ! 2h1p - delta_ij_tmp = 0.d0 - call give_2h1p_contrib(delta_ij_tmp) - call H_apply_mrpt_2h1p(delta_ij_tmp,N_det) + delta_ij_local = 0.d0 + call give_2h1p_contrib(delta_ij_local) + call H_apply_mrpt_2h1p(delta_ij_local,N_det) accu = 0.d0 do i_state = 1, N_states do i = 1, N_det do j = 1, N_det - accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) - delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) + accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) + delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) enddo enddo second_order_pt_new_2h1p(i_state) = accu(i_state) @@ -150,14 +150,14 @@ print*, '2h1p = ',accu ! 2h2p -!delta_ij_tmp = 0.d0 -!call H_apply_mrpt_2h2p(delta_ij_tmp,N_det) +!delta_ij_local = 0.d0 +!call H_apply_mrpt_2h2p(delta_ij_local,N_det) !accu = 0.d0 !do i_state = 1, N_states !do i = 1, N_det ! do j = 1, N_det -! accu(i_state) += delta_ij_tmp(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) -! delta_ij_mrpt(j,i,i_state) += delta_ij_tmp(j,i,i_state) +! accu(i_state) += delta_ij_local(j,i,i_state) * psi_coef(i,i_state) * psi_coef(j,i_state) +! delta_ij_mrpt(j,i,i_state) += delta_ij_local(j,i,i_state) ! enddo !enddo !second_order_pt_new_2h2p(i_state) = accu(i_state) diff --git a/plugins/Psiref_Utils/psi_ref_utils.irp.f b/plugins/Psiref_Utils/psi_ref_utils.irp.f index c59bbd9f..a63b0ded 100644 --- a/plugins/Psiref_Utils/psi_ref_utils.irp.f +++ b/plugins/Psiref_Utils/psi_ref_utils.irp.f @@ -9,7 +9,7 @@ use bitmasks ! function. END_DOC call sort_dets_by_det_search_key(N_det_ref, psi_ref, psi_ref_coef, & - psi_ref_sorted_bit, psi_ref_coef_sorted_bit) + psi_ref_sorted_bit, psi_ref_coef_sorted_bit, N_states) END_PROVIDER @@ -152,7 +152,7 @@ END_PROVIDER ! function. END_DOC call sort_dets_by_det_search_key(N_det_ref, psi_non_ref, psi_non_ref_coef, & - psi_non_ref_sorted_bit, psi_non_ref_coef_sorted_bit) + psi_non_ref_sorted_bit, psi_non_ref_coef_sorted_bit, N_states) END_PROVIDER diff --git a/plugins/QMC/qp_convert_qmcpack_to_ezfio.py b/plugins/QMC/qp_convert_qmcpack_to_ezfio.py index b6237476..100b9a6e 100755 --- a/plugins/QMC/qp_convert_qmcpack_to_ezfio.py +++ b/plugins/QMC/qp_convert_qmcpack_to_ezfio.py @@ -60,7 +60,7 @@ beta = ezfio.get_electrons_elec_beta_num() print "elec_alpha_num", alpha print "elec_beta_num", beta print "elec_tot_num", alpha + beta -print "spin_multiplicity", 2 * (alpha - beta) + 1 +print "spin_multiplicity", (alpha - beta) + 1 l_label = ezfio.get_nuclei_nucl_label() l_charge = ezfio.get_nuclei_nucl_charge() @@ -133,7 +133,7 @@ d_gms_order ={ 0:["s"], 1:[ "x", "y", "z" ], 2:[ "xx", "yy", "zz", "xy", "xz", "yz" ], 3:[ "xxx", "yyy", "zzz", "xxy", "xxz", "yyx", "yyz", "zzx", "zzy", "xyz"], - 4: ["xxxx", "yyyy", "zzzz", "xxxy", "xxxz", "yyyx", "yyyz", "zzzx", "zzzy", "xxyy", "xxzz", "yyzz", "xxyz", "yyxz", "zzxy", "xxxx", "yyyy", "zzzz", "xxxy", "xxxz", "yyyx", "yyyz", "zzzx", "zzzy", "xxyy", "xxzz", "yyzz", "xxyz", "yyxz","zzxy"] } + 4:[ "xxxx", "yyyy", "zzzz", "xxxy", "xxxz", "yyyx", "yyyz", "zzzx", "zzzy", "xxyy", "xxzz", "yyzz", "xxyz", "yyxz", "zzxy"] } def compare_gamess_style(item1, item2): n1,n2 = map(len,(item1,item2)) diff --git a/plugins/QMC/truncate_wf_spin.irp.f b/plugins/QMC/truncate_wf_spin.irp.f index 68e903c1..585171d0 100644 --- a/plugins/QMC/truncate_wf_spin.irp.f +++ b/plugins/QMC/truncate_wf_spin.irp.f @@ -65,53 +65,52 @@ subroutine run enddo !$OMP END PARALLEL DO endif - if (ci_threshold > norm_sort(j)) then - cycle + if (ci_threshold <= norm_sort(j)) then + exit endif - - u_0(1:N_det,1:N_states) = psi_bilinear_matrix_values(1:N_det,1:N_states) - v_0(1:N_det,1:N_states) = 0.d0 - u_t(1:N_states,1:N_det) = 0.d0 - v_t(1:N_states,1:N_det) = 0.d0 - s_t(1:N_states,1:N_det) = 0.d0 - call dtranspose( & - u_0, & - size(u_0, 1), & - u_t, & - size(u_t, 1), & - N_det, N_states) - print *, 'Computing H|Psi> ...' - call H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_states,N_det,1,N_det,0,1) - print *, 'Done' - call dtranspose( & - v_t, & - size(v_t, 1), & - v_0, & - size(v_0, 1), & - N_states, N_det) - - double precision, external :: u_dot_u, u_dot_v - do i=1,N_states - e_0(i) = u_dot_v(u_0(1,i),v_0(1,i),N_det)/u_dot_u(u_0(1,i),N_det) - print *, 'E = ', e_0(i) + nuclear_repulsion - enddo - - m = 0 - do k=1,n_det - if (sum(psi_bilinear_matrix_values(k,1:N_states)) /= 0.d0) then - m = m+1 - endif - enddo - - do k=1,N_states - E = E_0(k) + nuclear_repulsion - enddo - print *, 'Number of determinants:', m - exit enddo + + m = 0 + do k=1,n_det + if (sum(psi_bilinear_matrix_values(k,1:N_states)) /= 0.d0) then + m = m+1 + endif + enddo + + do k=1,N_states + E = E_0(k) + nuclear_repulsion + enddo + print *, 'Number of determinants:', m call wf_of_psi_bilinear_matrix(.True.) call save_wavefunction + u_0(1:N_det,1:N_states) = psi_bilinear_matrix_values(1:N_det,1:N_states) + v_0(1:N_det,1:N_states) = 0.d0 + u_t(1:N_states,1:N_det) = 0.d0 + v_t(1:N_states,1:N_det) = 0.d0 + s_t(1:N_states,1:N_det) = 0.d0 + call dtranspose( & + u_0, & + size(u_0, 1), & + u_t, & + size(u_t, 1), & + N_det, N_states) + print *, 'Computing H|Psi> ...' + call H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_states,N_det,1,N_det,0,1) + print *, 'Done' + call dtranspose( & + v_t, & + size(v_t, 1), & + v_0, & + size(v_0, 1), & + N_states, N_det) + + double precision, external :: u_dot_u, u_dot_v + do i=1,N_states + e_0(i) = u_dot_v(u_0(1,i),v_0(1,i),N_det)/u_dot_u(u_0(1,i),N_det) + print *, 'E(',i,') = ', e_0(i) + nuclear_repulsion + enddo + deallocate (iorder, norm_sort) end diff --git a/plugins/Symmetry/find_sym.irp.f b/plugins/Symmetry/find_sym.irp.f index 817638b4..d440279e 100644 --- a/plugins/Symmetry/find_sym.irp.f +++ b/plugins/Symmetry/find_sym.irp.f @@ -6,34 +6,6 @@ BEGIN_PROVIDER [ logical, molecule_is_linear ] molecule_is_linear = (minval(inertia_tensor_eigenvalues) < 1.d-5) END_PROVIDER -BEGIN_PROVIDER [ logical, molecule_has_center_of_inversion ] - implicit none - BEGIN_DOC - ! If true, there is a center of inversion in the WF - END_DOC - molecule_has_center_of_inversion = .True. - integer :: i,j,k - double precision :: point(3) - logical :: found - double precision, external :: u_dot_u - do i=1,nucl_num - found = .False. - do j=1,nucl_num - if (nucl_charge(i) /= nucl_charge(j)) cycle - point(:) = nucl_coord_sym_transp(:,i) + nucl_coord_sym_transp(:,j) - if (u_dot_u(point,3) < 1.d-5) then - found = .True. - exit - endif - enddo - if (.not.found) then - molecule_has_center_of_inversion = .False. - exit - endif - enddo - -END_PROVIDER - BEGIN_PROVIDER [ integer, sym_rotation_axis, (3) ] implicit none diff --git a/plugins/dress_zmq/EZFIO.cfg b/plugins/dress_zmq/EZFIO.cfg deleted file mode 100644 index 52d41568..00000000 --- a/plugins/dress_zmq/EZFIO.cfg +++ /dev/null @@ -1,17 +0,0 @@ -[energy] -type: double precision -doc: Calculated energy -interface: ezfio - -[thresh_dressed_ci] -type: Threshold -doc: Threshold on the convergence of the dressed CI energy -interface: ezfio,provider,ocaml -default: 1.e-5 - -[n_it_max_dressed_ci] -type: Strictly_positive_int -doc: Maximum number of dressed CI iterations -interface: ezfio,provider,ocaml -default: 10 - diff --git a/plugins/dress_zmq/alpha_factory.irp.f b/plugins/dress_zmq/alpha_factory.irp.f index bc15d788..d59ab032 100644 --- a/plugins/dress_zmq/alpha_factory.irp.f +++ b/plugins/dress_zmq/alpha_factory.irp.f @@ -637,7 +637,7 @@ subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, indexes, ab integer(bit_kind),intent(in) :: mask(N_int, 2), det(N_int, 2, N_sel) logical, intent(inout) :: bannedOrb(mo_tot_num, 2), banned(mo_tot_num, mo_tot_num, 2) integer, intent(inout) :: indexes(0:mo_tot_num, 0:mo_tot_num) - integer, intent(inout) :: abuf(*) + integer, intent(inout) :: abuf(*) integer :: i, ii, j, k, l, h(0:2,2), p(0:4,2), nt, s integer(bit_kind) :: perMask(N_int, 2), mobMask(N_int, 2), negMask(N_int, 2) integer :: phasemask(2,N_int*bit_kind_size) diff --git a/plugins/dress_zmq/dress_general.irp.f b/plugins/dress_zmq/dress_general.irp.f index a3af5f92..8364a61f 100644 --- a/plugins/dress_zmq/dress_general.irp.f +++ b/plugins/dress_zmq/dress_general.irp.f @@ -28,36 +28,41 @@ subroutine run_dressing(N_st,energy) E_new = 0.d0 delta_E = 1.d0 iteration = 0 - do while (delta_E > thresh_dress) - N_det_delta_ij = N_det - touch N_det_delta_ij - iteration += 1 + do iteration=1,n_it_dress_max print *, '===============================================' print *, 'Iteration', iteration, '/', n_it_dress_max print *, '===============================================' print *, '' - E_old = dress_e0_denominator(1) !sum(ci_energy_dressed(1:N_states)) - !print *, "DELTA IJ", delta_ij(1,1,1) - !if(.true.) provide delta_ij_tmp - if(.true.) call delta_ij_done() + E_old = sum(psi_energy(:)) + print *, 'Variational energy ' do i=1,N_st - if(.true.) call write_double(6,ci_energy_dressed(i),"Energy") + print *, i, psi_energy(i)+nuclear_repulsion + enddo + print *, 'Dressed energy ' + do i=1,N_st + print *, i, ci_energy_dressed(i) enddo call diagonalize_ci_dressed - E_new = dress_e0_denominator(1) !sum(ci_energy_dressed(1:N_states)) + E_new = sum(psi_energy(:)) delta_E = (E_new - E_old)/dble(N_states) print *, '' call write_double(6,thresh_dress,"thresh_dress") - call write_double(6,delta_E,"delta_E") + call write_double(6,delta_E,"delta_E (undressed)") delta_E = dabs(delta_E) call save_wavefunction -! call ezfio_set_dress_zmq_energy(ci_energy_dressed(1)) - if (iteration >= n_it_dress_max) then + if (delta_E < thresh_dress) then exit endif enddo - if(.true.) call write_double(6,ci_energy_dressed(1),"Final energy") + print *, 'Variational energy ' + do i=1,N_st + print *, i, psi_energy(i)+nuclear_repulsion + enddo + print *, 'Dressed energy ' + do i=1,N_st + print *, i, ci_energy_dressed(i)+nuclear_repulsion + enddo endif if(.true.) energy(1:N_st) = 0d0 ! ci_energy_dressed(1:N_st) diff --git a/plugins/dress_zmq/dress_slave.irp.f b/plugins/dress_zmq/dress_slave.irp.f index 47053c3d..33238df2 100644 --- a/plugins/dress_zmq/dress_slave.irp.f +++ b/plugins/dress_zmq/dress_slave.irp.f @@ -28,7 +28,7 @@ subroutine run_wf double precision :: energy(N_states_diag) character*(64) :: states(1) integer :: rc, i -integer, external :: zmq_get_dvector, zmq_get_N_det_generators + integer, external :: zmq_get_dvector, zmq_get_N_det_generators integer, external :: zmq_get_psi, zmq_get_N_det_selectors integer, external :: zmq_get_N_states_diag double precision :: tmp @@ -50,19 +50,15 @@ integer, external :: zmq_get_dvector, zmq_get_N_det_generators else if (zmq_state(:5) == 'dress') then ! Dress ! --------- - !call zmq_get_psi(zmq_to_qp_run_socket,1,energy,N_states) if (zmq_get_psi(zmq_to_qp_run_socket,1) == -1) cycle - !TOUCH psi_det if (zmq_get_N_det_generators (zmq_to_qp_run_socket, 1) == -1) cycle if (zmq_get_N_det_selectors(zmq_to_qp_run_socket, 1) == -1) cycle if (zmq_get_dvector(zmq_to_qp_run_socket,1,'state_average_weight',state_average_weight,N_states) == -1) cycle if (zmq_get_dvector(zmq_to_qp_run_socket,1,'energy',energy,N_states) == -1) cycle if (zmq_get_dvector(zmq_to_qp_run_socket,1,'dress_stoch_istate',tmp,1) == -1) cycle dress_stoch_istate = int(tmp) - - - TOUCH dress_stoch_istate - TOUCH state_average_weight + psi_energy(1:N_states) = energy(1:N_states) + TOUCH psi_energy dress_stoch_istate state_average_weight PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique PROVIDE psi_bilinear_matrix_rows psi_det_sorted_gen_order psi_bilinear_matrix_order diff --git a/plugins/dress_zmq/dress_stoch_routines.irp.f b/plugins/dress_zmq/dress_stoch_routines.irp.f index 30507f39..3fc128f7 100644 --- a/plugins/dress_zmq/dress_stoch_routines.irp.f +++ b/plugins/dress_zmq/dress_stoch_routines.irp.f @@ -274,16 +274,27 @@ subroutine ZMQ_dress(E, dress, delta_out, delta_s2_out, relative_error) print *, irp_here, ': Failed in zmq_set_running' endif - !!$OMP PARALLEL DEFAULT(shared) NUM_THREADS(nproc) & - ! !$OMP PRIVATE(i) - !i = omp_get_thread_num() - !if (i==0) then + call omp_set_nested(.true.) + +if (.true.) then !! TODO + !$OMP PARALLEL DEFAULT(shared) NUM_THREADS(2) & + !$OMP PRIVATE(i) + i = omp_get_thread_num() + if (i==0) then call dress_collector(zmq_socket_pull,E, relative_error, delta, delta_s2, dress,& dress_stoch_istate) - !else - ! call dress_slave_inproc(i) - !endif - !!$OMP END PARALLEL + else + call dress_slave_inproc(i) + endif + !$OMP END PARALLEL + +else + + call dress_collector(zmq_socket_pull,E, relative_error, delta, delta_s2, dress,& + dress_stoch_istate) +endif + + call omp_set_nested(.false.) delta_out(dress_stoch_istate,1:N_det) = delta(dress_stoch_istate,1:N_det) delta_s2_out(dress_stoch_istate,1:N_det) = delta_s2(dress_stoch_istate,1:N_det) @@ -451,13 +462,18 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, end do t = dress_dot_t(m) avg = S(t) / dble(c) - eqt = (S2(t) / c) - (S(t)/c)**2 - eqt = sqrt(eqt / dble(c-1)) - error = eqt - time = omp_get_wtime() - print '(G10.3, 2X, F16.10, 2X, G16.3, 2X, F16.4, A20)', c, avg+E0+E(dress_stoch_istate), eqt, time-time0, '' + if (c > 1) then + eqt = (S2(t) / c) - (S(t)/c)**2 + eqt = sqrt(eqt / dble(c-1)) + error = eqt + time = omp_get_wtime() + print '(G10.3, 2X, F16.10, 2X, G16.3, 2X, F16.4, A20)', c, avg+E0+E(dress_stoch_istate), eqt, time-time0, '' + else + eqt = 1.d0 + error = eqt + endif m += 1 - if(eqt <= relative_error) then + if(eqt <=0d0* relative_error) then integer, external :: zmq_put_dvector i= zmq_put_dvector(zmq_to_qp_run_socket, worker_id, "ending", dble(m-1), 1) found = .true. @@ -480,6 +496,7 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, end if end do do i=1,n_tasks + if(edI(1, edI_index(i)) /= 0d0) stop "NIN M" edI(:, edI_index(i)) += edI_task(:, i) end do dot_f(m_task) -= f @@ -515,6 +532,16 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, end do dress(istate) = E(istate)+E0+avg if(ff /= 0) stop "WRONG NUMBER OF FRAGMENTS COLLECTED" + !double precision :: tmp + + !tmp = 0d0 + + !do i=1,N_det + ! if(edi(1,i) == 0d0) stop "EMPTY" + ! tmp += psi_coef(i, 1) * delta(1, i) + !end do + !print *, "SUM", E(1)+sum(edi(1,:)) + !print *, "DOT", E(1)+tmp call disconnect_from_taskserver(zmq_to_qp_run_socket,worker_id) call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) end subroutine @@ -601,6 +628,3 @@ end function END_PROVIDER - - - diff --git a/plugins/dress_zmq/dress_zmq_routines.irp.f b/plugins/dress_zmq/dress_zmq_routines.irp.f index dc47eb20..bd070214 100644 --- a/plugins/dress_zmq/dress_zmq_routines.irp.f +++ b/plugins/dress_zmq/dress_zmq_routines.irp.f @@ -6,7 +6,7 @@ subroutine dress_zmq() threshold_generators = 1d0 read_wf = .True. - SOFT_TOUCH read_wf + SOFT_TOUCH read_wf threshold_generators threshold_selectors if (.True.) then integer :: i,j diff --git a/plugins/dress_zmq/dressing.irp.f b/plugins/dress_zmq/dressing.irp.f index 88b93a23..0f4435ab 100644 --- a/plugins/dress_zmq/dressing.irp.f +++ b/plugins/dress_zmq/dressing.irp.f @@ -65,12 +65,14 @@ END_PROVIDER BEGIN_PROVIDER [ integer , N_det_delta_ij ] implicit none - !N_det_delta_ij = 0!N_det + N_det_delta_ij = N_det END_PROVIDER BEGIN_PROVIDER [ double precision, delta_ij, (N_states, N_det, 2) ] implicit none - if(.true.) delta_ij(:,:N_det_delta_ij, :) = delta_ij_tmp(:,:,:) + if(.true.) then + delta_ij(:,:N_det_delta_ij, :) = delta_ij_tmp(:,:,:) + endif delta_ij(:,N_det_delta_ij+1:,:) = 0d0 END_PROVIDER @@ -84,15 +86,6 @@ BEGIN_PROVIDER [ double precision, delta_ij_tmp, (N_states,N_det_delta_ij,2) ] double precision :: E_CI_before(N_states), relative_error integer :: cnt = 0 - ! prevents re-providing if delta_ij_tmp is - ! just being copied - !if(N_det_delta_ij /= N_det) return - - - !cnt += 1 - !if(mod(cnt,2) == 0) return - - if(.true.) then allocate(dress(N_states), del(N_states, N_det_delta_ij), del_s2(N_states, N_det_delta_ij)) delta_ij_tmp = 0d0 @@ -108,7 +101,6 @@ BEGIN_PROVIDER [ double precision, delta_ij_tmp, (N_states,N_det_delta_ij,2) ] deallocate(dress, del, del_s2) - end if END_PROVIDER diff --git a/plugins/dress_zmq/dressing_vector.irp.f b/plugins/dress_zmq/dressing_vector.irp.f index 5a528c36..a7251dd9 100644 --- a/plugins/dress_zmq/dressing_vector.irp.f +++ b/plugins/dress_zmq/dressing_vector.irp.f @@ -18,14 +18,7 @@ do j = 1, n_det dressing_column_h(j,k) = delta_ij(k,j,1) dressing_column_s(j,k) = delta_ij(k,j,2) -! print *, j, delta_ij(k,j,:) enddo -! tmp = u_dot_v(dressing_column_h(1,k), psi_coef(1,k), N_det) & -! - dressing_column_h(l,k) * psi_coef(l,k) -! dressing_column_h(l,k) -= tmp * f -! tmp = u_dot_v(dressing_column_s(1,k), psi_coef(1,k), N_det) & -! - dressing_column_s(l,k) * psi_coef(l,k) -! dressing_column_s(l,k) -= tmp * f enddo END_PROVIDER diff --git a/plugins/dress_zmq/energy.irp.f b/plugins/dress_zmq/energy.irp.f index b8948219..7e223a2e 100644 --- a/plugins/dress_zmq/energy.irp.f +++ b/plugins/dress_zmq/energy.irp.f @@ -13,13 +13,24 @@ BEGIN_PROVIDER [ double precision, dress_E0_denominator, (N_states) ] END_DOC integer :: i if (initialize_dress_E0_denominator) then - call u_0_H_u_0(dress_E0_denominator,psi_coef,N_det,psi_det,N_int,N_states,size(psi_coef,1)) - do i=N_det+1,N_states - dress_E0_denominator(i) = 0.d0 - enddo + if (h0_type == "EN") then + dress_E0_denominator(1:N_states) = psi_energy(1:N_states) + else if (h0_type == "Barycentric") then +! dress_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states) + dress_E0_denominator(1:N_states) = minval(diagonal_H_matrix_on_psi_det(1:N_det)) + else + print *, h0_type, ' not implemented' + stop + endif +! call u_0_H_u_0(dress_E0_denominator,psi_coef,N_det,psi_det,N_int,N_states,size(psi_coef,1)) +! do i=N_det+1,N_states +! dress_E0_denominator(i) = 0.d0 +! enddo call write_double(6,dress_E0_denominator(1)+nuclear_repulsion, 'dress Energy denominator') else dress_E0_denominator = -huge(1.d0) endif END_PROVIDER + + diff --git a/plugins/dress_zmq/extra_functions.irp.f.example b/plugins/dress_zmq/extra_functions.irp.f.example new file mode 100644 index 00000000..f6d196be --- /dev/null +++ b/plugins/dress_zmq/extra_functions.irp.f.example @@ -0,0 +1,58 @@ + BEGIN_PROVIDER [ integer, N_dress_int_buffer ] +&BEGIN_PROVIDER [ integer, N_dress_double_buffer ] +&BEGIN_PROVIDER [ integer, N_dress_det_buffer ] + implicit none + N_dress_int_buffer = 1 + N_dress_double_buffer = 1 + N_dress_det_buffer = 1 +END_PROVIDER + + + +subroutine delta_ij_done() + BEGIN_DOC + ! This subroutine is executed on the master when the dressing has been computed, + ! before the diagonalization. + END_DOC +end + +subroutine dress_pulled(ind, int_buf, double_buf, det_buf, N_buf) + use bitmasks + implicit none + BEGIN_DOC + ! Dress the contributions pulled from the slave. + END_DOC + + integer, intent(in) :: ind, N_buf(3) + integer, intent(in) :: int_buf(*) + double precision, intent(in) :: double_buf(*) + integer(bit_kind), intent(in) :: det_buf(N_int,2,*) +end + +subroutine generator_start(i_gen, iproc) + implicit none + BEGIN_DOC + ! This subroutine is executed on the slave before computing the contribution of a generator. + END_DOC + + integer, intent(in) :: i_gen, iproc + integer :: i +end + +subroutine generator_done(i_gen, int_buf, double_buf, det_buf, N_buf, iproc) + implicit none + BEGIN_DOC + ! This subroutine is executed on the slave after computing the contribution of a generator. + END_DOC + integer, intent(in) :: i_gen, iproc + integer, intent(out) :: int_buf(N_dress_int_buffer), N_buf(3) + double precision, intent(out) :: double_buf(N_dress_double_buffer) + integer(bit_kind), intent(out) :: det_buf(N_int, 2, N_dress_det_buffer) + N_buf(:) = 1 + int_buf(:) = 0 + double_buf(:) = 0.d0 + det_buf(:,:,:) = 0 +end + + + diff --git a/plugins/dress_zmq/run_dress_slave.irp.f b/plugins/dress_zmq/run_dress_slave.irp.f index ea1d2709..734c1f31 100644 --- a/plugins/dress_zmq/run_dress_slave.irp.f +++ b/plugins/dress_zmq/run_dress_slave.irp.f @@ -41,7 +41,7 @@ subroutine run_dress_slave(thread,iproce,energy) ! double precision, external :: omp_get_wtime double precision :: time, time0 integer :: ntask_tbd, task_tbd(Nproc), i_gen_tbd(Nproc), subset_tbd(Nproc) - if(iproce /= 0) stop "RUN DRESS SLAVE is OMP" +! if(iproce /= 0) stop "RUN DRESS SLAVE is OMP" allocate(delta_det(N_states, N_det, 0:pt2_N_teeth+1, 2)) allocate(cp(N_states, N_det, dress_N_cp, 2)) @@ -67,9 +67,8 @@ double precision :: time, time0 will_send = 0 double precision :: hij, sij, tmp - logical :: purge purge_task_id = 0 - hij = E0_denominator(1) !PROVIDE BEFORE OMP PARALLEL + provide psi_energy ending(1) = dble(dress_N_cp+1) ntask_tbd = 0 !$OMP PARALLEL DEFAULT(SHARED) & diff --git a/plugins/mrcc_sto/NEEDED_CHILDREN_MODULES b/plugins/mrcc_sto/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 8416d0f5..00000000 --- a/plugins/mrcc_sto/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -dress_zmq DavidsonDressed Psiref_CAS MRPT_Utils Perturbation MRCC_Utils diff --git a/plugins/mrcc_sto/README.rst b/plugins/mrcc_sto/README.rst deleted file mode 100644 index da126dfd..00000000 --- a/plugins/mrcc_sto/README.rst +++ /dev/null @@ -1,12 +0,0 @@ -======== -mrcc_sto -======== - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. diff --git a/plugins/mrcc_sto/mrcc_sto.irp.f b/plugins/mrcc_sto/mrcc_sto.irp.f deleted file mode 100644 index e72f1112..00000000 --- a/plugins/mrcc_sto/mrcc_sto.irp.f +++ /dev/null @@ -1,240 +0,0 @@ - -program mrcc_sto - implicit none - BEGIN_DOC -! TODO - END_DOC - call dress_zmq() - call ezfio_set_mrcc_sto_energy(ci_energy_dressed(1)) -end - - - BEGIN_PROVIDER [ double precision, hij_cache_, (N_det,Nproc) ] -&BEGIN_PROVIDER [ double precision, sij_cache_, (N_det,Nproc) ] -&BEGIN_PROVIDER [ double precision, dIa_hla_, (N_states,N_det,Nproc) ] -&BEGIN_PROVIDER [ double precision, dIa_sla_, (N_states,N_det,Nproc) ] -&BEGIN_PROVIDER [ integer, excs_ , (0:2,2,2,N_det,Nproc) ] -&BEGIN_PROVIDER [ double precision, phases_, (N_det, Nproc) ] -BEGIN_DOC - ! temporay arrays for dress_with_alpha_buffer. Avoids reallocation. -END_DOC -END_PROVIDER - - - -subroutine dress_with_alpha_buffer(delta_ij_loc, i_gen, minilist, det_minilist, n_minilist, alpha, iproc) - use bitmasks - implicit none - BEGIN_DOC - !delta_ij_loc(:,:,1) : dressing column for H - !delta_ij_loc(:,:,2) : dressing column for S2 - !minilist : indices of determinants connected to alpha ( in psi_det_sorted ) - !n_minilist : size of minilist - !alpha : alpha determinant - END_DOC - integer(bit_kind), intent(in) :: alpha(N_int,2), det_minilist(N_int, 2, n_minilist) - integer,intent(in) :: minilist(n_minilist), n_minilist, iproc, i_gen - double precision, intent(inout) :: delta_ij_loc(N_states,N_det,2) - - - integer :: i,j,k,l,m - integer :: degree1, degree2, degree - - double precision :: hIk, hla, hIl, sla, dIk(N_states), dka(N_states), dIa(N_states), hka - double precision :: phase, phase2 - integer :: exc(0:2,2,2) - integer :: h1,h2,p1,p2,s1,s2 - integer(bit_kind) :: tmp_det(N_int,2), ctrl - integer :: i_state, k_sd, l_sd, m_sd, ll_sd, i_I - double precision :: Delta_E_inv(N_states) - double precision :: sdress, hdress - logical :: ok, ok2 - integer :: canbediamond - PROVIDE mo_class - - - if(n_minilist == 1) return - - do i=1,n_minilist - if(idx_non_ref_rev(minilist(i)) == 0) return - end do - - if (perturbative_triples) then - PROVIDE one_anhil fock_virt_total fock_core_inactive_total one_creat - endif - - canbediamond = 0 - do l_sd=1,n_minilist - call get_excitation(det_minilist(1,1,l_sd),alpha,exc,degree1,phase,N_int) - call decode_exc(exc,degree1,h1,p1,h2,p2,s1,s2) - - ok = (mo_class(h1)(1:1) == 'A' .or. mo_class(h1)(1:1) == 'I') .and. & - (mo_class(p1)(1:1) == 'A' .or. mo_class(p1)(1:1) == 'V') - if(ok .and. degree1 == 2) then - ok = (mo_class(h2)(1:1) == 'A' .or. mo_class(h2)(1:1) == 'I') .and. & - (mo_class(p2)(1:1) == 'A' .or. mo_class(p2)(1:1) == 'V') - end if - - if(ok) then - canbediamond += 1 - excs_(:,:,:,l_sd,iproc) = exc(:,:,:) - phases_(l_sd, iproc) = phase - else - phases_(l_sd, iproc) = 0d0 - end if - !call i_h_j(alpha,det_minilist(1,1,l_sd),N_int,hij_cache_(l_sd,iproc)) - !call get_s2(alpha,det_minilist(1,1,l_sd),N_int,sij_cache_(l_sd,iproc)) - call i_h_j_s2(alpha,det_minilist(1,1,l_sd),N_int,hij_cache_(l_sd,iproc), sij_cache_(l_sd,iproc)) - enddo - if(canbediamond <= 1) return - - do i_I=1,N_det_ref - call get_excitation_degree(alpha,psi_ref(1,1,i_I),degree1,N_int) - if (degree1 > 4) then - cycle - endif - - do i_state=1,N_states - dIa(i_state) = 0.d0 - enddo - - do k_sd=1,n_minilist - if(phases_(k_sd,iproc) == 0d0) cycle - call get_excitation_degree(psi_ref(1,1,i_I),det_minilist(1,1,k_sd),degree,N_int) - if (degree > 2) then - cycle - endif - - !call get_excitation(det_minilist(1,1,k_sd),alpha,exc,degree2,phase,N_int) - phase = phases_(k_sd, iproc) - exc(:,:,:) = excs_(:,:,:,k_sd,iproc) - degree2 = exc(0,1,1) + exc(0,1,2) - call apply_excitation(psi_ref(1,1,i_I), exc, tmp_det, ok, N_int) - - if((.not. ok) .and. (.not. perturbative_triples)) cycle - - do i_state=1,N_states - dka(i_state) = 0.d0 - enddo - - ok2 = .false. - !do i_state=1,N_states - ! !if(dka(i_state) == 0) cycle - ! dIk(i_state) = dij(i_I, idx_non_ref_rev(minilist(k_sd)), i_state) - ! if(dIk(i_state) /= 0d0) then - ! ok2 = .true. - ! endif - !enddo - !if(.not. ok2) cycle - - if (ok) then - phase2 = 0d0 - do l_sd=k_sd+1,n_minilist - if(phases_(l_sd, iproc) == 0d0) cycle - call get_excitation_degree(tmp_det,det_minilist(1,1,l_sd),degree,N_int) - if (degree == 0) then - do i_state=1,N_states - dIk(i_state) = dij(i_I, idx_non_ref_rev(minilist(k_sd)), i_state) - if(dIk(i_state) /= 0d0) then - if(phase2 == 0d0) call get_excitation(psi_ref(1,1,i_I),det_minilist(1,1,l_sd),exc,degree,phase2,N_int) - dka(i_state) = dij(i_I, idx_non_ref_rev(minilist(l_sd)), i_state) * phase * phase2 - end if - end do - - !call get_excitation(psi_ref(1,1,i_I),det_minilist(1,1,l_sd),exc,degree,phase2,N_int) - !do i_state=1,N_states - ! if(dIk(i_state) /= 0d0) dka(i_state) = dij(i_I, idx_non_ref_rev(minilist(l_sd)), i_state) * phase * phase2 - !enddo - exit - - endif - enddo - else if (perturbative_triples) then - hka = hij_cache_(k_sd,iproc) - if (dabs(hka) > 1.d-12) then - call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),alpha,Delta_E_inv) - - do i_state=1,N_states - ASSERT (Delta_E_inv(i_state) < 0.d0) - dka(i_state) = hka / Delta_E_inv(i_state) - enddo - endif - endif - - - if (perturbative_triples.and. (degree2 == 1) ) then - call i_h_j(psi_ref(1,1,i_I),tmp_det,N_int,hka) - hka = hij_cache_(k_sd,iproc) - hka - if (dabs(hka) > 1.d-12) then - call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),alpha,Delta_E_inv) - do i_state=1,N_states - ASSERT (Delta_E_inv(i_state) < 0.d0) - dka(i_state) = hka / Delta_E_inv(i_state) - enddo - endif - endif - do i_state=1,N_states - dIa(i_state) = dIa(i_state) + dIk(i_state) * dka(i_state) - enddo - enddo - - ok2 = .false. - do i_state=1,N_states - if(dIa(i_state) /= 0d0) ok2 = .true. - enddo - if(.not. ok2) cycle - - do l_sd=1,n_minilist - k_sd = minilist(l_sd) - hla = hij_cache_(l_sd,iproc) - sla = sij_cache_(l_sd,iproc) - do i_state=1,N_states - hdress = dIa(i_state) * hla * psi_ref_coef(i_I,i_state) - sdress = dIa(i_state) * sla * psi_ref_coef(i_I,i_state) - !!!$OMP ATOMIC - delta_ij_loc(i_state,k_sd,1) += hdress - !!!$OMP ATOMIC - delta_ij_loc(i_state,k_sd,2) += sdress - enddo - enddo - enddo -end subroutine - - - - - -!! TESTS MINILIST -subroutine test_minilist(minilist, n_minilist, alpha) - use bitmasks - implicit none - integer, intent(in) :: n_minilist - integer(bit_kind),intent(in) :: alpha(N_int, 2) - integer, intent(in) :: minilist(n_minilist) - integer :: a, i, deg - integer :: refc(N_det), testc(N_det) - - refc = 0 - testc = 0 - do i=1,N_det - call get_excitation_degree(psi_det(1,1,i), alpha, deg, N_int) - if(deg <= 2) refc(i) = refc(i) + 1 - end do - do i=1,n_minilist - call get_excitation_degree(psi_det(1,1,minilist(i)), alpha, deg, N_int) - if(deg <= 2) then - testc(minilist(i)) += 1 - else - stop "NON LINKED IN MINILIST" - end if - end do - - do i=1,N_det - if(refc(i) /= testc(i)) then - print *, "MINILIST FAIL ", sum(refc), sum(testc), n_minilist - exit - end if - end do -end subroutine - - diff --git a/plugins/mrcepa0/EZFIO.cfg b/plugins/mrcepa0/EZFIO.cfg index 53519ec7..88f40c18 100644 --- a/plugins/mrcepa0/EZFIO.cfg +++ b/plugins/mrcepa0/EZFIO.cfg @@ -18,7 +18,7 @@ interface: ezfio type: logical doc: Compute perturbative contribution of the Triples interface: ezfio,provider,ocaml -default: false +default: true [energy] type: double precision @@ -35,5 +35,5 @@ default: 1.e-5 type: Strictly_positive_int doc: Maximum number of dressed CI iterations interface: ezfio,provider,ocaml -default: 10 +default: 30 diff --git a/plugins/mrcepa0/dressing.irp.f b/plugins/mrcepa0/dressing.irp.f index a376585c..d9eb2365 100644 --- a/plugins/mrcepa0/dressing.irp.f +++ b/plugins/mrcepa0/dressing.irp.f @@ -74,118 +74,6 @@ BEGIN_PROVIDER [ double precision, mrcc_norm_acc, (0:N_det_non_ref, N_states) ] END_PROVIDER -! BEGIN_PROVIDER [ double precision, delta_ij_mrcc_sto,(N_states,N_det_non_ref) ] -!&BEGIN_PROVIDER [ double precision, delta_ij_s2_mrcc_sto, (N_states,N_det_non_ref) ] -! use bitmasks -! implicit none -! integer :: gen, h, p, n, t, i, j, h1, h2, p1, p2, s1, s2, iproc -! integer(bit_kind) :: mask(N_int, 2), omask(N_int, 2) -! integer(bit_kind),allocatable :: buf(:,:,:) -! logical :: ok -! logical, external :: detEq -! integer, external :: omp_get_thread_num -! double precision :: coefs(N_det_non_ref), myCoef -! integer :: n_in_teeth -! double precision :: contrib(N_states), curn, in_teeth_step, curlim, curnorm -! -! contrib = 0d0 -! read(*,*) n_in_teeth -! !n_in_teeth = 2 -! in_teeth_step = 1d0 / dfloat(n_in_teeth) -! !double precision :: delta_ij_mrcc_tmp,(N_states,N_det_non_ref) -! !double precision :: delta_ij_s2_mrcc_tmp(N_states,N_det_non_ref) -! -! coefs = 0d0 -! coefs(:mrcc_teeth(1,1)-1) = 1d0 -! -! do i=1,N_mrcc_teeth -! print *, "TEETH SIZE", i, mrcc_teeth(i+1,1)-mrcc_teeth(i,1) -! if(mrcc_teeth(i+1,1) - mrcc_teeth(i,1) <= n_in_teeth) then -! coefs(mrcc_teeth(i,1):mrcc_teeth(i+1,1)-1) = 1d0 -! else if(.false.) then -! curnorm = 0d0 -! curn = 0.5d0 -! curlim = curn / dfloat(n_in_teeth) -! do j=mrcc_teeth(i,1), mrcc_teeth(i+1,1)-1 -! if(mrcc_norm_acc(j,1) >= curlim) then -! coefs(j) = 1d0 -! curnorm += mrcc_norm(j,1) -! do while(mrcc_norm_acc(j,1) > curlim) -! curn += 1d0 -! curlim = curn / dfloat(n_in_teeth) -! end do -! end if -! end do -! do j=mrcc_teeth(i,1), mrcc_teeth(i+1,1)-1 -! coefs(j) = coefs(j) / curnorm ! 1d0 / norm computed in teeth -! end do -! else if(.true.) then -! coefs(mrcc_teeth(i,1):mrcc_teeth(i,1)+n_in_teeth-1) = 1d0 / mrcc_norm_acc(mrcc_teeth(i,1)+n_in_teeth-1, 1) -! else -! curnorm = 0d0 -! n = mrcc_teeth(i+1,1) - mrcc_teeth(i,1) -! do j=1,n_in_teeth -! t = int((dfloat(j)-0.5d0) * dfloat(n) / dfloat(n_in_teeth)) + 1 + mrcc_teeth(i,1) - 1 -! curnorm += mrcc_norm(t,1) -! coefs(t) = 1d0 -! end do -! do j=mrcc_teeth(i,1), mrcc_teeth(i+1,1)-1 -! coefs(j) = coefs(j) / curnorm ! 1d0 / norm computed in teeth -! end do -! end if -! !coefs(mrcc_teeth(i,1)) = -! end do -! -! !coefs = coefs * dfloat(N_det_generators) -! -! -! delta_ij_mrcc_sto = 0d0 -! delta_ij_s2_mrcc_sto = 0d0 -! PROVIDE dij -! provide hh_shortcut psi_det_size! lambda_mrcc -! !$OMP PARALLEL DO default(none) schedule(dynamic) & -! !$OMP shared(psi_ref, psi_non_ref, hh_exists, pp_exists, N_int, hh_shortcut) & -! !$OMP shared(N_det_generators, coefs,N_det_non_ref, delta_ij_mrcc_sto) & -! !$OMP shared(contrib,psi_det_generators, delta_ij_s2_mrcc_sto) & -! !$OMP private(i,j,curnorm,myCoef, h, n, mask, omask, buf, ok, iproc) -! do gen= 1,N_det_generators -! if(coefs(gen) == 0d0) cycle -! myCoef = coefs(gen) -! allocate(buf(N_int, 2, N_det_non_ref)) -! iproc = omp_get_thread_num() + 1 -! if(mod(gen, 1000) == 0) print *, "mrcc_sto ", gen, "/", N_det_generators -! -! do h=1, hh_shortcut(0) -! call apply_hole_local(psi_det_generators(1,1,gen), hh_exists(1, h), mask, ok, N_int) -! if(.not. ok) cycle -! omask = 0_bit_kind -! if(hh_exists(1, h) /= 0) omask = mask -! n = 1 -! do p=hh_shortcut(h), hh_shortcut(h+1)-1 -! call apply_particle_local(mask, pp_exists(1, p), buf(1,1,n), ok, N_int) -! if(ok) n = n + 1 -! if(n > N_det_non_ref) stop "Buffer too small in MRCC..." -! end do -! n = n - 1 -! if(n /= 0) then -! call mrcc_part_dress(delta_ij_mrcc_sto, delta_ij_s2_mrcc_sto, & -! gen,n,buf,N_int,omask,myCoef,contrib) -! endif -! end do -! deallocate(buf) -! end do -! !$OMP END PARALLEL DO -! -! -! -! curnorm = 0d0 -! do j=1,N_det_non_ref -! curnorm += delta_ij_mrcc_sto(1,j)*delta_ij_mrcc_sto(1,j) -! end do -! print *, "NORM DELTA ", dsqrt(curnorm) -! -!END_PROVIDER - BEGIN_PROVIDER [ double precision, delta_ij_cancel, (N_states,N_det_non_ref) ] @@ -251,7 +139,7 @@ END_PROVIDER &BEGIN_PROVIDER [ double precision, delta_ij_s2_mrcc, (N_states,N_det_non_ref) ] use bitmasks implicit none - integer :: gen, h, p, n, t, i, h1, h2, p1, p2, s1, s2, iproc + integer :: gen, h, p, n, t, i, h1, h2, p1, p2, s1, s2 integer(bit_kind) :: mask(N_int, 2), omask(N_int, 2) integer(bit_kind),allocatable :: buf(:,:,:) logical :: ok @@ -266,13 +154,15 @@ END_PROVIDER delta_ij_s2_mrcc = 0d0 - !$OMP PARALLEL DO default(none) schedule(dynamic) & + !$OMP PARALLEL default(none) & !$OMP shared(contrib,psi_det_generators, N_det_generators, hh_exists, pp_exists, N_int, hh_shortcut) & !$OMP shared(N_det_non_ref, N_det_ref, delta_ij_mrcc, delta_ij_s2_mrcc) & - !$OMP private(h, n, mask, omask, buf, ok, iproc) + !$OMP private(h, n, mask, omask, buf, ok,gen) + + allocate(buf(N_int, 2, N_det_non_ref)) + + !$OMP DO schedule(dynamic) do gen= 1, N_det_generators - allocate(buf(N_int, 2, N_det_non_ref)) - iproc = omp_get_thread_num() + 1 if(mod(gen, 1000) == 0) print *, "mrcc ", gen, "/", N_det_generators do h=1, hh_shortcut(0) call apply_hole_local(psi_det_generators(1,1,gen), hh_exists(1, h), mask, ok, N_int) @@ -292,9 +182,12 @@ END_PROVIDER endif end do - deallocate(buf) end do - !$OMP END PARALLEL DO + !$OMP END DO + + deallocate(buf) + + !$OMP END PARALLEL END_PROVIDER @@ -323,11 +216,9 @@ subroutine mrcc_part_dress(delta_ij_, delta_ij_s2_, i_generator,n_selected,det_b double precision :: hIk, hla, hIl, sla, dIk(N_states), dka(N_states), dIa(N_states), hka double precision, allocatable :: dIa_hla(:,:), dIa_sla(:,:) double precision :: haj, phase, phase2 - double precision :: f(N_states), ci_inv(N_states) integer :: exc(0:2,2,2) integer :: h1,h2,p1,p2,s1,s2 integer(bit_kind) :: tmp_det(Nint,2) - integer :: iint, ipos integer :: i_state, k_sd, l_sd, i_I, i_alpha integer(bit_kind),allocatable :: miniList(:,:,:) @@ -345,6 +236,7 @@ subroutine mrcc_part_dress(delta_ij_, delta_ij_s2_, i_generator,n_selected,det_b double precision, intent(inout) :: contrib(N_states) double precision :: sdress, hdress + PROVIDE n_act_orb elec_num if (perturbative_triples) then PROVIDE one_anhil fock_virt_total fock_core_inactive_total one_creat @@ -502,7 +394,7 @@ subroutine mrcc_part_dress(delta_ij_, delta_ij_s2_, i_generator,n_selected,det_b hka = hij_cache(idx_alpha(k_sd)) if (dabs(hka) > 1.d-12) then call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),tq(1,1,i_alpha),Delta_E_inv) - + do i_state=1,N_states ASSERT (Delta_E_inv(i_state) < 0.d0) dka(i_state) = hka / Delta_E_inv(i_state) @@ -510,7 +402,7 @@ subroutine mrcc_part_dress(delta_ij_, delta_ij_s2_, i_generator,n_selected,det_b endif endif - + if (perturbative_triples.and. (degree2 == 1) ) then call i_h_j(psi_ref(1,1,i_I),tmp_det,Nint,hka) hka = hij_cache(idx_alpha(k_sd)) - hka @@ -521,17 +413,14 @@ subroutine mrcc_part_dress(delta_ij_, delta_ij_s2_, i_generator,n_selected,det_b dka(i_state) = hka / Delta_E_inv(i_state) enddo endif - + endif - + do i_state=1,N_states dIa(i_state) = dIa(i_state) + dIk(i_state) * dka(i_state) enddo enddo - - do i_state=1,N_states - ci_inv(i_state) = psi_ref_coef_inv(i_I,i_state) - enddo + do l_sd=1,idx_alpha(0) k_sd = idx_alpha(l_sd) hla = hij_cache(k_sd) @@ -542,13 +431,13 @@ subroutine mrcc_part_dress(delta_ij_, delta_ij_s2_, i_generator,n_selected,det_b enddo enddo do i_state=1,N_states + do l_sd=1,idx_alpha(0) k_sd = idx_alpha(l_sd) hdress = dIa_hla(i_state,k_sd) * psi_ref_coef(i_I,i_state) sdress = dIa_sla(i_state,k_sd) * psi_ref_coef(i_I,i_state) - !!$OMP ATOMIC !$OMP ATOMIC - contrib(i_state) += hdress * psi_coef(dressed_column_idx(i_state), i_state) * psi_non_ref_coef(k_sd, i_state) + contrib(i_state) += hdress * psi_non_ref_coef(k_sd, i_state) !$OMP ATOMIC delta_ij_(i_state,k_sd) += hdress !$OMP ATOMIC @@ -581,7 +470,7 @@ END_PROVIDER double precision, allocatable :: mrcc(:) double precision :: E_CI_before!, relative_error - double precision, save :: target_error = 0d0 + double precision :: target_error allocate(mrcc(N_states)) @@ -593,12 +482,7 @@ END_PROVIDER E_CI_before = mrcc_E0_denominator(1) + nuclear_repulsion threshold_selectors = 1.d0 threshold_generators = 1d0 - if(target_error /= 0d0) then - target_error = target_error / 2d0 ! (-mrcc_E0_denominator(1) + mrcc_previous_E(1)) / 1d1 - else - target_error = 1d-4 - end if - target_error = 0d0 + target_error = thresh_dressed_ci * 5.d-2 call ZMQ_mrcc(E_CI_before, mrcc, delta_ij_mrcc_zmq, delta_ij_s2_mrcc_zmq, abs(target_error)) mrcc_previous_E(:) = mrcc_E0_denominator(:) @@ -610,21 +494,7 @@ END_PROVIDER use bitmasks implicit none integer :: i, j, i_state - !mrmode : 1=mrcepa0, 2=mrsc2 add, 3=mrcc, 4=stoch -! if(mrmode == 4) then -! do j = 1, N_det_non_ref -! do i_state = 1, N_states -! delta_ij(i_state,j) = delta_ij_mrcc_sto(i_state,j) -! delta_ij_s2(i_state,j) = delta_ij_s2_mrcc_sto(i_state,j) -! enddo -! end do -! else if(mrmode == 10) then -! do j = 1, N_det_non_ref -! do i_state = 1, N_states -! delta_ij(i_state,j) = delta_ij_mrsc2(i_state,j) -! delta_ij_s2(i_state,j) = delta_ij_s2_mrsc2(i_state,j) -! enddo -! end do + !mrmode : 1=mrcepa0, 2=mrsc2 add, 3=mrcc 5=mrcc_stoch if(mrmode == 5) then do j = 1, N_det_non_ref do i_state = 1, N_states @@ -657,13 +527,6 @@ END_PROVIDER stop "invalid mrmode" end if - !if(mrmode == 2 .or. mrmode == 3) then - ! do j = 1, N_det_non_ref - ! do i_state = 1, N_states - ! delta_ij(i_state,j) += delta_ij_cancel(i_state,j) - ! enddo - ! end do - !end if END_PROVIDER @@ -1159,7 +1022,7 @@ subroutine filter_tq(i_generator,n_selected,det_buffer,Nint,tq,N_tq,miniList,N_m if (good) then if (.not. is_in_wavefunction(det_buffer(1,1,i),Nint)) then N_tq += 1 - do k=1,N_int + do k=1,Nint tq(k,1,N_tq) = det_buffer(k,1,i) tq(k,2,N_tq) = det_buffer(k,2,i) enddo @@ -1247,3 +1110,146 @@ end +subroutine get_cc_coef(tq,c_alpha) + use bitmasks + implicit none + + integer(bit_kind), intent(in) :: tq(N_int,2) + double precision, intent(out) :: c_alpha(N_states) + + integer :: k + integer :: degree1, degree2, degree + + double precision :: hla, hka, dIk(N_states), dka(N_states), dIa(N_states) + double precision :: phase, phase2 + integer :: exc(0:2,2,2) + integer :: h1,h2,p1,p2,s1,s2 + integer(bit_kind) :: tmp_det(N_int,2) + integer :: i_state, k_sd, l_sd, i_I + logical :: ok + + PROVIDE n_act_orb elec_num + if (perturbative_triples) then + PROVIDE one_anhil fock_virt_total fock_core_inactive_total one_creat + endif + + + c_alpha(1:N_states) = 0.d0 + + do i_I=1,N_det_ref + ! Find triples and quadruple grand parents + call get_excitation_degree(tq,psi_ref(1,1,i_I),degree1,N_int) + if (degree1 < 3) then + return + endif + enddo + + ! |I> + do i_I=1,N_det_ref + ! Find triples and quadruple grand parents + call get_excitation_degree(tq,psi_ref(1,1,i_I),degree1,N_int) + if (degree1 > 4) then + cycle + endif + if ( (degree1 < 3).or.(degree1 > 4) ) stop 'bug' + + do i_state=1,N_states + dIa(i_state) = 0.d0 + enddo + + ! |alpha> + do k_sd=1,N_det_non_ref + + if (maxval(abs(psi_non_ref_coef(k_sd,1:N_states))) < 1.d-10) then + cycle + endif + + call get_excitation_degree(tq,psi_non_ref(1,1,k_sd),degree,N_int) + if (degree > 2) then + cycle + endif + + call get_excitation_degree(psi_ref(1,1,i_I),psi_non_ref(1,1,k_sd),degree,N_int) + if (degree > 2) then + cycle + endif + + do i_state=1,N_states + dIK(i_state) = dij(i_I, k_sd, i_state) + enddo + + if (maxval(abs(dIk)) < 1.d-10) then + cycle + endif + + + ! + + ! |l> = Exc(k -> alpha) |I> + call get_excitation(psi_non_ref(1,1,k_sd),tq,exc,degree2,phase,N_int) + call decode_exc(exc,degree2,h1,p1,h2,p2,s1,s2) + + tmp_det(1:N_int,1:2) = psi_ref(1:N_int,1:2,i_I) + + call apply_excitation(psi_ref(1,1,i_I), exc, tmp_det, ok, N_int) + + ! + dka(1:N_states) = 0.d0 + + if (ok) then + do l_sd=k_sd+1,N_det_non_ref + if (maxval(abs(psi_non_ref_coef(l_sd,1:N_states))) < 1.d-10) then + cycle + endif + call get_excitation_degree(tmp_det,psi_non_ref(1,1,l_sd),degree,N_int) + if (degree == 0) then + call get_excitation(psi_ref(1,1,i_I),psi_non_ref(1,1,l_sd),exc,degree,phase2,N_int) + do i_state=1,N_states + dka(i_state) = dij(i_I, l_sd, i_state) * phase * phase2 + enddo + exit + endif + enddo + + else if (perturbative_triples) then + ! Linked + + call i_h_j(tq,psi_non_ref(1,1,k_sd),N_int,hka) + if (dabs(hka) > 1.d-12) then + double precision :: Delta_E(N_states) + call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),tq,Delta_E) + + do i_state=1,N_states + ASSERT (Delta_E(i_state) < 0.d0) + dka(i_state) = hka / Delta_E(i_state) + enddo + endif + + endif + + if (perturbative_triples.and. (degree2 == 1) ) then + call i_h_j(psi_ref(1,1,i_I),tmp_det,N_int,hka) + call i_h_j(tq,psi_non_ref(1,1,k_sd),N_int,hla) + hka = hla - hka + if (dabs(hka) > 1.d-12) then + call get_delta_e_dyall_general_mp(psi_ref(1,1,i_I),tq,Delta_E) + do i_state=1,N_states + ASSERT (Delta_E(i_state) < 0.d0) + dka(i_state) = hka / Delta_E(i_state) + enddo + endif + + endif + + do i_state=1,N_states + dIa(i_state) = dIa(i_state) + dIk(i_state) * dka(i_state) + enddo + enddo + + do i_state=1,N_states + c_alpha(i_state) += dIa(i_state) * psi_ref_coef(i_I,i_state) + enddo + + enddo + +end diff --git a/plugins/mrcepa0/dressing_slave.irp.f b/plugins/mrcepa0/dressing_slave.irp.f index b0c3a360..cd635f20 100644 --- a/plugins/mrcepa0/dressing_slave.irp.f +++ b/plugins/mrcepa0/dressing_slave.irp.f @@ -450,15 +450,15 @@ subroutine mrsc2_dressing_collector(zmq_socket_pull,delta_ij_,delta_ij_s2_) do l=1, n(1) do i_state=1,N_states - delta_ij_(i_state,idx(l,1)) += delta(i_state,l,1) * psi_ref_coef(i_I,i_state) * c0(i_state) - delta_ij_s2_(i_state,idx(l,1)) += delta_s2(i_state,l,1) * psi_ref_coef(i_I,i_state) * c0(i_state) + delta_ij_(i_state,idx(l,1)) += delta(i_state,l,1) * psi_ref_coef(i_I,i_state) + delta_ij_s2_(i_state,idx(l,1)) += delta_s2(i_state,l,1) * psi_ref_coef(i_I,i_state) end do end do do l=1, n(2) do i_state=1,N_states - delta_ij_(i_state,idx(l,2)) += delta(i_state,l,2) * psi_ref_coef(J,i_state) * c0(i_state) - delta_ij_s2_(i_state,idx(l,2)) += delta_s2(i_state,l,2) * psi_ref_coef(J,i_state) * c0(i_state) + delta_ij_(i_state,idx(l,2)) += delta(i_state,l,2) * psi_ref_coef(J,i_state) + delta_ij_s2_(i_state,idx(l,2)) += delta_s2(i_state,l,2) * psi_ref_coef(J,i_state) end do end do diff --git a/plugins/mrcepa0/dressing_vector.irp.f b/plugins/mrcepa0/dressing_vector.irp.f index 933e57b9..c3d8287d 100644 --- a/plugins/mrcepa0/dressing_vector.irp.f +++ b/plugins/mrcepa0/dressing_vector.irp.f @@ -6,26 +6,25 @@ BEGIN_DOC ! Null dressing vectors END_DOC - dressing_column_h(:,:) = 0.d0 - dressing_column_s(:,:) = 0.d0 integer :: i,ii,k,j,jj, l double precision :: f, tmp double precision, external :: u_dot_v + dressing_column_h(:,:) = 0.d0 + dressing_column_s(:,:) = 0.d0 do k=1,N_states l = dressed_column_idx(k) - f = 1.d0/psi_coef(l,k) - do jj = 1, n_det_non_ref + f = -1.d0/psi_coef(l,k) + do jj=1,N_det_non_ref j = idx_non_ref(jj) - dressing_column_h(j,k) = delta_ij (k,jj) * f - dressing_column_s(j,k) = delta_ij_s2(k,jj) * f + dressing_column_h(j,k) = 2.d0*delta_ij (k,jj) + dressing_column_s(j,k) = 2.d0*delta_ij_s2(k,jj) + dressing_column_h(l,k) += psi_coef(j,k) * delta_ij(k,jj) + dressing_column_s(l,k) += psi_coef(j,k) * delta_ij_s2(k,jj) enddo - tmp = u_dot_v(dressing_column_h(1,k), psi_coef(1,k), N_det) - dressing_column_h(l,k) -= tmp * f - tmp = u_dot_v(dressing_column_s(1,k), psi_coef(1,k), N_det) - dressing_column_s(l,k) -= tmp * f + dressing_column_h(l,k) *= f + dressing_column_s(l,k) *= f enddo -! stop END_PROVIDER diff --git a/plugins/mrcepa0/mrcc.irp.f b/plugins/mrcepa0/mrcc.irp.f index e0ae3e21..7be35b87 100644 --- a/plugins/mrcepa0/mrcc.irp.f +++ b/plugins/mrcepa0/mrcc.irp.f @@ -7,7 +7,7 @@ program mrsc2sub mrmode = 3 read_wf = .True. - SOFT_TOUCH read_wf + SOFT_TOUCH read_wf call set_generators_bitmasks_as_holes_and_particles if (.True.) then integer :: i,j diff --git a/plugins/mrcepa0/mrcc_omp.irp.f b/plugins/mrcepa0/mrcc_omp.irp.f deleted file mode 100644 index 5c4d318d..00000000 --- a/plugins/mrcepa0/mrcc_omp.irp.f +++ /dev/null @@ -1,27 +0,0 @@ -program mrsc2sub - implicit none - double precision, allocatable :: energy(:) - allocate (energy(N_states)) - - !!mrmode : 1=mrcepa0, 2=mrsc2 add, 3=mrcc - mrmode = 4 - - read_wf = .True. - SOFT_TOUCH read_wf - call set_generators_bitmasks_as_holes_and_particles - if (.True.) then - integer :: i,j - do j=1,N_states - do i=1,N_det - psi_coef(i,j) = CI_eigenvectors(i,j) - enddo - enddo - SOFT_TOUCH psi_coef - endif - call run(N_states,energy) - if(do_pt2)then - call run_pt2(N_states,energy) - endif - deallocate(energy) -end - diff --git a/plugins/mrcepa0/mrcc_stoch_routines.irp.f b/plugins/mrcepa0/mrcc_stoch_routines.irp.f index 1b605e6d..24068bec 100644 --- a/plugins/mrcepa0/mrcc_stoch_routines.irp.f +++ b/plugins/mrcepa0/mrcc_stoch_routines.irp.f @@ -43,6 +43,7 @@ subroutine ZMQ_mrcc(E, mrcc, delta, delta_s2, relative_error) + call write_double(6,relative_error,"Target relative error") print *, '========== ================= ================= =================' print *, ' Samples Energy Stat. Error Seconds ' print *, '========== ================= ================= =================' @@ -177,7 +178,6 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m usf = 0d0 num = 0d0 - print *, "TARGET ERROR :", relative_error delta = 0d0 delta_s2 = 0d0 allocate(delta_det(N_states, N_det_non_ref, 0:comb_teeth+1, 2)) @@ -310,7 +310,6 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m end if end do if(cur_cp == 0) then - print *, "no checkpoint reached so far..." cycle pullLoop end if !!!!!!!!!!!! @@ -337,7 +336,7 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m print '(I5,F15.7,E12.4,F10.2)', cur_cp, E(mrcc_stoch_istate)+E0+avg, eqt, time-timeInit end if - if ((dabs(eqt) < relative_error .and. cps_N(cur_cp) >= 30) .or. total_computed == N_det_generators) then + if (( (dabs(eqt/(E(mrcc_stoch_istate)+E0+avg)) < relative_error) .and. (cps_N(cur_cp) >= 10) ) .or. total_computed == N_det_generators) then if (zmq_abort(zmq_to_qp_run_socket) == -1) then call sleep(1) if (zmq_abort(zmq_to_qp_run_socket) == -1) then @@ -401,12 +400,13 @@ end function &BEGIN_PROVIDER [ integer, comb_teeth ] &BEGIN_PROVIDER [ integer, N_cps_max ] implicit none + integer :: comb_per_cp comb_teeth = 16 N_cps_max = 64 - !comb_per_cp = 64 +! comb_per_cp = 64 gen_per_cp = (N_det_generators / N_cps_max) + 1 - N_cps_max += 1 - !N_cps_max = N_det_generators / comb_per_cp + 1 +! N_cps_max += 1 + N_cps_max = N_det_generators / gen_per_cp + 1 END_PROVIDER @@ -526,6 +526,11 @@ subroutine get_comb_val(stato, detail, cur_cp, val) val = 0d0 first = cp_first_tooth(cur_cp) + !TODO : check + if (first == 0) then + return + endif + do j = comb_teeth, first, -1 !DIR$ FORCEINLINE k = mrcc_find(curs, mrcc_cweight,size(mrcc_cweight), first_det_of_teeth(j), first_det_of_teeth(j+1)) @@ -562,7 +567,7 @@ subroutine add_comb(com, computed, cp, N, tbc) implicit none double precision, intent(in) :: com integer, intent(inout) :: N - double precision, intent(inout) :: cp(N_det_non_ref) + double precision, intent(inout) :: cp(N_det_generators) logical, intent(inout) :: computed(N_det_generators) integer, intent(inout) :: tbc(N_det_generators) integer :: i, k, l, dets(comb_teeth) @@ -591,7 +596,7 @@ end subroutine &BEGIN_PROVIDER [ double precision, mrcc_cweight_cache, (N_det_generators) ] &BEGIN_PROVIDER [ double precision, fractage, (comb_teeth) ] &BEGIN_PROVIDER [ double precision, comb_step ] -&BEGIN_PROVIDER [ integer, first_det_of_teeth, (comb_teeth+1) ] +&BEGIN_PROVIDER [ integer, first_det_of_teeth, (0:comb_teeth+1) ] &BEGIN_PROVIDER [ integer, first_det_of_comb ] &BEGIN_PROVIDER [ integer, tooth_of_det, (N_det_generators) ] implicit none @@ -650,6 +655,7 @@ end subroutine end do first_det_of_teeth(comb_teeth+1) = N_det_generators + 1 first_det_of_teeth(1) = first_det_of_comb + first_det_of_teeth(0) = 1 if(first_det_of_teeth(1) /= first_det_of_comb) then diff --git a/plugins/mrcepa0/mrcc_zmq.irp.f b/plugins/mrcepa0/mrcc_zmq.irp.f index f9c519e9..92fc259d 100644 --- a/plugins/mrcepa0/mrcc_zmq.irp.f +++ b/plugins/mrcepa0/mrcc_zmq.irp.f @@ -6,6 +6,10 @@ program mrsc2sub !mrmode : 1=mrcepa0, 2=mrsc2 add, 3=mrcc mrmode = 5 + threshold_generators = 1.d0 + threshold_selectors = 1.d0 + TOUCH threshold_generators threshold_selectors + read_wf = .True. SOFT_TOUCH read_wf call set_generators_bitmasks_as_holes_and_particles diff --git a/plugins/mrcepa0/save_mrcc_wavefunction.irp.f b/plugins/mrcepa0/save_mrcc_wavefunction.irp.f new file mode 100644 index 00000000..da52b56d --- /dev/null +++ b/plugins/mrcepa0/save_mrcc_wavefunction.irp.f @@ -0,0 +1,58 @@ +program save_mrcc_wf + implicit none + + threshold_generators = 1.d0 + threshold_selectors = 1.d0 + PROVIDE N_int psi_det + TOUCH threshold_generators threshold_selectors + + mrmode=5 + read_wf = .True. + SOFT_TOUCH read_wf mrmode + call generate_all_alpha_beta_det_products + + call run1 + call run2 +end + +subroutine run1 + implicit none + + integer :: k + double precision :: c_alpha(N_states) + call set_generators_bitmasks_as_holes_and_particles + + call get_cc_coef(psi_det(1,1,1), c_alpha) + !$OMP PARALLEL DO DEFAULT(SHARED) & + !$OMP PRIVATE(k,c_alpha) SCHEDULE(static,64) + do k=1,N_det +! if (maxval(abs(psi_coef(k,1:N_states))) == 0.d0) then + if (iand(k,1023) == 0) then + print *, k, '/', N_det + endif + call get_cc_coef(psi_det(1,1,k), c_alpha) + psi_coef(k,1:N_states) = c_alpha(1:N_states) +! endif + enddo + !$OMP END PARALLEL DO + SOFT_TOUCH psi_coef +end + +subroutine run2 + implicit none + + integer :: k + double precision :: c_alpha(N_states) + + psi_det(1:N_int,1:2,1:N_det) = psi_det_sorted(1:N_int,1:2,1:N_det) + psi_coef(1:N_det,1:N_states) = psi_coef_sorted(1:N_det,1:N_states) +! do k=N_det,1,-1 +! if (maxval(abs(psi_coef(k,1:N_states))) > 0.d0) then +! exit +! endif +! enddo +! N_det = k + SOFT_TOUCH N_det psi_coef psi_det + call save_wavefunction +end + diff --git a/plugins/pyscf/PyscfToQp.py b/plugins/pyscf/PyscfToQp.py index 74ef951c..3fd650ac 100644 --- a/plugins/pyscf/PyscfToQp.py +++ b/plugins/pyscf/PyscfToQp.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python2 import numpy,re,sys diff --git a/plugins/read_integral/Gen_Ezfio_from_integral.sh b/plugins/read_integral/Gen_Ezfio_from_integral.sh deleted file mode 100755 index d190ffae..00000000 --- a/plugins/read_integral/Gen_Ezfio_from_integral.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -ezfio=$1 -# Create the integral -echo 'Create Integral' - -echo 'Create EZFIO' -read nel nmo natom <<< $(cat param) -read e_nucl <<< $(cat e_nuc) -./create_ezfio.py $ezfio $nel $natom $nmo $e_nucl -#Handle the orbital consitensy check -qp_edit -c $ezfio &> /dev/null -cp $ezfio/{ao,mo}_basis/ao_md5 - -#Read the integral -echo 'Read Integral' -qp_run read_integrals_mo $ezfio diff --git a/plugins/shiftedbk/EZFIO.cfg b/plugins/shiftedbk/EZFIO.cfg index 001535b9..6123f458 100644 --- a/plugins/shiftedbk/EZFIO.cfg +++ b/plugins/shiftedbk/EZFIO.cfg @@ -1,5 +1,28 @@ +[energy] +type: double precision +doc: Calculated energy +interface: ezfio + +[energy_pt2] +type: double precision +doc: Calculated energy with pt2 contribution +interface: ezfio + +[thresh_dressed_ci] +type: Threshold +doc: Threshold on the convergence of the dressed CI energy +interface: ezfio,provider,ocaml +default: 1.e-5 + +[n_it_max_dressed_ci] +type: Strictly_positive_int +doc: Maximum number of dressed CI iterations +interface: ezfio,provider,ocaml +default: 30 + [h0_type] type: Perturbation doc: Type of zeroth-order Hamiltonian [ EN | Barycentric ] interface: ezfio,provider,ocaml default: EN + diff --git a/plugins/shiftedbk/selection_buffer.irp.f b/plugins/shiftedbk/selection_buffer.irp.f index 8c3bee91..8b140666 100644 --- a/plugins/shiftedbk/selection_buffer.irp.f +++ b/plugins/shiftedbk/selection_buffer.irp.f @@ -156,3 +156,89 @@ end subroutine +subroutine unique_selection_buffer(b) + use selection_types + implicit none + BEGIN_DOC +! Removes duplicate determinants in the selection buffer + END_DOC + type(selection_buffer), intent(inout) :: b + integer, allocatable :: iorder(:) + integer(bit_kind), pointer :: detmp(:,:,:) + double precision, pointer :: val(:) + integer :: i,j,k + integer(bit_kind), allocatable :: bit_tmp(:) + logical,allocatable :: duplicate(:) + + logical :: found_duplicates + integer*8, external :: det_search_key + + if (b%N == 0 .or. b%cur == 0) return + allocate (duplicate(b%cur), val(size(b%val)), detmp(N_int, 2, size(b%val)), bit_tmp(b%cur)) + call sort_dets_by_det_search_key(b%cur, b%det, b%val, detmp, val, 1) + + deallocate(b%det, b%val) + do i=b%cur+1,b%N + val(i) = 0.d0 + detmp(1:N_int,1:2,i) = 0_bit_kind + enddo + b%det => detmp + b%val => val + + do i=1,b%cur + bit_tmp(i) = det_search_key(b%det(1,1,i),N_int) + duplicate(i) = .False. + enddo + + do i=1,b%cur-1 + if (duplicate(i)) then + cycle + endif + j = i+1 + do while (bit_tmp(j)==bit_tmp(i)) + if (duplicate(j)) then + j += 1 + if (j > b%cur) then + exit + else + cycle + endif + endif + duplicate(j) = .True. + do k=1,N_int + if ( (b%det(k,1,i) /= b%det(k,1,j) ) & + .or. (b%det(k,2,i) /= b%det(k,2,j) ) ) then + duplicate(j) = .False. + exit + endif + enddo + j += 1 + if (j > b%cur) then + exit + endif + enddo + enddo + + found_duplicates = .False. + do i=1,b%cur + if (duplicate(i)) then + found_duplicates = .True. + exit + endif + enddo + + if (found_duplicates) then + k=0 + do i=1,N_det + if (.not.duplicate(i)) then + k += 1 + b%det(:,:,k) = b%det(:,:,i) + b%val(k) = b%val(i) + endif + enddo + b%cur = k + endif + deallocate (duplicate,bit_tmp) +end + + diff --git a/plugins/shiftedbk/shifted_bk_iter.irp.f b/plugins/shiftedbk/shifted_bk_iter.irp.f new file mode 100644 index 00000000..429efa4b --- /dev/null +++ b/plugins/shiftedbk/shifted_bk_iter.irp.f @@ -0,0 +1,159 @@ +program shifted_bk + implicit none + integer :: i,j,k + double precision, allocatable :: pt2(:) + integer :: degree + integer :: n_det_before + double precision :: threshold_davidson_in + + allocate (pt2(N_states)) + + double precision :: hf_energy_ref + logical :: has + double precision :: relative_error, absolute_error + integer :: N_states_p + character*(512) :: fmt + + PROVIDE psi_bilinear_matrix_columns_loc psi_det_alpha_unique psi_det_beta_unique + PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order + PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns + PROVIDE psi_bilinear_matrix_transp_order + + + pt2 = -huge(1.e0) + threshold_davidson_in = threshold_davidson + threshold_davidson = threshold_davidson_in * 100.d0 + SOFT_TOUCH threshold_davidson + + call diagonalize_CI_dressed + call save_wavefunction + + call ezfio_has_hartree_fock_energy(has) + if (has) then + call ezfio_get_hartree_fock_energy(hf_energy_ref) + else + hf_energy_ref = ref_bitmask_energy + endif + + if (N_det > N_det_max) then + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + N_det = N_det_max + soft_touch N_det psi_det psi_coef + call diagonalize_CI_dressed + call save_wavefunction + N_states_p = min(N_det,N_states) + endif + + n_det_before = 0 + + character*(8) :: pt2_string + double precision :: threshold_selectors_save, threshold_generators_save + threshold_selectors_save = threshold_selectors + threshold_generators_save = threshold_generators + double precision :: error(N_states), energy(N_states) + error = 0.d0 + + threshold_selectors = 1.d0 + threshold_generators = 1d0 + + if (.True.) then + pt2_string = '(sh-Bk) ' + do while ( (N_det < N_det_max) ) + write(*,'(A)') '--------------------------------------------------------------------------------' + + N_det_delta_ij = N_det + + do i=1,N_states + energy(i) = psi_energy(i)+nuclear_repulsion + enddo + + PROVIDE delta_ij_tmp + call delta_ij_done() + + call diagonalize_ci_dressed + do i=1,N_states + pt2(i) = ci_energy_dressed(i) - energy(i) + enddo + + N_states_p = min(N_det,N_states) + + print *, '' + print '(A,I12)', 'Summary at N_det = ', N_det + print '(A)', '-----------------------------------' + print *, '' + print *, '' + + write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' + write(*,fmt) + write(fmt,*) '(12X,', N_states_p, '(6X,A7,1X,I6,10X))' + write(*,fmt) ('State',k, k=1,N_states_p) + write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' + write(*,fmt) + write(fmt,*) '(A12,', N_states_p, '(1X,F14.8,15X))' + write(*,fmt) '# E ', energy(1:N_states_p) + if (N_states_p > 1) then + write(*,fmt) '# Excit. (au)', energy(1:N_states_p)-energy(1) + write(*,fmt) '# Excit. (eV)', (energy(1:N_states_p)-energy(1))*27.211396641308d0 + endif + write(fmt,*) '(A12,', 2*N_states_p, '(1X,F14.8))' + write(*,fmt) '# PT2'//pt2_string, (pt2(k), error(k), k=1,N_states_p) + write(*,'(A)') '#' + write(*,fmt) '# E+PT2 ', (energy(k)+pt2(k),error(k), k=1,N_states_p) + if (N_states_p > 1) then + write(*,fmt) '# Excit. (au)', ( (energy(k)+pt2(k)-energy(1)-pt2(1)), & + dsqrt(error(k)*error(k)+error(1)*error(1)), k=1,N_states_p) + write(*,fmt) '# Excit. (eV)', ( (energy(k)+pt2(k)-energy(1)-pt2(1))*27.211396641308d0, & + dsqrt(error(k)*error(k)+error(1)*error(1))*27.211396641308d0, k=1,N_states_p) + endif + write(fmt,*) '(''# ============'',', N_states_p, '(1X,''=============================''))' + write(*,fmt) + print *, '' + + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + + do k=1, N_states_p + print*,'State ',k + print *, 'PT2 = ', pt2(k) + print *, 'E = ', energy(k) + print *, 'E+PT2'//pt2_string//' = ', energy(k)+pt2(k) + enddo + + print *, '-----' + if(N_states.gt.1)then + print *, 'Variational Energy difference (au | eV)' + do i=2, N_states_p + print*,'Delta E = ', (energy(i) - energy(1)), & + (energy(i) - energy(1)) * 27.211396641308d0 + enddo + print *, '-----' + print*, 'Variational + perturbative Energy difference (au | eV)' + do i=2, N_states_p + print*,'Delta E = ', (energy(i)+ pt2(i) - (energy(1) + pt2(1))), & + (energy(i)+ pt2(i) - (energy(1) + pt2(1))) * 27.211396641308d0 + enddo + endif + call ezfio_set_shiftedbk_energy_pt2(energy(1)+pt2(1)) +! call dump_fci_iterations_value(N_det,energy,pt2) + + n_det_before = N_det + + PROVIDE psi_coef + PROVIDE psi_det + PROVIDE psi_det_sorted + + if (N_det >= N_det_max) then + threshold_davidson = threshold_davidson_in + end if + call save_wavefunction + call ezfio_set_shiftedbk_energy(energy(1)) + call ezfio_set_shiftedbk_energy_pt2(ci_energy_dressed(1)) + enddo + endif + + + + +end + diff --git a/plugins/shiftedbk/shifted_bk_routines.irp.f b/plugins/shiftedbk/shifted_bk_routines.irp.f index 65188e45..216f9ec3 100644 --- a/plugins/shiftedbk/shifted_bk_routines.irp.f +++ b/plugins/shiftedbk/shifted_bk_routines.irp.f @@ -16,21 +16,22 @@ END_PROVIDER &BEGIN_PROVIDER [ type(selection_buffer), global_sb ] &BEGIN_PROVIDER [ type(selection_buffer), mini_sb ] &BEGIN_PROVIDER [ double precision, N_det_increase_factor ] - implicit none - integer :: i - - N_det_increase_factor = 1d0 - - - n_det_add = max(1, int(float(N_det) * N_det_increase_factor)) - call create_selection_buffer(n_det_add, n_det_add*2, global_sb) - call create_selection_buffer(n_det_add, n_det_add*2, mini_sb) - do i=1,Nproc - call create_selection_buffer(n_det_add, n_det_add*2, sb(i)) - end do - a_h_i = 0d0 - a_s2_i = 0d0 - END_PROVIDER + implicit none + fock_diag_tmp_(:,:,:) = 0.d0 + integer :: i + + N_det_increase_factor = dble(N_states) + + + n_det_add = max(1, int(float(N_det) * N_det_increase_factor)) + call create_selection_buffer(n_det_add, n_det_add*2, global_sb) + call create_selection_buffer(n_det_add, n_det_add*2, mini_sb) + do i=1,Nproc + call create_selection_buffer(n_det_add, n_det_add*2, sb(i)) + end do + a_h_i = 0d0 + a_s2_i = 0d0 +END_PROVIDER BEGIN_PROVIDER [ integer, N_dress_int_buffer ] @@ -50,6 +51,7 @@ subroutine generator_done(i_gen, int_buf, double_buf, det_buf, N_buf, iproc) double precision, intent(out) :: double_buf(N_dress_double_buffer) integer(bit_kind), intent(out) :: det_buf(N_int, 2, N_dress_det_buffer) integer :: i + int_buf(:) = 0 call sort_selection_buffer(sb(iproc)) @@ -118,15 +120,17 @@ subroutine delta_ij_done() old_det_gen = N_det_generators + ! Add buffer only when the last state is computed + call unique_selection_buffer(global_sb) call sort_selection_buffer(global_sb) call fill_H_apply_buffer_no_selection(global_sb%cur,global_sb%det,N_int,0) call copy_H_apply_buffer_to_wf() - if (s2_eig.or.(N_states > 1) ) then call make_s2_eigenfunction endif call undress_with_alpha(old_generators, old_det_gen, psi_det(1,1,N_det_delta_ij+1), N_det-N_det_delta_ij) call save_wavefunction + end subroutine @@ -253,7 +257,7 @@ subroutine dress_with_alpha_(Nstates,Ndet,Nint,delta_ij_loc,minilist, det_minili contrib = 0d0 do i=1,Nstates - de = E0_denominator(i) - haa + de = dress_E0_denominator(i) - haa if(DABS(de) < 1D-5) cycle c_alpha(i) = a_h_psi(i) / de @@ -312,23 +316,4 @@ BEGIN_PROVIDER [ logical, initialize_E0_denominator ] END_PROVIDER -BEGIN_PROVIDER [ double precision, E0_denominator, (N_states) ] - implicit none - BEGIN_DOC - ! E0 in the denominator of the PT2 - END_DOC - if (initialize_E0_denominator) then - if (h0_type == "EN") then - E0_denominator(1:N_states) = psi_energy(1:N_states) - else if (h0_type == "Barycentric") then - E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states) - else - print *, h0_type, ' not implemented' - stop - endif - else - E0_denominator = -huge(1.d0) - endif -END_PROVIDER - diff --git a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py index 6b415dd7..3c515485 100755 --- a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py +++ b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py @@ -28,7 +28,8 @@ except: sys.exit(1) else: sys.path = [ QP_ROOT + "/install/EZFIO/Python", - QP_ROOT + "/resultsFile", + QP_ROOT + "/install/resultsFile", + QP_ROOT + "/install", QP_ROOT + "/scripts"] + sys.path # ~#~#~#~#~#~ # @@ -92,6 +93,7 @@ def write_ezfio(res, filename): coord_y.append(a.coord[1] / a0) coord_z.append(a.coord[2] / a0) + # ~#~#~#~#~ # # W r i t e # # ~#~#~#~#~ # @@ -125,9 +127,7 @@ def write_ezfio(res, filename): coefficient = [] exponent = [] - res.clean_contractions() res.convert_to_cartesian() - # ~#~#~#~#~#~#~ # # P a r s i n g # # ~#~#~#~#~#~#~ # @@ -262,159 +262,74 @@ def write_ezfio(res, filename): ezfio.set_mo_basis_mo_occ(OccNum) ezfio.set_mo_basis_mo_coef(MoMatrix) - # ______ _ - # | ___ \ | | - # | |_/ /__ ___ _ _ __| | ___ - # | __/ __|/ _ \ | | |/ _` |/ _ \ - # | | \__ \ __/ |_| | (_| | (_) | - # \_| |___/\___|\__,_|\__,_|\___/ - # - - # INPUT - # {% for lanel,zcore, l_block in l_atom $} - # #local l_block l=0} - # {label} GEN {zcore} {len(l_block)-1 #lmax_block} - # {% for l_param in l_block%} - # {len(l_param) # list of parameter aka n_max_bock_max(n)} - # {% for coef,n,zeta for l_param} - # {coef,n, zeta} - - - # OUTPUT - - # Local are 1 array padded by max(n_max_block) when l == 0 (output:k_loc_max) - # v_k[n-2][atom] = value - - #Non Local are 2 array padded with max of lmax_block when l!=0 (output:lmax+1) and max(n_max_block)whem l !=0 (kmax) - # v_kl[l][n-2][atom] = value - - def pad(array, size, value=0): - new_array = array - for add in xrange(len(array), size): - new_array.append(value) - - return new_array - - def parse_str(pseudo_str): - '''Return 4d array atom,l,n, attribute (attribute is coef, n, zeta)''' - matrix = [] - array_l_max_block = [] - array_z_remove = [] - - for block in [b for b in pseudo_str.split('\n\n') if b]: - #First element is header, the rest are l_param - array_party = [i for i in re.split(r"\n\d+\n", block) if i] - - z_remove, l_max_block = map(int, array_party[0].split()[-2:]) - array_l_max_block.append(l_max_block) - array_z_remove.append(z_remove) - - x = [] - for l in array_party[1:]: - y = [] - for coef_n_zeta in l.split('\n'): - z = coef_n_zeta.split() - if z : y.append(z) - x.append(y) - matrix.append(x) - return (matrix, array_l_max_block, array_z_remove) - - def get_local_stuff(matrix): - - matrix_local_unpad = [atom[0] for atom in matrix] - k_loc_max = max(len(i) for i in matrix_local_unpad) - - matrix_local = [ pad(ll, k_loc_max, [0., 2, 0.]) for ll in matrix_local_unpad] - m_coef = [[float(i[0]) for i in atom] for atom in matrix_local] - m_n = [[int(i[1]) - 2 for i in atom] for atom in matrix_local] - m_zeta = [[float(i[2]) for i in atom] for atom in matrix_local] - return (k_loc_max, m_coef, m_n, m_zeta) - - def get_non_local_stuff(matrix): - - matrix_unlocal_unpad = [atom[1:] for atom in matrix] - l_max_block = max(len(i) for i in matrix_unlocal_unpad) - k_max = max([len(item) for row in matrix_unlocal_unpad for item in row]) - - matrix_unlocal_semipaded = [[pad(item, k_max, [0., 2, 0.]) for item in row] for row in matrix_unlocal_unpad] - - empty_row = [[0., 2, 0.] for k in range(l_max_block)] - matrix_unlocal = [ pad(ll, l_max_block, empty_row) for ll in matrix_unlocal_semipaded ] - - m_coef_noloc = [[[float(k[0]) for k in j] for j in i] for i in matrix_unlocal] - m_n_noloc = [[[int(k[1]) - 2 for k in j] for j in i] for i in matrix_unlocal] - m_zeta_noloc = [[[float(k[2]) for k in j] for j in i] for i in matrix_unlocal] - - return (l_max_block, k_max, m_coef_noloc, m_n_noloc, m_zeta_noloc) - try: - pseudo_str = [] - label = ezfio.get_nuclei_nucl_label() + lmax = 0 + nucl_charge_remove = [] + klocmax = 0 + kmax = 0 + nucl_num = len(res.geometry) for ecp in res.pseudo: - pseudo_str += [ "%(label)s GEN %(zcore)d %(lmax)d" % { "label": label[ ecp["atom"]-1 ], - "zcore": ecp["zcore"], "lmax": ecp["lmax"] } ] - lmax = ecp["lmax"] - for l in [lmax] + list(range(0,lmax)): - pseudo_str += [ "%d"%len(ecp[str(l)]) ] - for t in ecp[str(l)]: - pseudo_str += [ "%f %d %f"%t ] - pseudo_str += [""] - pseudo_str = "\n".join(pseudo_str) - - matrix, array_l_max_block, array_z_remove = parse_str(pseudo_str) - array_z_remove = map(float,array_z_remove) + lmax_local = ecp['lmax'] + lmax = max(lmax_local,lmax) + nucl_charge_remove.append(ecp['zcore']) + klocmax = max(klocmax, len(ecp[str(lmax_local)])) + for l in range(lmax_local): + kmax = max(kmax,len(ecp[str(l)])) + lmax = lmax-1 + ezfio.set_pseudo_pseudo_lmax(lmax) + ezfio.set_pseudo_nucl_charge_remove(nucl_charge_remove) + ezfio.set_pseudo_pseudo_klocmax(klocmax) + ezfio.set_pseudo_pseudo_kmax(kmax) + pseudo_n_k = [ [ 0 for _ in range(nucl_num) ] for _ in range(klocmax) ] + pseudo_v_k = [ [ 0. for _ in range(nucl_num) ] for _ in range(klocmax) ] + pseudo_dz_k = [ [ 0. for _ in range(nucl_num) ] for _ in range(klocmax) ] + pseudo_n_kl = [ [ [ 0 for _ in range(nucl_num) ] for _ in range(kmax) ] for _ in range(lmax+1) ] + pseudo_v_kl = [ [ [ 0. for _ in range(nucl_num) ] for _ in range(kmax) ] for _ in range(lmax+1) ] + pseudo_dz_kl = [ [ [ 0. for _ in range(nucl_num) ] for _ in range(kmax) ] for _ in range(lmax+1) ] + for ecp in res.pseudo: + lmax_local = ecp['lmax'] + klocmax = len(ecp[str(lmax_local)]) + atom = ecp['atom']-1 + for kloc in range(klocmax): + try: + v, n, dz = ecp[str(lmax_local)][kloc] + pseudo_n_k[kloc][atom] = n-2 + pseudo_v_k[kloc][atom] = v + pseudo_dz_k[kloc][atom] = dz + except: + pass + for l in range(lmax_local): + for k in range(kmax): + try: + v, n, dz = ecp[str(l)][k] + pseudo_n_kl[l][k][atom] = n-2 + pseudo_v_kl[l][k][atom] = v + pseudo_dz_kl[l][k][atom] = dz + except: + pass + ezfio.set_pseudo_pseudo_n_k(pseudo_n_k) + ezfio.set_pseudo_pseudo_v_k(pseudo_v_k) + ezfio.set_pseudo_pseudo_dz_k(pseudo_dz_k) + ezfio.set_pseudo_pseudo_n_kl(pseudo_n_kl) + ezfio.set_pseudo_pseudo_v_kl(pseudo_v_kl) + ezfio.set_pseudo_pseudo_dz_kl(pseudo_dz_kl) + + n_alpha = res.num_alpha + n_beta = res.num_beta + for i in range(nucl_num): + charge[i] -= nucl_charge_remove[i] + n_alpha -= nucl_charge_remove[i]/2 + n_beta -= nucl_charge_remove[i]/2 + ezfio.set_nuclei_nucl_charge(charge) + ezfio.set_electrons_elec_alpha_num(n_alpha) + ezfio.set_electrons_elec_beta_num(n_beta) + except: ezfio.set_pseudo_do_pseudo(False) else: ezfio.set_pseudo_do_pseudo(True) + - # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # - # Z _ e f f , a l p h a / b e t a _ e l e c # - # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # - - ezfio.set_pseudo_nucl_charge_remove(array_z_remove) - charge = ezfio.get_nuclei_nucl_charge() - charge = [ i - j for i, j in zip(charge, array_z_remove) ] - ezfio.set_nuclei_nucl_charge (charge) - - import math - num_elec_diff = sum(array_z_remove)/2 - nalpha = ezfio.get_electrons_elec_alpha_num() - num_elec_diff - nbeta = ezfio.get_electrons_elec_beta_num() - num_elec_diff - - ezfio.set_electrons_elec_alpha_num(nalpha) - ezfio.set_electrons_elec_beta_num( nbeta ) - - # Change all the array 'cause EZFIO - # v_kl (v, l) => v_kl(l,v) - # v_kl => zip(*_v_kl) - # [[7.0, 79.74474797, -49.45159098], [1.0, 5.41040609, -4.60151975]] - # [(7.0, 1.0), (79.74474797, 5.41040609), (-49.45159098, -4.60151975)] - - # ~#~#~#~#~ # - # L o c a l # - # ~#~#~#~#~ # - - klocmax, m_coef, m_n, m_zeta = get_local_stuff(matrix) - ezfio.pseudo_pseudo_klocmax = klocmax - - ezfio.pseudo_pseudo_v_k = zip(*m_coef) - ezfio.pseudo_pseudo_n_k = zip(*m_n) - ezfio.pseudo_pseudo_dz_k = zip(*m_zeta) - - # ~#~#~#~#~#~#~#~#~ # - # N o n _ L o c a l # - # ~#~#~#~#~#~#~#~#~ # - - l_max_block, k_max, m_coef_noloc, m_n_noloc, m_zeta_noloc = get_non_local_stuff( - matrix) - - ezfio.pseudo_pseudo_lmax = l_max_block - 1 - ezfio.pseudo_pseudo_kmax = k_max - - ezfio.pseudo_pseudo_v_kl = zip(*m_coef_noloc) - ezfio.pseudo_pseudo_n_kl = zip(*m_n_noloc) - ezfio.pseudo_pseudo_dz_kl = zip(*m_zeta_noloc) def get_full_path(file_path): diff --git a/scripts/qp_set_frozen_core.py b/scripts/qp_set_frozen_core.py index 51915170..e5046055 100755 --- a/scripts/qp_set_frozen_core.py +++ b/scripts/qp_set_frozen_core.py @@ -6,21 +6,26 @@ import sys sys.path = [ os.environ["QP_ROOT"]+"/install/EZFIO/Python" ] + sys.path from ezfio import ezfio -ezfio.set_filename(sys.argv[1]) + +filename = sys.argv[1] +if filename == '-q': filename = sys.argv[2] + +ezfio.set_filename(filename) nb = 0 -for charge in ezfio.nuclei_nucl_charge: - if charge < 5: - pass - elif charge < 13: - nb += 1 - else: - nb += 5 +if not ezfio.pseudo_do_pseudo: + for charge in ezfio.nuclei_nucl_charge: + if charge < 5: + pass + elif charge < 13: + nb += 1 + else: + nb += 5 mo_tot_num = ezfio.mo_basis_mo_tot_num if len(sys.argv)>2: - if sys.argv[2] == '-q': + if '-q' in sys.argv: print nb sys.exit(0) diff --git a/src/Bitmask/bitmasks.irp.f b/src/Bitmask/bitmasks.irp.f index 4eac3e0a..fcfe03c8 100644 --- a/src/Bitmask/bitmasks.irp.f +++ b/src/Bitmask/bitmasks.irp.f @@ -21,14 +21,17 @@ BEGIN_PROVIDER [ integer(bit_kind), full_ijkl_bitmask, (N_int) ] ! Bitmask to include all possible MOs END_DOC - integer :: i,j,n - n = mod(mo_tot_num-1,bit_kind_size)+1 - full_ijkl_bitmask = 0_bit_kind - do i=1,N_int-1 - full_ijkl_bitmask(i) = not(0_bit_kind) - enddo - do i=1,n - full_ijkl_bitmask(N_int) = ibset(full_ijkl_bitmask(N_int),i-1) + integer :: i,j,k + k=0 + do j=1,N_int + full_ijkl_bitmask(j) = 0_bit_kind + do i=0,bit_kind_size-1 + k=k+1 + if (mo_class(k) /= 'Deleted') then + full_ijkl_bitmask(j) = ibset(full_ijkl_bitmask(j),i) + endif + if (k == mo_tot_num) exit + enddo enddo END_PROVIDER @@ -559,7 +562,7 @@ END_PROVIDER n_core_inact_act_orb = 0 do i = 1, N_int reunion_of_core_inact_act_bitmask(i,1) = ior(reunion_of_core_inact_bitmask(i,1),cas_bitmask(i,1,1)) - reunion_of_core_inact_act_bitmask(i,2) = ior(reunion_of_core_inact_bitmask(i,2),cas_bitmask(i,1,1)) + reunion_of_core_inact_act_bitmask(i,2) = ior(reunion_of_core_inact_bitmask(i,2),cas_bitmask(i,2,1)) n_core_inact_act_orb +=popcnt(reunion_of_core_inact_act_bitmask(i,1)) enddo END_PROVIDER diff --git a/src/Davidson/davidson_parallel.irp.f b/src/Davidson/davidson_parallel.irp.f index ce6d670a..15eede23 100644 --- a/src/Davidson/davidson_parallel.irp.f +++ b/src/Davidson/davidson_parallel.irp.f @@ -403,8 +403,8 @@ BEGIN_PROVIDER [ integer, nthreads_davidson ] call getenv('NTHREADS_DAVIDSON',env) if (trim(env) /= '') then read(env,*) nthreads_davidson + call write_int(6,nthreads_davidson,'Number of threads for ') endif - call write_int(6,nthreads_davidson,'Number of threads for Diagonalization') END_PROVIDER diff --git a/src/Davidson/diagonalization_hs2_dressed.irp.f b/src/Davidson/diagonalization_hs2_dressed.irp.f index 59e9c9fe..491ddea7 100644 --- a/src/Davidson/diagonalization_hs2_dressed.irp.f +++ b/src/Davidson/diagonalization_hs2_dressed.irp.f @@ -35,7 +35,7 @@ subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_d double precision, intent(inout) :: u_in(dim_in,N_st_diag) double precision, intent(out) :: energies(N_st_diag), s2_out(N_st_diag) integer, intent(in) :: dressing_state - double precision, allocatable :: H_jj(:), S2_jj(:) + double precision, allocatable :: H_jj(:) double precision, external :: diag_H_mat_elem, diag_S_mat_elem integer :: i,k @@ -44,7 +44,7 @@ subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_d ASSERT (Nint > 0) ASSERT (Nint == N_int) PROVIDE mo_bielec_integrals_in_map - allocate(H_jj(sze),S2_jj(sze)) + allocate(H_jj(sze)) H_jj(1) = diag_h_mat_elem(dets_in(1,1,1),Nint) !$OMP PARALLEL DEFAULT(NONE) & @@ -60,17 +60,32 @@ subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_d if (dressing_state > 0) then do k=1,N_st do i=1,sze - H_jj(i) += u_in(i,k) * dressing_column_h(i,k) + H_jj(i) += u_in(i,k) * dressing_column_h(i,k) enddo enddo endif - call davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state) - deallocate (H_jj,S2_jj) + integer :: N_st_diag_local + double precision, allocatable :: energies_local(:), s2_out_local(:), u_in_local(:,:) + logical :: converged + converged = .False. + call davidson_diag_hjj_sjj(dets_in,u_in,H_jj,S2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state,converged) + N_st_diag_local = N_st_diag + do while (.not.converged) + N_st_diag_local = 2 * N_st_diag_local + allocate (energies_local(N_st_diag_local), s2_out_local(N_st_diag_local), u_in_local(sze,N_st_diag_local)) + u_in_local(1:sze,1:N_st_diag) = u_in(1:sze,1:N_st_diag) + call davidson_diag_hjj_sjj(dets_in,u_in_local,H_jj,s2_out_local,energies_local,dim_in,sze,N_st,N_st_diag_local,Nint,dressing_state,converged) + energies(1:N_st_diag) = energies_local(1:N_st_diag) + s2_out(1:N_st_diag) = s2_out_local(1:N_st_diag) + u_in(1:sze,1:N_st_diag) = u_in_local(1:sze,1:N_st_diag) + deallocate (energies_local, s2_out_local, u_in_local) + enddo + deallocate (H_jj) end -subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state) +subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state,converged) use bitmasks implicit none BEGIN_DOC @@ -105,13 +120,13 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_ integer :: iter integer :: i,j,k,l,m - logical :: converged + logical, intent(inout) :: converged double precision, external :: u_dot_v, u_dot_u integer :: k_pairs, kl - integer :: iter2 + integer :: iter2, itertot double precision, allocatable :: W(:,:), U(:,:), S(:,:), overlap(:,:) double precision, allocatable :: y(:,:), h(:,:), lambda(:), s2(:) double precision, allocatable :: c(:), s_(:,:), s_tmp(:,:) @@ -123,6 +138,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_ integer :: shift, shift2, itermax, istate double precision :: r1, r2 logical :: state_ok(N_st_diag*davidson_sze_max) + integer :: nproc_target include 'constants.include.F' !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: U, W, S, y, h, lambda @@ -133,6 +149,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_ endif itermax = max(3,min(davidson_sze_max, sze/N_st_diag)) + itertot = 0 PROVIDE nuclear_repulsion expected_s2 psi_bilinear_matrix_order psi_bilinear_matrix_order_reverse @@ -146,8 +163,22 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_ call write_int(6,N_st,'Number of states') call write_int(6,N_st_diag,'Number of states in diagonalization') call write_int(6,sze,'Number of determinants') + nproc_target = nproc r1 = 8.d0*(3.d0*dble(sze*N_st_diag*itermax+5.d0*(N_st_diag*itermax)**2 & - + 4.d0*(N_st_diag*itermax)+nproc*(4.d0*N_det_alpha_unique+2.d0*N_st_diag*sze)))/(1024.d0**3) + + 3.d0*(N_st_diag*itermax)+nproc*(4.d0*N_det_alpha_unique+2.d0*N_st_diag*sze)))/(1024.d0**3) + if (qp_max_mem > 0) then + do while (r1 > qp_max_mem) + nproc_target = nproc_target - 1 + r1 = 8.d0*(3.d0*dble(sze*N_st_diag*itermax+5.d0*(N_st_diag*itermax)**2 & + + 3.d0*(N_st_diag*itermax)+nproc_target*(4.d0*N_det_alpha_unique+2.d0*N_st_diag*sze)))/(1024.d0**3) + if (nproc_target == 0) then + nproc_target = 1 + exit + endif + enddo + call omp_set_num_threads(nproc_target) + call write_int(6,nproc_target,'Number of threads for diagonalization') + endif call write_double(6, r1, 'Memory(Gb)') write(6,'(A)') '' write_buffer = '=====' @@ -220,7 +251,11 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_ do while (.not.converged) - + itertot = itertot+1 + if (itertot == 8) then + exit + endif + do k=1,N_st_diag do i=1,sze U(i,k) = u_in(i,k) @@ -492,6 +527,7 @@ subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_ y, s_, s_tmp, & lambda & ) + call omp_set_num_threads(nproc) end diff --git a/src/Davidson/u0Hu0.irp.f b/src/Davidson/u0Hu0.irp.f index 3e5610c8..38e3f293 100644 --- a/src/Davidson/u0Hu0.irp.f +++ b/src/Davidson/u0Hu0.irp.f @@ -28,6 +28,7 @@ subroutine H_S2_u_0_nstates_openmp(v_0,s_0,u_0,N_st,sze) double precision, allocatable :: u_t(:,:), v_t(:,:), s_t(:,:) !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: u_t allocate(u_t(N_st,N_det),v_t(N_st,N_det),s_t(N_st,N_det)) + do k=1,N_st call dset_order(u_0(1,k),psi_bilinear_matrix_order,N_det) enddo diff --git a/src/Determinants/EZFIO.cfg b/src/Determinants/EZFIO.cfg index c86f831d..ecf3dd88 100644 --- a/src/Determinants/EZFIO.cfg +++ b/src/Determinants/EZFIO.cfg @@ -40,6 +40,13 @@ doc: Force the wave function to be an eigenfunction of S^2 interface: ezfio,provider,ocaml default: True +[used_weight] +type: integer +doc: 0: 1/(c_0^2), 1: 1/N_states, 2: input state-average weight, 3: 1/(Norm_L3(Psi)) +interface: ezfio,provider,ocaml +default: 0 + + [threshold_generators] type: Threshold doc: Thresholds on generators (fraction of the norm) diff --git a/src/Determinants/Fock_diag.irp.f b/src/Determinants/Fock_diag.irp.f index 01393fe1..396926c9 100644 --- a/src/Determinants/Fock_diag.irp.f +++ b/src/Determinants/Fock_diag.irp.f @@ -21,10 +21,19 @@ subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint) if (Ne(1) /= elec_alpha_num) then print *, 'Error in build_fock_tmp (alpha)', Ne(1), Ne(2) + call debug_det(det_ref,N_int) +! print *, occ(:,1) +! print *, occ(:,2) +! do i=1,10000 +! occ(i,1) = fock_diag_tmp(1,mo_tot_num+i) !traceback +! enddo stop -1 endif if (Ne(2) /= elec_beta_num) then - print *, 'Error in build_fock_tmp (beta)', Ne(1), Ne(2) +! print *, 'Error in build_fock_tmp (beta)', Ne(1), Ne(2) +! do i=1,10000 +! occ(i,1) = fock_diag_tmp(1,mo_tot_num+i) !traceback +! enddo stop -1 endif diff --git a/src/Determinants/density_matrix.irp.f b/src/Determinants/density_matrix.irp.f index bd5f0741..c7afebc6 100644 --- a/src/Determinants/density_matrix.irp.f +++ b/src/Determinants/density_matrix.irp.f @@ -347,7 +347,8 @@ subroutine set_natural_mos double precision, allocatable :: tmp(:,:) label = "Natural" - call mo_as_svd_vectors_of_mo_matrix(one_body_dm_mo,size(one_body_dm_mo,1),mo_tot_num,mo_tot_num,label) + call mo_as_svd_vectors_of_mo_matrix_eig(one_body_dm_mo,size(one_body_dm_mo,1),mo_tot_num,mo_tot_num,mo_occ,label) + soft_touch mo_occ end subroutine save_natural_mos @@ -361,6 +362,57 @@ subroutine save_natural_mos end +BEGIN_PROVIDER [ double precision, l3_weight, (N_states) ] + implicit none + BEGIN_DOC + ! Weight of the states in the selection : 1/(sum_i |c_i|^3) + END_DOC + integer :: i,k + double precision :: c + do i=1,N_states + l3_weight(i) = 1.d-31 + do k=1,N_det + c = psi_coef(k,i)*psi_coef(k,i) + l3_weight(i) = l3_weight(i) + c*abs(psi_coef(k,i)) + enddo + l3_weight(i) = min(1.d0/l3_weight(i), 100.d0) + enddo + if (mpi_master) then + print *, '' + print *, 'L3 weights' + print *, '----------' + print *, '' + print *, l3_weight(1:N_states) + print *, '' + endif + +END_PROVIDER + +BEGIN_PROVIDER [ double precision, c0_weight, (N_states) ] + implicit none + BEGIN_DOC + ! Weight of the states in the selection : 1/c_0^2 + END_DOC + integer :: i,k + double precision :: c + do i=1,N_states + c0_weight(i) = 1.d-31 + c = maxval(psi_coef(:,i) * psi_coef(:,i)) + c0_weight(i) = 1.d0/c + c0_weight(i) = min(c0_weight(i), 100.d0) + enddo + if (mpi_master) then + print *, '' + print *, 'c0 weights' + print *, '----------' + print *, '' + print *, c0_weight(1:N_states) + print *, '' + endif + +END_PROVIDER + + BEGIN_PROVIDER [ double precision, state_average_weight, (N_states) ] implicit none BEGIN_DOC @@ -369,9 +421,17 @@ BEGIN_PROVIDER [ double precision, state_average_weight, (N_states) ] logical :: exists state_average_weight(:) = 1.d0 - call ezfio_has_determinants_state_average_weight(exists) - if (exists) then - call ezfio_get_determinants_state_average_weight(state_average_weight) + if (used_weight == 0) then + state_average_weight(:) = c0_weight(:) + else if (used_weight == 1) then + state_average_weight(:) = 1./N_states + else if (used_weight == 3) then + state_average_weight(:) = l3_weight + else + call ezfio_has_determinants_state_average_weight(exists) + if (exists) then + call ezfio_get_determinants_state_average_weight(state_average_weight) + endif endif state_average_weight(:) = state_average_weight(:)+1.d-31 state_average_weight(:) = state_average_weight(:)/(sum(state_average_weight(:))) diff --git a/src/Determinants/determinants.irp.f b/src/Determinants/determinants.irp.f index 8530fa64..3db76eef 100644 --- a/src/Determinants/determinants.irp.f +++ b/src/Determinants/determinants.irp.f @@ -321,21 +321,24 @@ end subroutine END_DOC call sort_dets_by_det_search_key(N_det, psi_det, psi_coef, & - psi_det_sorted_bit, psi_coef_sorted_bit) + psi_det_sorted_bit, psi_coef_sorted_bit, N_states) END_PROVIDER -subroutine sort_dets_by_det_search_key(Ndet, det_in, coef_in, det_out, coef_out) +subroutine sort_dets_by_det_search_key(Ndet, det_in, coef_in, det_out, coef_out, N_st) use bitmasks implicit none - integer, intent(in) :: Ndet + integer, intent(in) :: Ndet, N_st integer(bit_kind), intent(in) :: det_in (N_int,2,psi_det_size) - double precision , intent(in) :: coef_in(psi_det_size,N_states) + double precision , intent(in) :: coef_in(psi_det_size,N_st) integer(bit_kind), intent(out) :: det_out (N_int,2,psi_det_size) - double precision , intent(out) :: coef_out(psi_det_size,N_states) + double precision , intent(out) :: coef_out(psi_det_size,N_st) BEGIN_DOC ! Determinants are sorted are sorted according to their det_search_key. ! Useful to accelerate the search of a random determinant in the wave ! function. + ! + ! /!\ The first dimension of coef_out and coef_in need to be psi_det_size + ! END_DOC integer :: i,j,k integer, allocatable :: iorder(:) @@ -356,7 +359,7 @@ subroutine sort_dets_by_det_search_key(Ndet, det_in, coef_in, det_out, coef_out) det_out(j,1,i) = det_in(j,1,iorder(i)) det_out(j,2,i) = det_in(j,2,iorder(i)) enddo - do k=1,N_states + do k=1,N_st coef_out(i,k) = coef_in(iorder(i),k) enddo enddo @@ -451,6 +454,26 @@ end +subroutine save_wavefunction_truncated(thr) + implicit none + double precision, intent(in) :: thr + use bitmasks + BEGIN_DOC + ! Save the wave function into the EZFIO file + END_DOC + integer :: N_det_save,i + N_det_save = N_det + do i=1,N_det + if (psi_average_norm_contrib_sorted(i) < thr) then + N_det_save = i + exit + endif + enddo + if (mpi_master) then + call save_wavefunction_general(N_det_save,min(N_states,N_det_save),psi_det_sorted,size(psi_coef_sorted,1),psi_coef_sorted) + endif +end + subroutine save_wavefunction implicit none use bitmasks @@ -718,6 +741,7 @@ subroutine apply_excitation(det, exc, res, ok, Nint) case default print *, degree print *, "apply ex" +! print *, 1.d0/0.d0 ! For traceback STOP end select ! END INLINE diff --git a/src/Determinants/psi_cas.irp.f b/src/Determinants/psi_cas.irp.f index 591843f7..58a71fbc 100644 --- a/src/Determinants/psi_cas.irp.f +++ b/src/Determinants/psi_cas.irp.f @@ -54,7 +54,7 @@ END_PROVIDER ! function. END_DOC call sort_dets_by_det_search_key(N_det_cas, psi_cas, psi_cas_coef, & - psi_cas_sorted_bit, psi_cas_coef_sorted_bit) + psi_cas_sorted_bit, psi_cas_coef_sorted_bit, N_states) END_PROVIDER @@ -107,7 +107,7 @@ END_PROVIDER ! function. END_DOC call sort_dets_by_det_search_key(N_det_cas, psi_non_cas, psi_non_cas_coef, & - psi_non_cas_sorted_bit, psi_non_cas_coef_sorted_bit) + psi_non_cas_sorted_bit, psi_non_cas_coef_sorted_bit, N_states) END_PROVIDER diff --git a/src/Determinants/s2.irp.f b/src/Determinants/s2.irp.f index 1df4721e..95339664 100644 --- a/src/Determinants/s2.irp.f +++ b/src/Determinants/s2.irp.f @@ -189,8 +189,8 @@ subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8) allocate(vt(sze_8,N_st)) vt = 0.d0 - !$OMP DO SCHEDULE(dynamic) do sh=1,shortcut(0,1) + !$OMP DO SCHEDULE(static,1) do sh2=sh,shortcut(0,1) exa = 0 do ni=1,Nint @@ -227,11 +227,11 @@ subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8) enddo enddo enddo + !$OMP END DO NOWAIT enddo - !$OMP END DO NOWAIT - !$OMP DO SCHEDULE(dynamic) do sh=1,shortcut(0,2) + !$OMP DO do i=shortcut(sh,2),shortcut(sh+1,2)-1 org_i = sort_idx(i,2) do j=shortcut(sh,2),i-1 @@ -249,8 +249,9 @@ subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8) end if end do end do + !$OMP END DO NOWAIT enddo - !$OMP END DO NOWAIT + !$OMP BARRIER do istate=1,N_st do i=n,1,-1 diff --git a/src/Determinants/slater_rules.irp.f b/src/Determinants/slater_rules.irp.f index 7df79f42..2d42e849 100644 --- a/src/Determinants/slater_rules.irp.f +++ b/src/Determinants/slater_rules.irp.f @@ -639,11 +639,12 @@ subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) select case (degree) case (2) call get_double_excitation(key_i,key_j,exc,phase,Nint) - + ! Mono alpha, mono beta if (exc(0,1,1) == 1) then - ! Mono alpha, mono beta + if ( (exc(1,1,1) == exc(1,2,2)).and.(exc(1,1,2) == exc(1,2,1)) ) then + s2 = -phase + endif if(exc(1,1,1) == exc(1,2,2) )then - if(exc(1,1,2) == exc(1,2,1)) s2 = -phase !!!!! hij = phase * big_array_exchange_integrals(exc(1,1,1),exc(1,1,2),exc(1,2,1)) else if (exc(1,2,1) ==exc(1,1,2))then hij = phase * big_array_exchange_integrals(exc(1,2,1),exc(1,1,1),exc(1,2,2)) @@ -654,8 +655,8 @@ subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) exc(1,2,1), & exc(1,2,2) ,mo_integrals_map) endif + ! Double alpha else if (exc(0,1,1) == 2) then - ! Double alpha hij = phase*(get_mo_bielec_integral( & exc(1,1,1), & exc(2,1,1), & @@ -666,8 +667,8 @@ subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) exc(2,1,1), & exc(2,2,1), & exc(1,2,1) ,mo_integrals_map) ) + ! Double beta else if (exc(0,1,2) == 2) then - ! Double beta hij = phase*(get_mo_bielec_integral( & exc(1,1,2), & exc(2,1,2), & @@ -683,13 +684,13 @@ subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) call get_mono_excitation(key_i,key_j,exc,phase,Nint) !DIR$ FORCEINLINE call bitstring_to_list_ab(key_i, occ, n_occ_ab, Nint) + ! Mono alpha if (exc(0,1,1) == 1) then - ! Mono alpha m = exc(1,1,1) p = exc(1,2,1) spin = 1 + ! Mono beta else - ! Mono beta m = exc(1,1,2) p = exc(1,2,2) spin = 2 @@ -697,7 +698,6 @@ subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) call get_mono_excitation_from_fock(key_i,key_j,p,m,spin,phase,hij) case (0) - print *," ZERO" double precision, external :: diag_S_mat_elem s2 = diag_S_mat_elem(key_i,Nint) hij = diag_H_mat_elem(key_i,Nint) diff --git a/src/Determinants/spindeterminants.irp.f b/src/Determinants/spindeterminants.irp.f index 136872b4..9a39212c 100644 --- a/src/Determinants/spindeterminants.irp.f +++ b/src/Determinants/spindeterminants.irp.f @@ -367,13 +367,13 @@ end j = psi_bilinear_matrix_columns(k) f = 0.d0 do l=1,N_states - f += psi_bilinear_matrix_values(k,l)*psi_bilinear_matrix_values(k,l) + f += psi_bilinear_matrix_values(k,l)*psi_bilinear_matrix_values(k,l) * state_average_weight(l) enddo det_alpha_norm(i) += f det_beta_norm(j) += f enddo - det_alpha_norm = det_alpha_norm / dble(N_states) - det_beta_norm = det_beta_norm / dble(N_states) + det_alpha_norm = det_alpha_norm + det_beta_norm = det_beta_norm END_PROVIDER @@ -649,7 +649,7 @@ subroutine create_wf_of_psi_bilinear_matrix(truncate) do k=1,N_states psi_coef_sorted_bit(idx,k) = psi_bilinear_matrix(i,j,k) !$OMP ATOMIC - norm(k) += psi_bilinear_matrix(i,j,k) + norm(k) += psi_bilinear_matrix(i,j,k)*psi_bilinear_matrix(i,j,k) enddo endif enddo @@ -671,7 +671,10 @@ subroutine create_wf_of_psi_bilinear_matrix(truncate) do i=1,N_det norm(1) += psi_average_norm_contrib_sorted(i) if (truncate) then - if (norm(1) >= 0.999999d0) then + if (norm(1) >= 1.d0) then + exit + endif + if (psi_average_norm_contrib_sorted(i) == 0.d0) then exit endif endif diff --git a/src/Determinants/zmq.irp.f b/src/Determinants/zmq.irp.f index 5e42cff5..e8edc1a8 100644 --- a/src/Determinants/zmq.irp.f +++ b/src/Determinants/zmq.irp.f @@ -304,7 +304,7 @@ integer function zmq_get_psi_det(zmq_to_qp_run_socket, worker_id) if (ierr /= MPI_SUCCESS) then stop 'Unable to broadcast zmq_get_psi_det' endif - call broadcast_chunks_bit_kind(psi_det,N_det*N_int*2) + call broadcast_chunks_bit_kind(psi_det,size(psi_det)) IRP_ENDIF end @@ -353,7 +353,7 @@ integer function zmq_get_psi_coef(zmq_to_qp_run_socket, worker_id) if (ierr /= MPI_SUCCESS) then stop 'Unable to broadcast zmq_get_psi_coef' endif - call broadcast_chunks_double(psi_coef,N_states*N_det) + call broadcast_chunks_double(psi_coef,size(psi_coef)) IRP_ENDIF end diff --git a/src/Integrals_Bielec/map_integrals.irp.f b/src/Integrals_Bielec/map_integrals.irp.f index 7d1714b0..2fd057b4 100644 --- a/src/Integrals_Bielec/map_integrals.irp.f +++ b/src/Integrals_Bielec/map_integrals.irp.f @@ -100,7 +100,7 @@ subroutine bielec_integrals_index_reverse(i,j,k,l,i1) call bielec_integrals_index(i(ii),j(ii),k(ii),l(ii),i2) if (i1 /= i2) then print *, i1, i2 - print *, i(ii), j(jj), k(jj), l(jj) + print *, i(ii), j(ii), k(ii), l(ii) stop 'bielec_integrals_index_reverse failed' endif endif @@ -421,8 +421,8 @@ double precision function mo_bielec_integral(i,j,k,l) integer, intent(in) :: i,j,k,l double precision :: get_mo_bielec_integral PROVIDE mo_bielec_integrals_in_map mo_integrals_cache - !DIR$ FORCEINLINE PROVIDE mo_bielec_integrals_in_map + !DIR$ FORCEINLINE mo_bielec_integral = get_mo_bielec_integral(i,j,k,l,mo_integrals_map) return end @@ -438,24 +438,45 @@ subroutine get_mo_bielec_integrals(j,k,l,sze,out_val,map) double precision, intent(out) :: out_val(sze) type(map_type), intent(inout) :: map integer :: i - integer(key_kind) :: hash(sze) - real(integral_kind) :: tmp_val(sze) - PROVIDE mo_bielec_integrals_in_map + double precision, external :: get_mo_bielec_integral + PROVIDE mo_bielec_integrals_in_map mo_integrals_cache + integer :: ii, ii0 + integer*8 :: ii_8, ii0_8 + real(integral_kind) :: tmp + integer(key_kind) :: i1, idx + integer(key_kind) :: p,q,r,s,i2 + PROVIDE mo_bielec_integrals_in_map mo_integrals_cache + + ii0 = l-mo_integrals_cache_min + ii0 = ior(ii0, k-mo_integrals_cache_min) + ii0 = ior(ii0, j-mo_integrals_cache_min) + + ii0_8 = int(l,8)-mo_integrals_cache_min_8 + ii0_8 = ior( ishft(ii0_8,7), int(k,8)-mo_integrals_cache_min_8) + ii0_8 = ior( ishft(ii0_8,7), int(j,8)-mo_integrals_cache_min_8) + + q = min(j,l) + s = max(j,l) + q = q+ishft(s*s-s,-1) + do i=1,sze - !DIR$ FORCEINLINE - call bielec_integrals_index(i,j,k,l,hash(i)) + ii = ior(ii0, i-mo_integrals_cache_min) + if (iand(ii, -128) == 0) then + ii_8 = ior( ishft(ii0_8,7), int(i,8)-mo_integrals_cache_min_8) + out_val(i) = mo_integrals_cache(ii_8) + else + p = min(i,k) + r = max(i,k) + p = p+ishft(r*r-r,-1) + i1 = min(p,q) + i2 = max(p,q) + idx = i1+ishft(i2*i2-i2,-1) + !DIR$ FORCEINLINE + call map_get(map,idx,tmp) + out_val(i) = dble(tmp) + endif enddo - - if (key_kind == 8) then - call map_get_many(map, hash, out_val, sze) - else - call map_get_many(map, hash, tmp_val, sze) - ! Conversion to double precision - do i=1,sze - out_val(i) = dble(tmp_val(i)) - enddo - endif end subroutine get_mo_bielec_integrals_ij(k,l,sze,out_array,map) @@ -534,7 +555,7 @@ subroutine get_mo_bielec_integrals_coulomb_ii(k,l,sze,out_val,map) call bielec_integrals_index(k,i,l,i,hash(i)) enddo - if (key_kind == 8) then + if (integral_kind == 8) then call map_get_many(map, hash, out_val, sze) else call map_get_many(map, hash, tmp_val, sze) @@ -567,7 +588,7 @@ subroutine get_mo_bielec_integrals_exch_ii(k,l,sze,out_val,map) call bielec_integrals_index(k,i,i,l,hash(i)) enddo - if (key_kind == 8) then + if (integral_kind == 8) then call map_get_many(map, hash, out_val, sze) else call map_get_many(map, hash, tmp_val, sze) diff --git a/src/Integrals_Bielec/mo_bi_integrals.irp.f b/src/Integrals_Bielec/mo_bi_integrals.irp.f index 9d884456..e7fb815a 100644 --- a/src/Integrals_Bielec/mo_bi_integrals.irp.f +++ b/src/Integrals_Bielec/mo_bi_integrals.irp.f @@ -240,7 +240,7 @@ subroutine add_integrals_to_map(mask_ijkl) call bitstring_to_list( mask_ijkl(1,3), list_ijkl(1,3), n_k, N_int ) call bitstring_to_list( mask_ijkl(1,4), list_ijkl(1,4), n_l, N_int ) character*(2048) :: output(1) - print*, 'i' + print *, 'i' call bitstring_to_str( output(1), mask_ijkl(1,1), N_int ) print *, trim(output(1)) j = 0 diff --git a/src/Integrals_Bielec/qp_ao_ints.irp.f b/src/Integrals_Bielec/qp_ao_ints.irp.f index 93f62a7d..f499c848 100644 --- a/src/Integrals_Bielec/qp_ao_ints.irp.f +++ b/src/Integrals_Bielec/qp_ao_ints.irp.f @@ -1,10 +1,16 @@ program qp_ao_ints use omp_lib implicit none + IRP_IF MPI + include 'mpif.h' + IRP_ENDIF + integer :: ierr + BEGIN_DOC ! Increments a running calculation to compute AO integrals END_DOC integer :: i + PROVIDE zmq_context mpi_master zmq_state zmq_context call switch_qp_run_to_master @@ -17,15 +23,27 @@ program qp_ao_ints double precision :: integral, ao_bielec_integral integral = ao_bielec_integral(1,1,1,1) - character*(64) :: state - call wait_for_state(zmq_state,state) - do while (state /= 'Stopped') + do + call wait_for_state('ao_integrals',zmq_state) + if (zmq_state(1:7) == 'Stopped') then + exit + endif + !$OMP PARALLEL DEFAULT(PRIVATE) PRIVATE(i) i = omp_get_thread_num() call ao_bielec_integrals_in_map_slave_tcp(i) !$OMP END PARALLEL - call wait_for_state(zmq_state,state) + IRP_IF MPI + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here, 'error in barrier' + endif + IRP_ENDIF + enddo + IRP_IF MPI + call MPI_finalize(i) + IRP_ENDIF print *, 'Done' end diff --git a/src/MO_Basis/ao_ortho_canonical.irp.f b/src/MO_Basis/ao_ortho_canonical.irp.f index 5d01efb9..1cc3444e 100644 --- a/src/MO_Basis/ao_ortho_canonical.irp.f +++ b/src/MO_Basis/ao_ortho_canonical.irp.f @@ -2,9 +2,7 @@ &BEGIN_PROVIDER [ integer, ao_cart_to_sphe_num ] implicit none BEGIN_DOC -! matrix of the coefficients of the mos generated by the -! orthonormalization by the S^{-1/2} canonical transformation of the aos -! ao_cart_to_sphe_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_canonical orbital +! ao_cart_to_sphe coefficients of the current basis set END_DOC integer :: i integer, external :: ao_power_index diff --git a/src/MO_Basis/utils.irp.f b/src/MO_Basis/utils.irp.f index 212d2b6f..3882aae4 100644 --- a/src/MO_Basis/utils.irp.f +++ b/src/MO_Basis/utils.irp.f @@ -112,6 +112,7 @@ subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label) double precision, intent(in) :: matrix(lda,n) integer :: i,j + double precision :: accu double precision, allocatable :: mo_coef_new(:,:), U(:,:),D(:), A(:,:), Vt(:,:), work(:) !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: mo_coef_new, U, Vt, A @@ -137,12 +138,16 @@ subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label) write (6,'(A)') 'Eigenvalues' write (6,'(A)') '-----------' write (6,'(A)') '' - write (6,'(A)') '======== ================' + write (6,'(A)') '======== ================ ================' + write (6,'(A)') ' MO Eigenvalue Cumulative ' + write (6,'(A)') '======== ================ ================' + accu = 0.d0 do i=1,m - write (6,'(I8,1X,F16.10)') i,D(i) + accu = accu + D(i) + write (6,'(I8,1X,F16.10,1X,F16.10)') i,D(i), accu enddo - write (6,'(A)') '======== ================' + write (6,'(A)') '======== ================ ================' write (6,'(A)') '' call dgemm('N','N',ao_num,m,m,1.d0,mo_coef_new,size(mo_coef_new,1),U,size(U,1),0.d0,mo_coef,size(mo_coef,1)) @@ -152,6 +157,65 @@ subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label) mo_label = label end +subroutine mo_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,eig,label) + implicit none + integer,intent(in) :: lda,m,n + character*(64), intent(in) :: label + double precision, intent(in) :: matrix(lda,n) + double precision, intent(out) :: eig(m) + + integer :: i,j + double precision :: accu + double precision, allocatable :: mo_coef_new(:,:), U(:,:),D(:), A(:,:), Vt(:,:), work(:) + !DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: mo_coef_new, U, Vt, A + + call write_time(6) + if (m /= mo_tot_num) then + print *, irp_here, ': Error : m/= mo_tot_num' + stop 1 + endif + + allocate(A(lda,n),U(lda,n),mo_coef_new(ao_num,m),D(m),Vt(lda,n)) + + do j=1,n + do i=1,m + A(i,j) = matrix(i,j) + enddo + enddo + mo_coef_new = mo_coef + + call svd(A,lda,U,lda,D,Vt,lda,m,n) + + write (6,'(A)') 'MOs are now **'//trim(label)//'**' + write (6,'(A)') '' + write (6,'(A)') 'Eigenvalues' + write (6,'(A)') '-----------' + write (6,'(A)') '' + write (6,'(A)') '======== ================ ================' + write (6,'(A)') ' MO Eigenvalue Cumulative ' + write (6,'(A)') '======== ================ ================' + + accu = 0.d0 + do i=1,m + accu = accu + D(i) + write (6,'(I8,1X,F16.10,1X,F16.10)') i,D(i), accu + enddo + write (6,'(A)') '======== ================ ================' + write (6,'(A)') '' + + call dgemm('N','N',ao_num,m,m,1.d0,mo_coef_new,size(mo_coef_new,1),U,size(U,1),0.d0,mo_coef,size(mo_coef,1)) + + do i=1,m + eig(i) = D(i) + enddo + + deallocate(A,mo_coef_new,U,Vt,D) + call write_time(6) + + mo_label = label + +end + subroutine mo_as_eigvectors_of_mo_matrix_sort_by_observable(matrix,observable,n,m,label) implicit none integer,intent(in) :: n,m diff --git a/src/Utils/fortran_mmap.c b/src/Utils/fortran_mmap.c index 41ad93ec..4ecffe56 100644 --- a/src/Utils/fortran_mmap.c +++ b/src/Utils/fortran_mmap.c @@ -33,7 +33,7 @@ void* mmap_fortran(char* filename, size_t bytes, int* file_descr, int read_only) exit(EXIT_FAILURE); } - result = lseek(fd, bytes, SEEK_SET); + result = lseek(fd, bytes+1, SEEK_SET); if (result == -1) { close(fd); printf("%s:\n", filename); diff --git a/src/Utils/map_functions.irp.f b/src/Utils/map_functions.irp.f index c7ea6938..bb82243e 100644 --- a/src/Utils/map_functions.irp.f +++ b/src/Utils/map_functions.irp.f @@ -9,6 +9,9 @@ subroutine map_save_to_disk(filename,map) integer*8 :: i,k integer :: j + integer*8 :: n_elements + n_elements = int(map % n_elements,8) + if (map % consolidated) then stop 'map already consolidated' @@ -17,11 +20,11 @@ subroutine map_save_to_disk(filename,map) call mmap(trim(filename)//'_consolidated_idx', (/ map % map_size + 2_8 /), 8, fd(1), .False., c_pointer(1)) call c_f_pointer(c_pointer(1),map % consolidated_idx, (/ map % map_size +2_8/)) - call mmap(trim(filename)//'_consolidated_key', (/ map % n_elements /), cache_key_kind, fd(2), .False., c_pointer(2)) - call c_f_pointer(c_pointer(2),map % consolidated_key, (/ map % n_elements /)) + call mmap(trim(filename)//'_consolidated_key', (/ n_elements /), cache_key_kind, fd(2), .False., c_pointer(2)) + call c_f_pointer(c_pointer(2),map % consolidated_key, (/ n_elements /)) - call mmap(trim(filename)//'_consolidated_value', (/ map % n_elements /), integral_kind, fd(3), .False., c_pointer(3)) - call c_f_pointer(c_pointer(3),map % consolidated_value, (/ map % n_elements /)) + call mmap(trim(filename)//'_consolidated_value', (/ n_elements /), integral_kind, fd(3), .False., c_pointer(3)) + call c_f_pointer(c_pointer(3),map % consolidated_value, (/ n_elements /)) if (.not.associated(map%consolidated_key)) then stop 'cannot consolidate map : consolidated_key not associated' @@ -38,7 +41,7 @@ subroutine map_save_to_disk(filename,map) call map_sort(map) k = 1_8 do i=0_8, map % map_size - map % consolidated_idx (i+1) = k + map % consolidated_idx (i+1_8) = k do j=1, map % map(i) % n_elements map % consolidated_value(k) = map % map(i) % value(j) map % consolidated_key (k) = map % map(i) % key(j) @@ -46,15 +49,12 @@ subroutine map_save_to_disk(filename,map) enddo deallocate(map % map(i) % value) deallocate(map % map(i) % key) - map % map(i) % value => map % consolidated_value ( map % consolidated_idx (i+1_8) :) - map % map(i) % key => map % consolidated_key ( map % consolidated_idx (i+1_8) :) + map % map(i) % value => map % consolidated_value ( map % consolidated_idx (i+1_8) : k-1) + map % map(i) % key => map % consolidated_key ( map % consolidated_idx (i+1_8) : k-1) enddo map % consolidated_idx (map % map_size + 2_8) = k map % consolidated = .True. - integer*8 :: n_elements - n_elements = int(map % n_elements,8) - print *, 'Writing data to disk...' call msync ( (/ map % map_size + 2_8 /), 8, fd(1), c_pointer(1)) call msync ( (/ n_elements /), cache_key_kind, fd(2), c_pointer(2)) @@ -74,6 +74,8 @@ subroutine map_load_from_disk(filename,map) integer :: fd(3) integer*8 :: i,k,l integer*4 :: j,n_elements + integer(cache_key_kind), pointer :: key_p(:) + real(integral_kind), pointer :: value_p(:) if (map % consolidated) then stop 'map already consolidated' @@ -96,21 +98,24 @@ subroutine map_load_from_disk(filename,map) do i=0_8, map % map_size deallocate(map % map(i) % value) deallocate(map % map(i) % key) - map % map(i) % value => map % consolidated_value ( map % consolidated_idx (i+1_8) :) - map % map(i) % key => map % consolidated_key ( map % consolidated_idx (i+1_8) :) - map % map(i) % sorted = .True. - n_elements = int( map % consolidated_idx (i+2_8) - k, 4) k = map % consolidated_idx (i+2_8) + l = map % consolidated_idx (i+1_8) + n_elements = int(k - l, 4) + key_p => map % consolidated_key (l:l+n_elements-1) + value_p => map % consolidated_value ( l:l+n_elements-1 ) + map % map(i) % key => key_p + map % map(i) % value => value_p + map % map(i) % sorted = .True. map % map(i) % map_size = n_elements map % map(i) % n_elements = n_elements ! Load memory from disk do j=1,n_elements - x = x + map % map(i) % value(j) - l = iand(l,int(map % map(i) % key(j),8)) - if (map % map(i) % value(j) > 1.e30) then + x = x + value_p(j) + l = iand(l,int(key_p(j),8)) + if (value_p(j) > 1.e30) then stop 'Error in integrals file' endif - if (map % map(i) % key(j) < 0) then + if (key_p(j) < 0) then stop 'Error in integrals file' endif enddo diff --git a/src/Utils/util.irp.f b/src/Utils/util.irp.f index e4b21f2e..9f4f2168 100644 --- a/src/Utils/util.irp.f +++ b/src/Utils/util.irp.f @@ -286,6 +286,23 @@ BEGIN_PROVIDER [ integer, nproc ] !$OMP END PARALLEL END_PROVIDER +BEGIN_PROVIDER [ integer, qp_max_mem ] + implicit none + BEGIN_DOC + ! Maximum memory in Gb + END_DOC + character*(128) :: env + + qp_max_mem = -1 + call getenv('QP_MAXMEM',env) + if (trim(env) /= '') then + read(env,*) qp_max_mem + call write_int(6,qp_max_mem,'Target maximum memory') + endif + + +END_PROVIDER + double precision function u_dot_v(u,v,sze) implicit none diff --git a/src/ZMQ/put_get.irp.f b/src/ZMQ/put_get.irp.f index 40d2e881..5269bd5e 100644 --- a/src/ZMQ/put_get.irp.f +++ b/src/ZMQ/put_get.irp.f @@ -2,7 +2,7 @@ integer function zmq_put_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_ use f77_zmq implicit none BEGIN_DOC -! Put the X vector on the qp_run scheduler +! Put a float vector on the qp_run scheduler END_DOC integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket integer, intent(in) :: worker_id @@ -40,7 +40,7 @@ integer function zmq_get_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_ use f77_zmq implicit none BEGIN_DOC -! Get psi_coef from the qp_run scheduler +! Get a float vector from the qp_run scheduler END_DOC integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket integer, intent(in) :: worker_id @@ -97,3 +97,102 @@ end +integer function zmq_put_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + use f77_zmq + implicit none + BEGIN_DOC +! Put a vector of integers on the qp_run scheduler + END_DOC + integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket + integer, intent(in) :: worker_id + character*(*) :: name + integer, intent(in) :: size_x + integer, intent(out) :: x(size_x) + integer :: rc + character*(256) :: msg + + zmq_put_ivector = 0 + + write(msg,'(A,1X,I8,1X,A200)') 'put_data '//trim(zmq_state), worker_id, name + rc = f77_zmq_send(zmq_to_qp_run_socket,trim(msg),len(trim(msg)),ZMQ_SNDMORE) + if (rc /= len(trim(msg))) then + zmq_put_ivector = -1 + return + endif + + rc = f77_zmq_send(zmq_to_qp_run_socket,x,size_x*4,0) + if (rc /= size_x*4) then + zmq_put_ivector = -1 + return + endif + + rc = f77_zmq_recv(zmq_to_qp_run_socket,msg,len(msg),0) + if (msg(1:rc) /= 'put_data_reply ok') then + zmq_put_ivector = -1 + return + endif + +end + + +integer function zmq_get_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + use f77_zmq + implicit none + BEGIN_DOC +! Get a vector of integers from the qp_run scheduler + END_DOC + integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket + integer, intent(in) :: worker_id + integer, intent(in) :: size_x + character*(*), intent(in) :: name + integer, intent(out) :: x(size_x) + integer :: rc + integer*8 :: rc8 + character*(256) :: msg + + PROVIDE zmq_state + ! Success + zmq_get_ivector = 0 + + if (mpi_master) then + write(msg,'(A,1X,I8,1X,A200)') 'get_data '//trim(zmq_state), worker_id, name + rc = f77_zmq_send(zmq_to_qp_run_socket,trim(msg),len(trim(msg)),0) + if (rc /= len(trim(msg))) then + zmq_get_ivector = -1 + go to 10 + endif + + rc = f77_zmq_recv(zmq_to_qp_run_socket,msg,len(msg),0) + if (msg(1:14) /= 'get_data_reply') then + zmq_get_ivector = -1 + go to 10 + endif + + rc = f77_zmq_recv(zmq_to_qp_run_socket,x,size_x*4,0) + if (rc /= size_x*4) then + zmq_get_ivector = -1 + go to 10 + endif + endif + + 10 continue + + IRP_IF MPI + integer :: ierr + include 'mpif.h' + call MPI_BCAST (zmq_get_ivector, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here//': Unable to broadcast zmq_get_ivector' + stop -1 + endif + call MPI_BCAST (x, size_x, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + print *, irp_here//': Unable to broadcast ivector' + stop -1 + endif + IRP_ENDIF + +end + + + diff --git a/src/ZMQ/utils.irp.f b/src/ZMQ/utils.irp.f index fac7470c..3fbc842b 100644 --- a/src/ZMQ/utils.irp.f +++ b/src/ZMQ/utils.irp.f @@ -148,12 +148,12 @@ function new_zmq_to_qp_run_socket() stop 'Unable to create zmq req socket' endif - rc = f77_zmq_setsockopt(new_zmq_to_qp_run_socket, ZMQ_SNDTIMEO, 30000, 4) + rc = f77_zmq_setsockopt(new_zmq_to_qp_run_socket, ZMQ_SNDTIMEO, 300000, 4) if (rc /= 0) then stop 'Unable to set send timeout in new_zmq_to_qp_run_socket' endif - rc = f77_zmq_setsockopt(new_zmq_to_qp_run_socket, ZMQ_RCVTIMEO, 30000, 4) + rc = f77_zmq_setsockopt(new_zmq_to_qp_run_socket, ZMQ_RCVTIMEO, 300000, 4) if (rc /= 0) then stop 'Unable to set recv timeout in new_zmq_to_qp_run_socket' endif @@ -188,25 +188,11 @@ function new_zmq_pair_socket(bind) endif -! rc = f77_zmq_setsockopt(new_zmq_pair_socket, ZMQ_SNDHWM, 2, 4) -! if (rc /= 0) then -! stop 'f77_zmq_setsockopt(new_zmq_pair_socket, ZMQ_SNDHWM, 2, 4)' -! endif -! -! rc = f77_zmq_setsockopt(new_zmq_pair_socket, ZMQ_RCVHWM, 2, 4) -! if (rc /= 0) then -! stop 'f77_zmq_setsockopt(new_zmq_pair_socket, ZMQ_RCVHWM, 2, 4)' -! endif -! rc = f77_zmq_setsockopt(new_zmq_pair_socket, ZMQ_IMMEDIATE, 1, 4) if (rc /= 0) then stop 'f77_zmq_setsockopt(new_zmq_pair_socket, ZMQ_IMMEDIATE, 1, 4)' endif -! -! rc = f77_zmq_setsockopt(new_zmq_pair_socket, ZMQ_LINGER, 600000, 4) -! if (rc /= 0) then -! stop 'f77_zmq_setsockopt(new_zmq_pair_socket, ZMQ_LINGER, 600000, 4)' -! endif + if (bind) then rc = f77_zmq_bind(new_zmq_pair_socket,zmq_socket_pair_inproc_address) @@ -250,7 +236,7 @@ IRP_ENDIF stop 'Unable to create zmq pull socket' endif - rc = f77_zmq_setsockopt(new_zmq_pull_socket,ZMQ_LINGER,30000,4) + rc = f77_zmq_setsockopt(new_zmq_pull_socket,ZMQ_LINGER,300000,4) if (rc /= 0) then stop 'Unable to set ZMQ_LINGER on pull socket' endif @@ -260,7 +246,7 @@ IRP_ENDIF ! stop 'Unable to set ZMQ_RCVBUF on pull socket' ! endif - rc = f77_zmq_setsockopt(new_zmq_pull_socket,ZMQ_RCVHWM,5,4) + rc = f77_zmq_setsockopt(new_zmq_pull_socket,ZMQ_RCVHWM,2,4) if (rc /= 0) then stop 'Unable to set ZMQ_RCVHWM on pull socket' endif @@ -332,12 +318,12 @@ IRP_ENDIF stop 'Unable to create zmq push socket' endif - rc = f77_zmq_setsockopt(new_zmq_push_socket,ZMQ_LINGER,30000,4) + rc = f77_zmq_setsockopt(new_zmq_push_socket,ZMQ_LINGER,300000,4) if (rc /= 0) then stop 'Unable to set ZMQ_LINGER on push socket' endif - rc = f77_zmq_setsockopt(new_zmq_push_socket,ZMQ_SNDHWM,5,4) + rc = f77_zmq_setsockopt(new_zmq_push_socket,ZMQ_SNDHWM,2,4) if (rc /= 0) then stop 'Unable to set ZMQ_SNDHWM on push socket' endif @@ -352,7 +338,7 @@ IRP_ENDIF stop 'Unable to set ZMQ_IMMEDIATE on push socket' endif - rc = f77_zmq_setsockopt(new_zmq_push_socket, ZMQ_SNDTIMEO, 30000, 4) + rc = f77_zmq_setsockopt(new_zmq_push_socket, ZMQ_SNDTIMEO, 300000, 4) if (rc /= 0) then stop 'Unable to set send timout in new_zmq_push_socket' endif @@ -488,9 +474,9 @@ subroutine end_zmq_push_socket(zmq_socket_push,thread) integer :: rc character*(8), external :: zmq_port - rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,30000,4) + rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,300000,4) if (rc /= 0) then - stop 'Unable to set ZMQ_LINGER on push socket' + print *, 'warning: Unable to set ZMQ_LINGER on push socket' endif call omp_set_lock(zmq_lock) @@ -615,7 +601,7 @@ subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) stop 'Wrong end of job' endif - do i=10,1,-1 + do i=3600,1,-1 rc = f77_zmq_send(zmq_to_qp_run_socket, 'end_job '//trim(zmq_state),8+len(trim(zmq_state)),0) rc = f77_zmq_recv(zmq_to_qp_run_socket, message, 512, 0) if (trim(message(1:13)) == 'error waiting') then @@ -626,6 +612,7 @@ subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) endif end do if (i==0) then + print *, '.. Forcing kill ..' rc = f77_zmq_send(zmq_to_qp_run_socket, 'end_job force',13,0) rc = f77_zmq_recv(zmq_to_qp_run_socket, message, 512, 0) endif @@ -685,6 +672,14 @@ integer function connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) connect_to_taskserver = -1 return endif + if (trim(state) /= zmq_state) then + integer, external :: disconnect_from_taskserver_state + if (disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_id, state) == -1) then + continue + endif + connect_to_taskserver = -1 + return + endif return 10 continue @@ -699,19 +694,32 @@ integer function disconnect_from_taskserver(zmq_to_qp_run_socket, worker_id) END_DOC integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket integer, intent(in) :: worker_id + integer, external :: disconnect_from_taskserver_state + disconnect_from_taskserver = disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_id, zmq_state(1:128)) +end + +integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_id, state) + use f77_zmq + implicit none + BEGIN_DOC + ! Disconnect from the task server + END_DOC + integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket + integer, intent(in) :: worker_id integer :: rc, sze - character*(512) :: message, reply, state + character*(512) :: message, reply + character*(128) :: state - disconnect_from_taskserver = 0 + disconnect_from_taskserver_state = 0 - write(message,*) 'disconnect '//trim(zmq_state), worker_id + write(message,*) 'disconnect '//trim(state), worker_id sze = len(trim(message)) rc = f77_zmq_send(zmq_to_qp_run_socket, trim(message), sze, 0) if (rc /= sze) then - disconnect_from_taskserver = -1 + disconnect_from_taskserver_state = -2 return endif @@ -720,20 +728,19 @@ integer function disconnect_from_taskserver(zmq_to_qp_run_socket, worker_id) read(message,*, end=10, err=10) reply, state if ((trim(reply) == 'disconnect_reply').and.(trim(state) == trim(zmq_state))) then - disconnect_from_taskserver = -1 return endif if (trim(message) == 'error Wrong state') then - disconnect_from_taskserver = -1 + disconnect_from_taskserver_state = -1 return else if (trim(message) == 'error No job is running') then - disconnect_from_taskserver = -1 + disconnect_from_taskserver_state = -1 return endif return 10 continue - disconnect_from_taskserver = -1 + disconnect_from_taskserver_state = -1 end integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) @@ -1019,9 +1026,9 @@ subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) character*(8), external :: zmq_port integer :: rc - rc = f77_zmq_setsockopt(zmq_to_qp_run_socket,ZMQ_LINGER,30000,4) + rc = f77_zmq_setsockopt(zmq_to_qp_run_socket,ZMQ_LINGER,300000,4) if (rc /= 0) then - stop 'Unable to set ZMQ_LINGER on zmq_to_qp_run_socket' + print *, 'warning: Unable to set ZMQ_LINGER on zmq_to_qp_run_socket' endif rc = f77_zmq_close(zmq_to_qp_run_socket) @@ -1112,6 +1119,68 @@ integer function zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n endif end +integer function zmq_delete_tasks_async_send(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + use f77_zmq + implicit none + BEGIN_DOC +! When a task is done, it has to be removed from the list of tasks on the qp_run +! queue. This guarantees that the results have been received in the pull. + END_DOC + integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket + integer(ZMQ_PTR) :: zmq_socket_pull + integer, intent(in) :: n_tasks, task_id(n_tasks) + integer, intent(in) :: more + integer :: rc, k + character*(64) :: fmt, reply + character(LEN=:), allocatable :: message + + zmq_delete_tasks_async_send = 0 + + allocate(character(LEN=64+n_tasks*12) :: message) + + write(fmt,*) '(A,1X,A,1X,', n_tasks, '(I11,1X))' + write(message,*) 'del_task '//trim(zmq_state), (task_id(k), k=1,n_tasks) + + + rc = f77_zmq_send(zmq_to_qp_run_socket,trim(message),len(trim(message)),0) + if (rc /= len(trim(message))) then + zmq_delete_tasks_async_send = -1 + deallocate(message) + return + endif + deallocate(message) + +end + + +integer function zmq_delete_tasks_async_recv(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + use f77_zmq + implicit none + BEGIN_DOC +! When a task is done, it has to be removed from the list of tasks on the qp_run +! queue. This guarantees that the results have been received in the pull. + END_DOC + integer(ZMQ_PTR), intent(in) :: zmq_to_qp_run_socket + integer(ZMQ_PTR) :: zmq_socket_pull + integer, intent(in) :: n_tasks, task_id(n_tasks) + integer, intent(out) :: more + integer :: rc + character*(64) :: reply + + zmq_delete_tasks_async_recv = 0 + + reply = '' + rc = f77_zmq_recv(zmq_to_qp_run_socket,reply,64,0) + + if (reply(16:19) == 'more') then + more = 1 + else if (reply(16:19) == 'done') then + more = 0 + else + zmq_delete_tasks_async_recv = -1 + endif +end + subroutine wait_for_next_state(state) use f77_zmq diff --git a/tests/bats/mrcepa0.bats b/tests/bats/mrcepa0.bats index 4985f8f0..271e5a54 100644 --- a/tests/bats/mrcepa0.bats +++ b/tests/bats/mrcepa0.bats @@ -5,7 +5,7 @@ source $QP_ROOT/tests/bats/common.bats.sh #=== H2O @test "MRCC-lambda H2O cc-pVDZ" { INPUT=h2o.ezfio - EXE=mrcc + EXE=mrcc_zmq test_exe $EXE || skip qp_edit -c $INPUT ezfio set_file $INPUT @@ -13,17 +13,19 @@ source $QP_ROOT/tests/bats/common.bats.sh ezfio set determinants threshold_selectors 1. ezfio set determinants read_wf True ezfio set mrcepa0 lambda_type 1 + ezfio set mrcepa0 perturbative_triples 0 ezfio set mrcepa0 n_it_max_dressed_ci 3 cp -r $INPUT TMP ; qp_run $EXE TMP ezfio set_file TMP energy="$(ezfio get mrcepa0 energy_pt2)" rm -rf TMP - eq $energy -76.2382119593927 1.e-4 + eq $energy -76.2382975461183 1.e-4 } + @test "MRCC H2O cc-pVDZ" { INPUT=h2o.ezfio - EXE=mrcc + EXE=mrcc_zmq test_exe $EXE || skip qp_edit -c $INPUT ezfio set_file $INPUT @@ -31,14 +33,33 @@ source $QP_ROOT/tests/bats/common.bats.sh ezfio set determinants threshold_selectors 1. ezfio set determinants read_wf True ezfio set mrcepa0 lambda_type 0 + ezfio set mrcepa0 perturbative_triples 0 ezfio set mrcepa0 n_it_max_dressed_ci 3 cp -r $INPUT TMP ; qp_run $EXE TMP ezfio set_file TMP energy="$(ezfio get mrcepa0 energy_pt2)" rm -rf TMP - eq $energy -76.2381753982902 1.e-4 + eq $energy -76.2382468380776 1.e-4 } +#@test "MRCC-stoch H2O cc-pVDZ" { +# INPUT=h2o.ezfio +# EXE=mrcc_zmq +# test_exe $EXE || skip +# qp_edit -c $INPUT +# ezfio set_file $INPUT +# ezfio set determinants threshold_generators 1. +# ezfio set determinants threshold_selectors 1. +# ezfio set determinants read_wf True +# ezfio set mrcepa0 lambda_type 0 +# ezfio set mrcepa0 n_it_max_dressed_ci 3 +# cp -r $INPUT TMP ; qp_run $EXE TMP +# ezfio set_file TMP +# energy="$(ezfio get mrcepa0 energy_pt2)" +# rm -rf TMP +# eq $energy -76.2379517543157 1.e-4 +#} + @test "MRSC2 H2O cc-pVDZ" { INPUT=h2o.ezfio EXE=mrsc2 @@ -50,11 +71,12 @@ source $QP_ROOT/tests/bats/common.bats.sh ezfio set determinants read_wf True ezfio set mrcepa0 lambda_type 1 ezfio set mrcepa0 n_it_max_dressed_ci 3 + ezfio set mrcepa0 perturbative_triples 0 cp -r $INPUT TMP ; qp_run $EXE TMP ezfio set_file TMP energy="$(ezfio get mrcepa0 energy_pt2)" rm -rf TMP - eq $energy -76.2359960472962 3.e-4 + eq $energy -76.2358860928235 3.e-4 } @test "MRCEPA0 H2O cc-pVDZ" { @@ -66,12 +88,13 @@ source $QP_ROOT/tests/bats/common.bats.sh ezfio set determinants threshold_generators 1. ezfio set determinants threshold_selectors 1. ezfio set determinants read_wf True + ezfio set mrcepa0 perturbative_triples 0 ezfio set mrcepa0 lambda_type 1 ezfio set mrcepa0 n_it_max_dressed_ci 3 cp -r $INPUT TMP ; qp_run $EXE TMP ezfio set_file TMP energy="$(ezfio get mrcepa0 energy_pt2)" rm -rf TMP - eq $energy -76.2411825032868 2.e-4 + eq $energy -76.2412031502384 2.e-4 } diff --git a/tests/bats_to_sh.py b/tests/bats_to_sh.py index 8feb9272..37e5fadb 100755 --- a/tests/bats_to_sh.py +++ b/tests/bats_to_sh.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 import sys