Skip to content

Commit

Permalink
Merge pull request #9 from molssi-seamm/dev
Browse files Browse the repository at this point in the history
Removed too verbose logging
  • Loading branch information
seamm authored Jun 5, 2024
2 parents 703c8c7 + 3da5a3c commit a9c872f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
=======
History
=======
2024.6.5: Cleaned up logging from code.
* The logging was a bit aggressive, so moved most logging down to the debug
level. This will make the output of e.g. geomeTRIC more readable.

2024.5.31: Added optimization of transition states, and...
* Corrected implementation of composite methods (Gn, CBS-x) to handle optimization.
* Added target of the optimization to allow transition states and saddle points.
Expand Down
22 changes: 8 additions & 14 deletions gaussian_step/substep.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ def run_gaussian(self, keywords):

# How many threads to use
n_cores = ce["NTASKS"]
self.logger.info("The number of cores available is {}".format(n_cores))
self.logger.debug("The number of cores available is {}".format(n_cores))

if seamm_options["parallelism"] not in ("openmp", "any"):
n_threads = 1
Expand All @@ -838,7 +838,7 @@ def run_gaussian(self, keywords):
if seamm_options["ncores"] != "available":
n_threads = min(n_threads, int(seamm_options["ncores"]))
ce["NTASKS"] = n_threads
self.logger.info(f"Gaussian will use {n_threads} threads.")
self.logger.debug(f"Gaussian will use {n_threads} threads.")

# How much memory to use
if seamm_options["memory"] == "all":
Expand Down Expand Up @@ -892,7 +892,7 @@ def run_gaussian(self, keywords):
lines.append(" ")

files = {"input.dat": "\n".join(lines)}
self.logger.info("input.dat:\n" + files["input.dat"])
self.logger.debug("input.dat:\n" + files["input.dat"])

printer.important(
self.indent + f" Gaussian will use {n_threads} OpenMP threads and "
Expand Down Expand Up @@ -987,8 +987,8 @@ def run_gaussian(self, keywords):
"gaussian.fchk",
]

self.logger.info(f"{cmd=}")
self.logger.info(f"{env=}")
self.logger.debug(f"{cmd=}")
self.logger.debug(f"{env=}")

result = executor.run(
cmd=[cmd],
Expand Down Expand Up @@ -1024,12 +1024,9 @@ def run_gaussian(self, keywords):
data = self.parse_output(path, data)

# Debug output
if self.logger.isEnabledFor(logging.INFO):
keys = "\n".join(data.keys())
self.logger.info(f"Data keys:\n{keys}")
if self.logger.isEnabledFor(logging.DEBUG):
keys = "\n".join(data.keys())
self.logger.info(f"Data keys:\n{keys}")
self.logger.debug(f"Data keys:\n{keys}")
self.logger.debug(f"Data:\n{pprint.pformat(data)}")

# Explicitly pull out the energy and gradients to standard name
Expand All @@ -1042,12 +1039,9 @@ def run_gaussian(self, keywords):
del data["Cartesian Gradient"]

# Debug output
if self.logger.isEnabledFor(logging.INFO):
keys = "\n".join(data.keys())
self.logger.info(f"Data keys:\n{keys}")
if self.logger.isEnabledFor(logging.DEBUG):
keys = "\n".join(data.keys())
self.logger.info(f"Data keys:\n{keys}")
self.logger.debug(f"Data keys:\n{keys}")
self.logger.debug(f"Data:\n{pprint.pformat(data)}")

# The model chemistry
Expand All @@ -1059,7 +1053,7 @@ def run_gaussian(self, keywords):
f"{data['metadata/methods'][-1]}/{data['method']}/"
f"{data['metadata/basis_set']}"
)
self.logger.info(f"model = {self.model}")
self.logger.debug(f"model = {self.model}")

data["model"] = "Gaussian/" + self.model

Expand Down

0 comments on commit a9c872f

Please sign in to comment.