sanshar / Block

Block implements the density matrix renormalization group (DMRG) algorithm for quantum chemistry.
GNU General Public License v3.0
30 stars 33 forks source link

NPDM crash #27

Closed MThomasRed92 closed 8 years ago

MThomasRed92 commented 8 years ago

Dear developers,

I had a problem running a small test calculation

This is the input:

nelec 4 spin 0 irrep 1 schedule 0 1000 1e-09 0.0 end maxiter 100 sweep_tol 1e-08 reset_iter onedot disk_dump_pdm threepdm npdm_no_intermediate orbitals FCIDUMP symmetry c2v hf_occ integral
gaopt default nroots 2 weights 0.5 0.5

The FCI dump file can be found at: http://pastebin.com/raw/nqwb1H8F

The calculation crashed near the end of the calculation, when doing the NPDM calculation

                     Block Iteration :: 0

Current NPDM sweep position = 1 of 2

                     Sites ::  2 3     # states: 8    # states: 8

                     Block Iteration :: 1

Current NPDM sweep position = 2 of 2

                     Sites ::  1 2 3     # states: 3    # states: 3

                     Elapsed Sweep CPU  Time (seconds): 0.190
                     Elapsed Sweep Wall Time (seconds): 0.241

                     Using the one dot algorithm ... 
                     Starting renormalisation sweep in backwards direction

                     Starting block is :: 
                     Sites ::  3     # states: 3    # states: 3

                     Block Iteration :: 0

Current NPDM sweep position = 1 of 2

This is gdb output:

0 0x00002aaaaf310cba in ftell () from /lib/x86_64-linux-gnu/libc.so.6

1 0x0000000000c48938 in SpinAdapted::Npdm::Threepdm_container::dump_to_disk(std::vector<std::pair<std::vector<int, std::allocator >, double>, std::allocator<std::pair<std::vector<int, std::allocator >, double> > >&) ()

2 0x0000000000c48d95 in SpinAdapted::Npdm::Threepdm_container::store_npdm_elements(std::vector<std::pair<std::vector<int, std::allocator >, double>, std::allocator<std::pair<std::vector<int, std::allocator >, double> > > const&) ()

3 0x0000000000bce1a1 in SpinAdapted::Npdm::Npdm_driver::do_inner_loop(char, SpinAdapted::Npdm::Npdm_expectations&, SpinAdapted::Npdm::NpdmSpinOps_base&, SpinAdapted::Npdm::NpdmSpinOps&, SpinAdapted::Npdm::NpdmSpinOps&) ()

4 0x0000000000bd0820 in SpinAdapted::Npdm::Npdm_driver::par_loop_over_block_operators(char, SpinAdapted::Npdm::Npdm_expectations&, SpinAdapted::Npdm::NpdmSpinOps&, SpinAdapted::Npdm::NpdmSpinOps&, SpinAdapted::Npdm::NpdmSpinOps&, bool) ()

5 0x0000000000bd11b3 in SpinAdapted::Npdm::Npdm_driver::loop_over_operator_patterns(SpinAdapted::Npdm::Npdm_patterns&, SpinAdapted::Npdm::Npdm_expectations&, SpinAdapted::SpinBlock const&) ()

6 0x0000000000bd1506 in SpinAdapted::Npdm::Npdm_driver::compute_npdm_elements(std::vector<SpinAdapted::Wavefunction, std::allocator >&, SpinAdapted::SpinBlock const&, int, int) ()

7 0x0000000000bc8d4a in SpinAdapted::Npdm::npdm_block_and_decimate(SpinAdapted::Npdm::Npdm_driver_base&, SpinAdapted::SweepParams&, SpinAdapted::SpinBlock&, SpinAdapted::SpinBlock&, bool const&, bool const&, int, int) ()

8 0x0000000000bc9ac3 in SpinAdapted::Npdm::npdm_do_one_sweep(SpinAdapted::Npdm::Npdm_driver_base&, SpinAdapted::SweepParams&, bool const&, bool const&, bool const&, int const&, int, int) ()

