Skip to content
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 hvap and prevent undefined behavior from using unitialized variables #397

Merged
merged 18 commits into from
Dec 10, 2021

Conversation

GregorySchwing
Copy link
Collaborator

@GregorySchwing GregorySchwing commented Dec 9, 2021

Density was being incorrectly determined for simulations with > 1 molecule kind.

VapBox and LiqBox was unitialized for simulations where kind 0 in box 0 was more populous than kind 0 in box 1.

Other variables were uninitialized.

This is a high priority bug because of the segfaults it may generate from using an uninitialized variable to index into memory

See attached Blk file showing HVAP is printed to Blk and Console.
Blk_Output_data_BOX_0.txt
Console.txt

Also, so integration testing scripts are added to the test/ directory.

@jpotoff
Copy link
Collaborator

jpotoff commented Dec 9, 2021

It doesn't effect the code behavior, but "compressability" is spelled incorrectly and should be "compressibility". Can we get the variable name updated in the code?

@GregorySchwing
Copy link
Collaborator Author

It doesn't effect the code behavior, but "compressability" is spelled incorrectly and should be "compressibility". Can we get the variable name updated in the code?

Done

Copy link
Collaborator

@LSchwiebert LSchwiebert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm approving the Pull Request, but before merging you should fix the OOB memory access in OutputVars.cpp on line 21 when running GCMC. Instead of BOX_TOTAL in the for loop, we should be using BOXES_WITH_U_NB I would use the same on line 29, even though for GEMC they are equivalent.

The other CODACY comments are for the tests.

Copy link
Collaborator

@msoroush msoroush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@GregorySchwing GregorySchwing merged commit 96d1529 into GOMC-WSU:development Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants