Skip to content

Commit

Permalink
Default to no energy logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jan 23, 2024
1 parent a3e393a commit 2849bcc
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ Energies can be written to a file using the `--energy-file` command-line argumen
or the `EMLE_ENERGY_FILE` environment variable. The frequency of logging can be
specified using `--energy-frequency` or `EMLE_ENERGY_FREQUENCY`. This should be an
integer specifying the frequency at which energies are written. (The default is
1, i.e. every step is logged.) The output will look something like the following,
where the columns specify the current step, the in vacuo energy and the total
energy.
0, which means that energies aren't logged.) The output will look something like
the following, where the columns specify the current step, the in vacuo energy
and the total energy.

General log messages are written to the file specified by the `--log-file` or
`EMLE_LOG_FILE` options. (By default, no log file is used and diagnostic messages
Expand Down Expand Up @@ -296,9 +296,10 @@ Alternatively, if two values are passed then these will be used as initial and
final values of λ, with the additional `--interpolate-steps` option specifying
the number of steps (calls to the server) over which λ will be linearly
interpolated. (This can also be specified using the `EMLE_INTERPOLATE_STEPS`
environment variable.) In this case the log file will contain output similar
to that shown below. The columns specify the current step, the current λ value,
the energy at the current λ value, and the pure MM and EMLE energies.
environment variable.) In this case the energy file (if written) will contain
output similar to that shown below. The columns specify the current step, the
current λ value, the energy at the current λ value, and the pure MM and EMLE
energies.

```
# Step λ E(λ) (Eh) E(λ=0) (Eh) E(λ=1) (Eh)
Expand Down
2 changes: 1 addition & 1 deletion bin/emle-server
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ device = os.getenv("EMLE_DEVICE")
try:
energy_frequency = int(os.getenv("EMLE_ENERGY_FREQUENCY"))
except:
energy_frequency = 1
energy_frequency = 0
energy_file = os.getenv("EMLE_energy_file")
log_level = os.getenv("EMLE_LOG_LEVEL")
log_file = os.getenv("EMLE_LOG_FILE")
Expand Down
5 changes: 3 additions & 2 deletions emle/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def __init__(
restart=False,
device=None,
orca_template=None,
energy_frequency=1,
energy_frequency=0,
energy_file="emle_energy.txt",
log_level="ERROR",
log_file=None,
Expand Down Expand Up @@ -483,7 +483,8 @@ def __init__(
the ORCA backend when using emle-engine with Sire.
energy_frequency: int
The frequency of logging energies to file.
The frequency of logging energies to file. If 0, then no energies are
logged.
energy_file: str
The name of the file to which energies are logged.
Expand Down
2 changes: 2 additions & 0 deletions tests/test_external.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def test_external_local_directory():
# Set environment variables.
os.environ["EMLE_PORT"] = "12345"
os.environ["EMLE_EXTERNAL_BACKEND"] = "external.run_external"
os.environ["EMLE_ENERGY_FREQUENCY"] = "1"

# Create the sander command.
command = "sander -O -i emle_sp.in -p adp.parm7 -c adp.rst7 -o emle.out"
Expand Down Expand Up @@ -72,6 +73,7 @@ def test_external_plugin_directory():
os.environ["EMLE_PORT"] = "12345"
os.environ["EMLE_EXTERNAL_BACKEND"] = "external.run_external"
os.environ["EMLE_PLUGIN_PATH"] = os.getcwd() + "/tests/input"
os.environ["EMLE_ENERGY_FREQUENCY"] = "1"

# Create the sander command.
command = "sander -O -i emle_sp.in -p adp.parm7 -c adp.rst7 -o emle.out"
Expand Down
2 changes: 2 additions & 0 deletions tests/test_interpolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def test_interpolate():
os.environ["EMLE_LAMBDA_INTERPOLATE"] = "0"
os.environ["EMLE_PARM7"] = "adp_qm.parm7"
os.environ["EMLE_QM_INDICES"] = "adp_qm_indices.txt"
os.environ["EMLE_ENERGY_FREQUENCY"] = "1"

# Create the sander command.
command = "sander -O -i emle_sp.in -p adp.parm7 -c adp.rst7 -o emle.out"
Expand Down Expand Up @@ -132,6 +133,7 @@ def test_interpolate_steps():
os.environ["EMLE_INTERPOLATE_STEPS"] = "20"
os.environ["EMLE_PARM7"] = "adp_qm.parm7"
os.environ["EMLE_QM_INDICES"] = "adp_qm_indices.txt"
os.environ["EMLE_ENERGY_FREQUENCY"] = "1"

# Create the sander command.
command = "sander -O -i emle_prod.in -p adp.parm7 -c adp.rst7 -o emle.out"
Expand Down

0 comments on commit 2849bcc

Please sign in to comment.