9 0x0000000000bcb5af in SpinAdapted::Npdm::npdm(SpinAdapted::NpdmOrder, bool, bool) ()

10 0x00000000009c93c2 in calldmrg(char, char) ()

11 0x0000000000972acb in main ()

shengg commented 8 years ago

'disk_dump_pdm' has not been used for a very long time. The bugs were created during the change of code. Thank you for finding this. It is fixed now.

By the way, 'npdm_no_intermediate' algorithm is slower than the default one. It only exists for a historical reason. It is better not use it.

Best regards,

Sheng Guo Ph.D student 351 Frick Laboratory Department of Chemistry Princeton University

On Tue, Mar 1, 2016 at 11:44 AM, MThomas notifications@github.com wrote:

Dear developers,

I had a problem running a small test calculation

This is the input:

nelec 4 spin 0 irrep 1 schedule 0 1000 1e-09 0.0 end maxiter 100 sweep_tol 1e-08 reset_iter onedot disk_dump_pdm threepdm npdm_no_intermediate orbitals FCIDUMP symmetry c2v hf_occ integral

gaopt default nroots 2 weights 0.5 0.5

The FCI dump file can be found at: http://pastebin.com/raw/nqwb1H8F

The calculation crashed near the end of the calculation, when doing the NPDM calculation

                 Block Iteration :: 0

Current NPDM sweep position = 1 of 2

                 Sites ::  2 3     # states: 8    # states: 8

                 Block Iteration :: 1

Current NPDM sweep position = 2 of 2

                 Sites ::  1 2 3     # states: 3    # states: 3

                 Elapsed Sweep CPU  Time (seconds): 0.190
                 Elapsed Sweep Wall Time (seconds): 0.241

                 Using the one dot algorithm ...
                 Starting renormalisation sweep in backwards direction

                 Starting block is ::
                 Sites ::  3     # states: 3    # states: 3

                 Block Iteration :: 0

Current NPDM sweep position = 1 of 2

This is gdb output:

0 0x00002aaaaf310cba in ftell () from /lib/x86_64-linux-gnu/libc.so.6

1 https://github.com/sanshar/Block/pull/1 0x0000000000c48938 in

SpinAdapted::Npdm::Threepdm_container::dump_to_disk(std::vector >, double>, std::allocator >, double> > >&) ()

2 https://github.com/sanshar/Block/issues/2 0x0000000000c48d95 in

SpinAdapted::Npdm::Threepdm_container::store_npdm_elements(std::vector >, double>, std::allocator >, double> > > const&) ()

3 https://github.com/sanshar/Block/issues/3 0x0000000000bce1a1 in

SpinAdapted::Npdm::Npdm_driver::do_inner_loop(char, SpinAdapted::Npdm::Npdm_expectations&, SpinAdapted::Npdm::NpdmSpinOps_base&, SpinAdapted::Npdm::NpdmSpinOps&, SpinAdapted::Npdm::NpdmSpinOps&) ()

4 https://github.com/sanshar/Block/issues/4 0x0000000000bd0820 in

SpinAdapted::Npdm::Npdm_driver::par_loop_over_block_operators(char, SpinAdapted::Npdm::Npdm_expectations&, SpinAdapted::Npdm::NpdmSpinOps&, SpinAdapted::Npdm::NpdmSpinOps&, SpinAdapted::Npdm::NpdmSpinOps&, bool) ()

5 https://github.com/sanshar/Block/issues/5 0x0000000000bd11b3 in

SpinAdapted::Npdm::Npdm_driver::loop_over_operator_patterns(SpinAdapted::Npdm::Npdm_patterns&, SpinAdapted::Npdm::Npdm_expectations&, SpinAdapted::SpinBlock const&) ()

6 https://github.com/sanshar/Block/pull/6 0x0000000000bd1506 in

SpinAdapted::Npdm::Npdm_driver::compute_npdm_elements(std::vector >&, SpinAdapted::SpinBlock const&, int, int) ()

7 https://github.com/sanshar/Block/pull/7 0x0000000000bc8d4a in

