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

running Madness with QCengine #242

Open
wants to merge 126 commits into
base: master
Choose a base branch
from
Open

Conversation

ahurta92
Copy link
Contributor

Description

This PR creates a new madness directory under programs. The files are the first iterations to setting up madness in qcng. It follows a very similar structure to that of nwchem.

Changelog description

This is the first iteration of setting up qcng to run madness calculations.

Status

  • Code base linted
  • Ready to go

_defaults = {
"name": "Madness",
"scratch": True,
"thread_safe": True,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure about this? I can believe it of madness, but thread safety is uncommon among non-trivial programs.

@@ -101,6 +102,7 @@ def list_available_programs() -> Set[str]:
register_program(GAMESSHarness())
register_program(MolproHarness())
register_program(NWChemHarness())
register_program(MadnessHarness())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alphabetize


"""
qc = which(
"nwchem",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

madness?

qcengine/programs/madness/runner.py Outdated Show resolved Hide resolved

# Log the job settings (LORI) Not sure if i need this
logger.debug("JOB_OPTS")
logger.debug(pp.pformat(opts))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging is wild west at this point

def execute(
self, inputs: Dict[str, Any], *, extra_outfiles=None, extra_commands=None, scratch_name=None, timeout=None
) -> Tuple[bool, Dict]:
success, dexe = execute(inputs["command"], inputs["infiles"],)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll want scratch_directory=inputs["scratch_directory"], in the execute cmd so that it's user configurable.

+ r".*\s+.*\s+"
+ r"ZZ\s+([+-]?\d+[.]\d+)\s+"
+ r".*\s+.*\s+"
+ r"XY\s+([+-]?\d+[.]\d+)\s+"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if these are floats, the NUMBER regex def can simplify. also, we're going with the full (redundant) 3x3 quadrupole, rather than 6-element.

assert "provenance" in res
assert res["success"] is True

# k=7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the k=7 be in keywords somewhere? does madness always use k cutoff rather than basis set or just certain methods?

# 2)Calculation converged
else:
OPTIONS=[r'kinetic',r'nonlocal psp',r'nuclear attraction',r'coulomb',r'PCM',r'exchange-correlation',r'nuclear-repulsion',r'total']
PSIVAR=['KINETIC ENERGY','NONLOCAL PSP','NUCLEAR ATTRACTION ENERGY','COULOMB','PCM','EXCHANGE-CORRELATION','NUCLEAR REPULSION ENERGY','TOTAL SCF ENERGY']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe collect into AtomicResultProperties directly, since those names will get validated. these aren't "official" psivars/qcvars (but the code that checks names isn't in qcengine).

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 24, 2022

This pull request introduces 14 alerts when merging 5e5c8c5 into 113d1e8 - view on LGTM.com

new alerts:

  • 14 for Unused local variable

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 27, 2022

This pull request introduces 14 alerts when merging 68a9193 into dd5eec6 - view on LGTM.com

new alerts:

  • 14 for Unused local variable

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 28, 2022

This pull request introduces 14 alerts when merging 4c74677 into dd5eec6 - view on LGTM.com

new alerts:

  • 14 for Unused local variable

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 28, 2022

This pull request introduces 14 alerts when merging 3feaf7e into dd5eec6 - view on LGTM.com

new alerts:

  • 14 for Unused local variable

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 28, 2022

This pull request introduces 14 alerts when merging 839fb03 into dd5eec6 - view on LGTM.com

new alerts:

  • 14 for Unused local variable

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 29, 2022

This pull request introduces 14 alerts when merging cc192ef into dd5eec6 - view on LGTM.com

new alerts:

  • 14 for Unused local variable

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Comment on lines +15 to +16
# if keyword.upper() == "MEMORY":
# return keyword.lower(), f"{val} byte"

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
"""

# Loop over all steps
pass_psivar = []

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable pass_psivar is not used.

# Loop over all steps
pass_psivar = []
pass_coord = []

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable pass_coord is not used.
# Loop over all steps
pass_psivar = []
pass_coord = []
pass_grad = []

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable pass_grad is not used.
pass_coord = []
pass_grad = []
# Write now we split at Converge
counter = 1

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable counter is not used.
qcengine/programs/madness/runner.py Fixed Show fixed Hide fixed
qcengine/programs/madness/runner.py Fixed Show fixed Hide fixed
qcengine/programs/madness/runner.py Fixed Show fixed Hide fixed
qcengine/programs/madness/runner.py Fixed Show fixed Hide fixed
qcengine/programs/madness/runner.py Fixed Show fixed Hide fixed
if config.use_mpiexec:
which_prog = create_mpi_invocation(which_prog, config)
else:
command = [which_prog]

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable command is not used.

# Location resolution order config.scratch_dir, /tmp
parent = config.scratch_directory
scratch_messy = config.scratch_messy

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable scratch_messy is not used.
parent = config.scratch_directory
scratch_messy = config.scratch_messy

error_message = None

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable error_message is not used.
scratch_messy = config.scratch_messy

error_message = None
compute_success = False

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable compute_success is not used.

output_data = {}

driver = input_model.driver

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable driver is not used.

import numpy as np

import qcelemental as qcel

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'qcel' is not used.
import numpy as np

import qcelemental as qcel
from qcelemental.models import AtomicResult, Provenance, AtomicInput

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Provenance' is not used.
from qcelemental.util import safe_version, which
from qcengine.config import TaskConfig, get_config
from qcengine.exceptions import UnknownError
from qcengine.programs.mrchem import extract_properties

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'extract_properties' is not used.
from qcengine.config import TaskConfig, get_config
from qcengine.exceptions import UnknownError
from qcengine.programs.mrchem import extract_properties
from .harvester import extract_formatted_properties, tensor_to_numpy

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'extract_formatted_properties' is not used.
if run_type == "gradient":
opts["dft__derivatives"] = True
elif run_type == "hessian":
Pass

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.
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

Successfully merging this pull request may close these issues.

2 participants