-
Notifications
You must be signed in to change notification settings - Fork 475
Parallelize compute_esp_over_grid #2891
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
Conversation
JonathonMisiewicz
left a comment
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.
One minor comment.
psi4/src/psi4/libmints/oeprop.cc
Outdated
| outfile->Printf("\n Electrostatic potential to be computed on the grid and written to grid_esp.dat\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.
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.
@JonathonMisiewicz I accidentally marked this as resolved, please let me know if additional changes are needed for approval of this PR.
Co-authored-by: Jonathon Misiewicz <[email protected]>
loriab
left a comment
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.
Thanks for the parallelization!
|
Thanks for reviewing @loriab @JonathonMisiewicz ! |
| } | ||
|
|
||
| #ifdef _OPENMP | ||
| #pragma omp parallel for schedule(dynamic) |
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.
schedule(guided) would be better
Description
There was a race condition in the parallel calculation of ESP over grid in memory. This was fixed in PR #1900.
This made the computation of ESP serial and quite slow (as mentioned in #1614 for example).
This PR brings back the OpenMP parallelization, the race condition is avoided by allowing each thread to hold its own copy of the
ElectrostaticIntobject. Thanks to @JonathonMisiewicz for the initial hint.User API & Changelog headlines
Dev notes & details
<ElectrostaticInt>and<Matrix>objects for computing the ESP at a given grid point#pragma omp parallel for schedule(dynamic)to parallelize the outer loop over grid pointsQuestions
cubepropuses a scheme different from the one used byoepropto compute ESP on a grid. I am not sure this is documented. Should it be?compute_esp_over_gridfunction which reads the grid fromgrid.datfile. The way it is designed now, the grid is read iteratively, so one grid point read->one ESP point computed->one ESP point written to the outputgrid_esp.datfile. This is not parallelizible. However, if one would read grid points in batches - this can be parallelized. What do you think?Checklist
Status