ExpHP / rsp2

phonons in rust
Apache License 2.0
2 stars 1 forks source link

Fast disp fn for kc-z-new #100

Closed ExpHP closed 5 years ago

ExpHP commented 5 years ago

Closes #99

ExpHP commented 5 years ago

It looks like we could get up to another factor of three by similarly optimizing REBO: (which now dominates the cost of computing force sets)

$ grep -A1 'Computing forces at' test-step-4.fast/*/rsp2.0.log
test-step-4.fast/1417-96-a/rsp2.0.log:[ 772.349s][TRACE] Computing forces at displacements
test-step-4.fast/1417-96-a/rsp2.0.log-[2493.453s][TRACE] Done computing forces at displacements
--
test-step-4.fast/1621-243-a/rsp2.0.log:[1298.789s][TRACE] Computing forces at displacements
test-step-4.fast/1621-243-a/rsp2.0.log-[3539.156s][TRACE] Done computing forces at displacements
--
test-step-4.fast/3211-75-a/rsp2.0.log:[3477.909s][TRACE] Computing forces at displacements
test-step-4.fast/3211-75-a/rsp2.0.log-[12273.528s][TRACE] Done computing forces at displacements
--
test-step-4.fast/3601-121-a/rsp2.0.log:[4622.951s][TRACE] Computing forces at displacements
test-step-4.fast/3601-121-a/rsp2.0.log-[15793.686s][TRACE] Done computing forces at displacements

but I think it's fast enough for now. (and it'd be a PITA to refactor the REBO code to run on a subset of bonds, especially w.r.t. making sure each bond is counted exactly once)

ExpHP commented 5 years ago

Argh, I'm a dummy, when I tested bit-for-bit accuracy I looked at gamma-dynmat-01.npz instead of gamma-dynmat-02.npz. They're not bit-for-bit identical. I need to boot up a python interpreter and compare them.

ExpHP commented 5 years ago

Max value difference of 7.983197436445266e-15, on elements with values around -0.02123713. Looks fine.

This is unexpected though:

$ du -hs test-step-4/*/gamma-dynmat-02.npz
80M     test-step-4/1417-96-a/gamma-dynmat-02.npz
91M     test-step-4/1621-243-a/gamma-dynmat-02.npz
181M    test-step-4/3211-75-a/gamma-dynmat-02.npz
203M    test-step-4/3601-121-a/gamma-dynmat-02.npz

$ du -hs test-step-4.fast/*/gamma-dynmat-02.npz
72M     test-step-4.fast/1417-96-a/gamma-dynmat-02.npz
82M     test-step-4.fast/1621-243-a/gamma-dynmat-02.npz
176M    test-step-4.fast/3211-75-a/gamma-dynmat-02.npz
198M    test-step-4.fast/3601-121-a/gamma-dynmat-02.npz

$ python3 report-nnz test-step-4{,.fast}/*/gamma-dynmat-02.npz
test-step-4/1417-96-a/gamma-dynmat-02.npz 12229542 stored elements
test-step-4/1621-243-a/gamma-dynmat-02.npz 13988826 stored elements
test-step-4/3211-75-a/gamma-dynmat-02.npz 27719226 stored elements
test-step-4/3601-121-a/gamma-dynmat-02.npz 31084110 stored elements
test-step-4.fast/1417-96-a/gamma-dynmat-02.npz 14006592 stored elements
test-step-4.fast/1621-243-a/gamma-dynmat-02.npz 16021152 stored elements
test-step-4.fast/3211-75-a/gamma-dynmat-02.npz 31743126 stored elements
test-step-4.fast/3601-121-a/gamma-dynmat-02.npz 35596134 stored elements

In all four cases, the new matrices store more elements (probably because I forgot to filter out zeros), but the compressed filesize is smaller!

ExpHP commented 5 years ago

Oh. Hmm. Rats. I thought I had already merged this into master. I guess I held back as I was waiting for the unit tests to pass.

ExpHP commented 5 years ago

Oh bother, I keep forgetting that this isn't merged yet and having to deal with slow computations because of it.

I know why the unit tests failed. (#101) Let's just merge it.