From 480c3e41073f279be048859994ac14d93f04dd20 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Wed, 24 Jan 2024 09:11:55 +0000 Subject: [PATCH] Improve default options when using emle-server. --- README.md | 11 ++++++----- bin/emle-server | 9 +++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2849af2..5dd7eb0 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ For usage information, run: emle-server --help ``` -(On startup an `emle_settings.yaml` file will be written to the working directory +(By default, an `emle_settings.yaml` file will be written to the working directory containing the settings used to configure the server. This can be used to re-run an existing simulation using the `--config` option or `EMLE_CONFIG` environment variable. Additional `emle_pid.txt` and `emle_port.txt` files contain the process @@ -215,10 +215,11 @@ 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 -are written to `sys.stderr`.) The log level can be adjusted by using the -`--log-level` or `EMLE_LOG_LEVEL` options. For performance, the default log level -is set to `ERROR`. +`EMLE_LOG_FILE` options. (When using the Python API, by default, no log file is +used and diagnostic messages are written to `sys.stderr`. When using `emle-server`, +logs are by default redirected to `emle_log.txt`.) The log level can be adjusted +by using the `--log-level` or `EMLE_LOG_LEVEL` options. For performance, the default +log level is set to `ERROR`. ``` # Step E_vac (Eh) E_tot (Eh) diff --git a/bin/emle-server b/bin/emle-server index 2a0082e..ff186bc 100755 --- a/bin/emle-server +++ b/bin/emle-server @@ -523,6 +523,15 @@ if args["deepmd_model"] is not None: else: args["deepmd_model"] = models +# Log errors by default. +if args["log_file"] is None: + args["log_file"] = "emle_log.txt" + +# Save settings by default. +if args["save_settings"] is None: + args["save_settings"] = True + +# Use the default backend if no external backend is specified. if args["external_backend"] is None: if args["backend"] is None: args["backend"] = "torchani"