Skip to content

Commit

Permalink
Some Turbomole fixes (#405)
Browse files Browse the repository at this point in the history
* turbomole fixes

* lint

* remove the jobs_per_node edit

---------

Co-authored-by: Lori A. Burns <[email protected]>
  • Loading branch information
cvsik and loriab authored Aug 6, 2023
1 parent bededd8 commit d18cfda
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 6 additions & 0 deletions qcengine/programs/tests/test_turbomole.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ def h2o_ricc2_def2svp():
pytest.param("pbe0", {"grid": "m5"}, -76.27371135900, marks=using("turbomole")),
pytest.param("ricc2", {}, -76.1603807755, marks=using("turbomole")),
pytest.param("rimp2", {}, -76.1593614075, marks=using("turbomole")),
pytest.param(
"hf",
{"scf_conv": 4, "scf_iters": 1},
-75.95536954370,
marks=[using("turbomole"), pytest.mark.xfail(raises=AssertionError, strict=True)],
),
],
)
def test_turbomole_energy(method, keywords, ref_energy, h2o):
Expand Down
6 changes: 4 additions & 2 deletions qcengine/programs/turbomole/define.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def prepare_stdin(
# Load data from keywords
unrestricted = keywords.get("unrestricted", False)
grid = keywords.get("grid", "m3")
scf_conv = keywords.get("scf_conv", 8)
scf_iters = keywords.get("scf_iters", 150)

methods_flat = list(it.chain(*[m for m in METHODS.values()]))
if method not in methods_flat:
Expand Down Expand Up @@ -191,8 +193,8 @@ def set_dsp(keywords):
"ri": set_ri(keywords),
"dsp": set_dsp(keywords),
"title": "QCEngine Turbomole",
"scf_conv": 8,
"scf_iters": 150,
"scf_conv": scf_conv,
"scf_iters": scf_iters,
"basis": basis,
}

Expand Down
4 changes: 4 additions & 0 deletions qcengine/programs/turbomole/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def build_input(

env = os.environ.copy()
env["PARA_ARCH"] = "SMP"
env["TM_PAR_OMP"] = "on"
env["PARNODES"] = str(config.ncores)
env["SMPCPUS"] = str(config.ncores)
turbomolerec["environment"] = env
Expand Down Expand Up @@ -238,6 +239,9 @@ def execute(
inputs["infiles"],
inputs["outfiles"],
shell=True,
environment=inputs["environment"],
# TODO:
# scratch_directory="/path/to/userdefined/scratch",
# TODO: scratch_messy?
# scratch_messy=False,
)
Expand Down
4 changes: 2 additions & 2 deletions qcengine/tests/test_procedures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def input_data():


@using("psi4")
@pytest.mark.parametrize("ncores", [1, 2])
@pytest.mark.parametrize("ncores", [1, 4])
@pytest.mark.parametrize(
"optimizer",
[
Expand Down Expand Up @@ -50,7 +50,7 @@ def test_geometric_psi4(input_data, optimizer, ncores):
assert ret.provenance.creator.lower() == optimizer
assert ret.trajectory[0].provenance.creator.lower() == "psi4"

if optimizer == "optking" and ncores == 2:
if optimizer == "optking" and ncores == 4:
pytest.xfail("not passing threads to psi4")
else:
assert ret.trajectory[0].provenance.nthreads == ncores
Expand Down

0 comments on commit d18cfda

Please sign in to comment.