SpinAdapted::Npdm::npdm_block_and_decimate(SpinAdapted::Npdm::Npdm_driver_base&, SpinAdapted::SweepParams&, SpinAdapted::SpinBlock&, SpinAdapted::SpinBlock&, bool const&, bool const&, int, int) ()

8 https://github.com/sanshar/Block/issues/8 0x0000000000bc9ac3 in

SpinAdapted::Npdm::npdm_do_one_sweep(SpinAdapted::Npdm::Npdm_driver_base&, SpinAdapted::SweepParams&, bool const&, bool const&, bool const&, int const&, int, int) ()

9 https://github.com/sanshar/Block/pull/9 0x0000000000bcb5af in

SpinAdapted::Npdm::npdm(SpinAdapted::NpdmOrder, bool, bool) ()

10 https://github.com/sanshar/Block/pull/10 0x00000000009c93c2 in

calldmrg(char, char) ()

11 https://github.com/sanshar/Block/issues/11 0x0000000000972acb in

main ()

— Reply to this email directly or view it on GitHub https://github.com/sanshar/Block/issues/27.

MThomasRed92 commented 8 years ago

Hi Sheng,

Thank you for your fast answer. I still have an error running the calculation. The same input, but without 'npdm_no_intermediate' The calculation stops at

Current NPDM sweep position = 2 of 2 Sites :: 1 2 3 # states: 25 # states: 25

From gdb:

0 0x000000000188e0a0 in ?? ()

1 0x00002aaaaf490a57 in fclose () from /lib/x86_64-linux-gnu/libc.so.6

2 0x0000000000e42043 in SpinAdapted::Npdm::Threepdm_container::merge_diskfile(int const&, int const&) () at modules/npdm/threepdm_container.C:254

3 0x0000000000e448ec in SpinAdapted::Npdm::Threepdm_container::save_npdms(int const&, int const&) () at modules/npdm/threepdm_container.C:73

4 0x0000000000db2b90 in SpinAdapted::Npdm::Threepdm_driver::save_data(int, int) () at modules/npdm/npdm_driver.h:38

5 0x0000000000db0a89 in SpinAdapted::Npdm::npdm_do_one_sweep(SpinAdapted::Npdm::Npdm_driver_base&, SpinAdapted::SweepParams&, bool const&, bool const&, bool const&, int const&, int, int) () at modules/npdm/npdm.C:308

6 0x0000000000db21d7 in SpinAdapted::Npdm::npdm(SpinAdapted::NpdmOrder, bool, bool) () at modules/npdm/npdm.C:483

7 0x0000000000ab4d5b in calldmrg(char, char) () at dmrg.C:347

8 0x0000000000a3dbeb in main () at main.C:43

Best regards

shengg commented 8 years ago

I checked it. There was no error in the calculation. Do you clean the object files before compiling?

Best regards,

Sheng Guo Ph.D student 351 Frick Laboratory Department of Chemistry Princeton University

On Tue, Mar 1, 2016 at 1:11 PM, MThomas notifications@github.com wrote:

Hi Sheng,

Thank you for your fast answer. I still have an error running the calculation. The same input, but without 'npdm_no_intermediate' The calculation stops at

Current NPDM sweep position = 2 of 2 Sites :: 1 2 3 # states: 25 # states: 25

From gdb:

0 0x000000000188e0a0 in ?? ()

1 https://github.com/sanshar/Block/pull/1 0x00002aaaaf490a57 in fclose

() from /lib/x86_64-linux-gnu/libc.so.6

2 https://github.com/sanshar/Block/issues/2 0x0000000000e42043 in

SpinAdapted::Npdm::Threepdm_container::merge_diskfile(int const&, int const&) () at modules/npdm/threepdm_container.C:254

3 https://github.com/sanshar/Block/issues/3 0x0000000000e448ec in

SpinAdapted::Npdm::Threepdm_container::save_npdms(int const&, int const&) () at modules/npdm/threepdm_container.C:73

4 https://github.com/sanshar/Block/issues/4 0x0000000000db2b90 in

