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

set psi4 memory #169

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions openff/recharge/data/psi4/input.dat
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
memory {{ memory_limit_gb }} GB

molecule mol {
noreorient
nocom
Expand Down
3 changes: 3 additions & 0 deletions openff/recharge/esp/_esp.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ def _generate(
compute_esp: bool,
compute_field: bool,
n_threads: int,
memory_limit_gb: int,
) -> tuple[Quantity, Quantity | None, Quantity | None]:
"""The implementation of the public ``generate`` function which
should return the ESP for the provided conformer.
Expand Down Expand Up @@ -157,6 +158,7 @@ def generate(
compute_esp: bool = True,
compute_field: bool = True,
n_threads: int = 1,
memory_limit_gb: int = 1,
) -> tuple[Quantity, Quantity, Quantity | None, Quantity | None]:
"""Generate the electrostatic potential (ESP) on a grid defined by
a provided set of settings.
Expand Down Expand Up @@ -203,6 +205,7 @@ def generate(
compute_esp,
compute_field,
n_threads,
memory_limit_gb,
)

return conformer, grid, esp, electric_field
11 changes: 10 additions & 1 deletion openff/recharge/esp/psi4.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def _generate_input(
minimize: bool,
compute_esp: bool,
compute_field: bool,
memory_limit_gb: int,
) -> str:
"""Generate the input files for Psi4.

Expand Down Expand Up @@ -102,6 +103,7 @@ def _generate_input(
"dft_settings": settings.psi4_dft_grid_settings.value,
"minimize": minimize,
"properties": str(properties),
"memory_limit_gb": memory_limit_gb,
}

if enable_pcm:
Expand Down Expand Up @@ -133,12 +135,19 @@ def _generate(
compute_esp: bool,
compute_field: bool,
n_threads: int,
memory_limit_gb: int,
) -> tuple[Quantity, Quantity | None, Quantity | None]:
# Perform the calculation in a temporary directory
with temporary_cd(directory):
# Store the input file.
input_contents = cls._generate_input(
molecule, conformer, settings, minimize, compute_esp, compute_field
molecule,
conformer,
settings,
minimize,
compute_esp,
compute_field,
memory_limit_gb,
)

with open("input.dat", "w") as file:
Expand Down
Loading