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

Improve monte-carlo speed further by reducing python overheads #327

Open
qchempku2017 opened this issue Feb 1, 2023 · 0 comments
Open
Assignees
Labels
enhancement New feature or request

Comments

@qchempku2017
Copy link
Collaborator

qchempku2017 commented Feb 1, 2023

Is your feature request related to a problem? Please describe.
Recently we have discovered that a single spin flip in smol takes around 30 micron seconds to evaluate and 60 micron seconds to propose in a supercell of 512 active sites, which is approximately 100 times slower than CASM. We attribute the slow speed of smol majorly to python overhead compared to C++.

Describe the solution you'd like
Although as a heavily python-based code, smol may never outperform C-based codes, three things should still be done to significantly improve the performance of smol and allow simulating bigger systems:
1, Update the MCUsher codes. According to tests, by substituting numpy random number generator with python's default random library, single flip proposal time can be decreased to nearly 1 micron second. Canonical swaps, table-flips should be updated accordingly. Make sure that the ability to reinitialize calculations with the same random seed is preserved.
2, Improve Cython codes to compute correlation vectors, especially the python-style for-loop that iterates over orbit lists.
overhead sample code.
3, Try to reduce other potential overheads in Sampler and MCkernal.

Describe alternatives you've considered
Please describe alternative solutions or features you have considered.

@qchempku2017 qchempku2017 added the enhancement New feature or request label Feb 1, 2023
@lbluque lbluque mentioned this issue Apr 19, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants