diff --git a/README.md b/README.md index c06ac25..529cc34 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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) diff --git a/bin/emle-server b/bin/emle-server index 375d5d3..2a0082e 100755 --- a/bin/emle-server +++ b/bin/emle-server @@ -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") diff --git a/emle/calculator.py b/emle/calculator.py index 1ddaf31..2aed913 100644 --- a/emle/calculator.py +++ b/emle/calculator.py @@ -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, @@ -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. diff --git a/tests/test_external.py b/tests/test_external.py index b16ba91..f87e2e5 100644 --- a/tests/test_external.py +++ b/tests/test_external.py @@ -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" @@ -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" diff --git a/tests/test_interpolate.py b/tests/test_interpolate.py index 0db31c8..4e1fbe6 100644 --- a/tests/test_interpolate.py +++ b/tests/test_interpolate.py @@ -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" @@ -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"