SpinAdapted::Npdm::Threepdm_driver::save_data(int, int) () at modules/npdm/npdm_driver.h:38

5 https://github.com/sanshar/Block/issues/5 0x0000000000db0a89 in

SpinAdapted::Npdm::npdm_do_one_sweep(SpinAdapted::Npdm::Npdm_driver_base&, SpinAdapted::SweepParams&, bool const&, bool const&, bool const&, int const&, int, int) () at modules/npdm/npdm.C:308

6 https://github.com/sanshar/Block/pull/6 0x0000000000db21d7 in

SpinAdapted::Npdm::npdm(SpinAdapted::NpdmOrder, bool, bool) () at modules/npdm/npdm.C:483

7 https://github.com/sanshar/Block/pull/7 0x0000000000ab4d5b in

calldmrg(char, char) () at dmrg.C:347

8 https://github.com/sanshar/Block/issues/8 0x0000000000a3dbeb in main

() at main.C:43

Best regards

— Reply to this email directly or view it on GitHub https://github.com/sanshar/Block/issues/27#issuecomment-190837934.

MThomasRed92 commented 8 years ago

Dear Sheng,

I built from a fresh copy. The code was compiled with g++ 4.8.5, intel mkl, boost 1.55, and openmpi-1.65. Still the error that I mentioned.

Best regards

shengg commented 8 years ago

Dear Thomas,

I forgot to upload the head file in last update. It is fixed. Can you run it again? Thank you. The object file should be cleaned because the makefile in BLOCK cannot detect the change of head file.

Best regards,

Sheng Guo Ph.D student 351 Frick Laboratory Department of Chemistry Princeton University

On Tue, Mar 1, 2016 at 3:00 PM, MThomas notifications@github.com wrote:

Dear Sheng,

I built from a fresh copy. The code was compiled with g++ 4.8.5, intel mkl, boost 1.55, and openmpi-1.65.

Best regards

— Reply to this email directly or view it on GitHub https://github.com/sanshar/Block/issues/27#issuecomment-190879034.

MThomasRed92 commented 8 years ago

Hi Sheng,

Thank you for fixing the problem. It works now. However, compared to an older version, it seems that the elements are not ordered. How can I do that now?

Best regards

shengg commented 8 years ago

Because the zero elements are not included in the output, there is still no global index for each element even if the elements are ordered. We have to deal with the elements one by one. The order of elements is not important.

shengg commented 8 years ago

The orbital indices are still in the output. Therefore, you can order them by yourself, if you really need to use them in certain order.

MThomasRed92 commented 8 years ago

Thank you!

MThomasRed92 commented 8 years ago

Hi Sheng,

Sorry for reopening this as I still have one more question. For the old Block version, if I use disk_dump_pdm, one root, I obtained file spatial_threepdm.0.0.bin (32861 Byte). For the new Block version, the spatial_threepdm.0.0.bin file is not produced anymore when using disk_dump_pdm. How can I have this file with the new Block version? If I turn off disk_dump_pdm, the program produces spatial_threepdm.0.0.bin, but it has different size (32768 Byte).

Best regard

shengg commented 8 years ago

We do not recommend to use the binary file of threepdm. And there is no document about the structure of these binary files.

When you do not use disk_dump_pdm, the binary file is just the serialization of the threepdm matrix, an 1-d vector with hoods, through boost library. If disk_dump_pdm is used, binary file contains the indices and elements of pdm. In any situation, it is not possible to read these binary file into memory without knowing the details of the source code. The text files contain every thing we need. There is no need to use binary file.

Best regards,

Sheng Guo Ph.D student 351 Frick Laboratory Department of Chemistry Princeton University

On Thu, Mar 10, 2016 at 11:32 AM, MThomas notifications@github.com wrote:

Reopened #27 https://github.com/sanshar/Block/issues/27.

— Reply to this email directly or view it on GitHub https://github.com/sanshar/Block/issues/27#event-585140690.

MThomasRed92 commented 8 years ago

Thank you for your answer.