Skip to content
Snippets Groups Projects

Resolve "Make small changes in quick-start guide"

Merged Ivan Kondov requested to merge 365-make-small-changes-in-quick-start-guide into master
1 file
+ 12
11
Compare changes
  • Side-by-side
  • Inline
+ 12
11
@@ -44,7 +44,7 @@ Do you want to create it?
Yes(default) | No | Ctrl+C to skip:
```
Answer with "No" or press Ctrl+C for now.
It is recommended to accept the automatic creation of the *res_config.yaml* file.
The `texts session` command creates an empty model that can be extended interactively by adding [statements](scl.md#), for example our first [print](scl.md#the-print-statement) statement:
```
@@ -88,15 +88,16 @@ COMPLETED 2024-06-21T18:54:05+02:00 var2 = 2
COMPLETED 2024-06-21T18:54:05+02:00 var3 = var1 + var2
```
After evaluation, a set of new folders named as `launcher_YYY-MM-DD-TIME-ID` will appear in the path where the session was executed.
These *launchdirs* are created so that every statement is evaluated in a unique directory.
The session can be closed by entering a *magic command* such as `%exit`, `%close`, `%quit`, or `%bye`:
```
Input > %bye
Exiting
```
After evaluation, a set of new folders named as `launcher_YYY-MM-DD-TIME-ID` will appear in the path where the session was executed.
These *launchdirs* are created so that every statement is evaluated in a unique directory.
## Types, units, and data structures
Before introducing some more SCL features concerning *variable statements* and their *parameters*, start a new interactive session with the `texts session -r` command (using the *autorun* flag):
@@ -248,7 +249,7 @@ Now that all necessary data is contained in series, we can use the [map function
The `G` function is defined employing placeholder variables, which are then mapped to the values in the `H`, `T`, and `S` data series:
```
Input > G(h,t,s) = h - (t*s)
Input > G(h, t, s) = h - (t * s)
Input > GibbsE = map(G, H, T, S)
Input > print(GibbsE)
Output > (GibbsE: 1.1021001452364404e-05, -0.003487240000000058, -0.013669420000000043, -0.05408840800000014, -0.3262151200000005, -1.2364643200000005) [kilojoule / mole]
@@ -277,7 +278,7 @@ Another scenario in which the `texts session` can be very useful, is to revisit,
Nonetheless, due to limitations of its CLI with respect to input and navigation capabilities, the `texts session` can be impractical in some cases.
For example, when building models with large amounts of non-independent steps, or models that require complex input data, such as molecular geometry objects.
These models might have nodes that require HPC resources for special calculations, or initricate data structures that need to be passed to other nodes.
This is illustrated in [this sample model for molecular dynamics simulation](https://gitlab.kit.edu/kit/virtmat-tools/vre-language/-/blob/master/examples/TextM-examples/EMT_examples-H2andH2O/Langevin_NVT_H2O.vm?ref_type=heads).
This is illustrated in [this sample model](https://gitlab.kit.edu/kit/virtmat-tools/vre-language/-/blob/master/examples/TextM-examples/EMT_examples-H2andH2O/Langevin_NVT_H2O.vm) for molecular dynamics simulation.
The model requires the setup of several objects such as the [molecular structure of the system](amml.md#structure), the [calculators](amml.md#calculator) and [algorithms](amml.md#algorithm) to compute the [properties of the system](amml.md#property), variables and equations for further data manipulation and analysis, and built-in `view` statements to assist with interpretation of output data.
In this sort of cases, the [`texts script`](tools.md#script-mode) is a better-suited tool.
@@ -286,13 +287,13 @@ Once ready, the *model scripts* can be executed in either [instant, deferred](to
Concerninig the **evaluation of the models**:
1. *instant* mode will trigger immediate, local, evaluation;
2. *deferred* mode evaluation is also local ;
3. *workflow* mode local evaluation is activated with either the `--autorun | -r`, or `--on-demand | - d` flags.
3. *workflow* mode local evaluation is activated with either the `--autorun | -r`, or `--on-demand | -d` flags.
The *script mode* also allows the full separation of the execution and evaluation steps, so it is possibile to run the evaluation using `texts session` after doing, for example, `texts script --mode workflow --model-file my_example_model.vm`.
To demonstrate how to employ `texts script`, here a sample recipe to run the *molecular dynamics example* is provided:
1. Execute the model in workflow mode, `-m workflow`, indicating the name of the model script `--model-file my_file.vm`. Without the `-r` some warnings concerning non-computed data may be printed. These come about due to not computed parameters in `view` statements.
1. Download [the script](https://gitlab.kit.edu/kit/virtmat-tools/vre-language/-/blob/master/examples/TextM-examples/EMT_examples-H2andH2O/Langevin_NVT_H2O.vm) and the [atomic structure file](https://gitlab.kit.edu/kit/virtmat-tools/vre-language/-/blob/master/examples/TextM-examples/EMT_examples-H2andH2O/h2o_box.cif). Make sure to insert the absolute path to the structure filename `h2o_box.cif` in the second line of the script. Execute the model in workflow mode, `-m workflow`, indicating the name of the model script `--model-file my_file.vm`. Without the `-r` some warnings concerning non-computed data may be printed. These come about due to not computed parameters in `view` statements.
```
~>$ texts script --mode workflow --model-file Langevin_NVT_H2O.vm
@@ -307,9 +308,9 @@ To demonstrate how to employ `texts script`, here a sample recipe to run the *mo
<<<
```
2. Make sure the **structure file h2o_box.cif** file is available in the path defined within the script. Use `texts session` to perform the evaluation of the model, remembering to use the `--uuid <uuid_of_my_model>` flag to access and update the model already in the database. This step can take a few minutes. Evaluation should be completed once the `Input` prompt is printed:
2. Use `texts session` to perform the evaluation of the model, remembering to use the `--uuid <uuid_of_my_model>` flag to access and update the model already in the database. This step can take a few minutes. Evaluation should be completed once the `Input` prompt is printed:
```
(vrel-br193) [an9294@hkn1991 Langevin]$ texts session -w -r -u uuid_of_Langevin_md_model
~>$ texts session -r -u uuid_of_Langevin_md_model
Input >
```
@@ -332,7 +333,7 @@ Instant and deferred evaluation modes are avilable only in `texts script` and th
One simple recipe to use instant or deferred modes is:
```
~>$ texts script --mode [instant/deferred] -w -f my_model_file.vm
~>$ texts script --mode [instant|deferred] -f my_model_file.vm
```
This combination should work for the majority of model scripts under the aforementioned restrictions regarding local resources.
Loading