Skip to content
Open
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
13 changes: 7 additions & 6 deletions optking/compute_wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ class ComputeWrapper:

"""

def __init__(self, molecule, model, keywords, program):
def __init__(self, molecule, model, keywords, program, config=None):

self.molecule = molecule
self.model = model
self.keywords = keywords
self.program = program
self.config = config if config else {}
self.trajectory = []
self.energies = []

Expand Down Expand Up @@ -151,12 +152,12 @@ def _compute(self, driver):

inp = self.generate_schema_input(driver)

local_options = {}
if self.program == "psi4":
import psi4
local_options = self.config #{}
#if self.program == "psi4":
# import psi4

local_options["memory"] = psi4.core.get_memory() / 1000000000
local_options["ncores"] = psi4.core.get_num_threads()
# local_options["memory"] = psi4.core.get_memory() / 1000000000
# local_options["ncores"] = psi4.core.get_num_threads()

ret = qcengine.compute(inp, self.program, True, local_options)
return ret
Expand Down
3 changes: 2 additions & 1 deletion optking/optwrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,13 @@ def make_computer(opt_input: dict, computer_type):
qc_input = opt_input["input_specification"]
options = qc_input["keywords"]
model = qc_input["model"]
config = opt_input["input_specification"]["extras"]["_qcengine_local_config"]

if computer_type == "psi4":
# Please note that program is not actually used here
return Psi4Computer(molecule, model, options, program)
elif computer_type == "qc":
return QCEngineComputer(molecule, model, options, program)
return QCEngineComputer(molecule, model, options, program, config)
elif computer_type == "user":
logger.info("Creating a UserComputer")
return UserComputer(molecule, model, options, program)
Expand Down