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

Change defaults and allow configuration of Antechamber charge assignment threads #1831

Open
Yoshanuikabundi opened this issue Mar 6, 2024 · 0 comments

Comments

@Yoshanuikabundi
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

My machine has a 12-core/24 thread CPU. By default, antechamber spins up 24 threads to charge a molecule. I've found that performance is much better with only 8 threads (~2-4x speedup), though I haven't carefully tested how this varies.

Describe the solution you'd like

Antechamber's threading behaviour can be controlled with the OMP_NUM_THREADS environment variable. When Antechamber is called in assign_partial_charges, this environment variable should be set to a small number (say, n_threads/3) if it is not already set in the environment. IIRC this variable can be set with the subprocessing.run(env: dict) argument so that it doesn't leak to other processes.

In addition, AmberToolsToolkitWrapper() and/or assign_partial_charges() could take an optional n_threads argument that overrides the environment variable.

Describe alternatives you've considered

We could just document this behavior and how it can be configured.

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

No branches or pull requests

1 participant