New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix vector indexing error in psi::IntegralTransform::process_spaces #1220
Conversation
|
@@ -275,7 +275,7 @@ void IntegralTransform::process_spaces() { | |||
if (mosym_[orb] == h) { | |||
aOrbsPI[h]++; | |||
aOrbSym[count] = h; | |||
if (aIndex) aIndex[count] = aindex[n]; | |||
//if (aIndex) aIndex[count] = aindex[n]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm being slow here, but I don't see what the problem is. The (poorly named) aIndex
pointer is created if custom array indexing was provided via aindex
. If that vector is empty, no copy is attempted; if not, the loops should essentially reorder the aindex
vector into aIndex
, but sorted by irrep. There should probably be a catch to ensure that the number of orbitals and indices is the same, but I think that exists somewhere upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a particular compiler error or failed test that led to this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, whatever was the reason for this change, why does it not come into play for the beta orbital indexing where the logic is identical with different variable names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Windows, the tests
- casscf-fzc-sp
- casscf-sa-sp
- casscf-semi
- casscf-sp
- rasscf-sp
- molden1
- molden2
crash with run-time vector index error
, which happens on that line. In case of beta orbitals, maybe there are no tests for that.
So I not sure, how to make a proper fix.
This is also happens on Linux!
|
Just on Linux it doesn't cause a crash for a normal build! |
This is very helpful - thank you very much. I'll figure out where the problem is soon and send a PR to you. Commenting the line out will fix the problem, but will impact anybody who uses the library with custom MO spaces and the IWL integral format (which, admittedly, should be 0 people). Rather than suddenly deprecate the feature, I'd like to understand where the bad call is happening and fix that instead. Thank you for your patience. |
I finally figured out where the problem was, and have created a PR to fix it. Once that PR is merged into your branch, this fix should be good to go. Sorry for taking so long on this - it was quite a tricky issue to figure out. |
Fix DETCI integral transformation setup
Description
This is part of Psi4 porting to Windows (#933).
Todos
Notable points (developer or user-interest) that this PR has or will accomplish.
psi::IntegralTransform::process_spaces
Questions
Checklist
Tests added for any new featuresStatus