commit bbfc7b50d2f4e27de5bcb29e6e6160e22e332a35
parent 73d7c28eaca2cac0191274d2208b51397aea94e2
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 4 Jun 2019 15:28:55 +0200
Write the documentation of the -G option
Diffstat:
3 files changed, 34 insertions(+), 15 deletions(-)
diff --git a/doc/solstice.1.txt.in b/doc/solstice.1.txt.in
@@ -86,8 +86,26 @@ respectively, while -D__alpha__,90 will produce {0,0,-1} regardless of _alpha_
value.
*-f*::
- Force overwrite of the _output_ file.
-
+ Force overwrite of the output files, i.e. the _output_ file and the file
+ where the state of the random number generator is saved (see the *-G*
+ option).
+
+*-G* <__sub-option__:...>::
+ Save and restore the state of the random number generator. This option can be
+ used to ensure the statistical independence between successive simulations
+ on the same system. For instance, one can run a new simulation and
+ initialising its random number generator with the final state of the
+ generator as defined by the previous run. Available sub options are:
+
+ **istate=**_input_rng_state_;;
+ Define the file from which the initial state of the random number generator
+ is read. If not defined, the random number generator is initialised with
+ its default seed.
+
+ **ostate=**_output_rng_state_;;
+ Define the file where the final state of the random number generator is
+ written. If not defined, this state is simply discarded.
+
*-g* <__sub-option__:...>::
Generate the shape of the geometry defined in the submitted _file_ and store
it in _output_. Available sub-options are:
@@ -239,9 +257,9 @@ remaining data to the *feh*(1) image viewer.
COPYRIGHT
---------
-*solstice* is copyright © 2016-2018 CNRS. License GPLv3+: GNU GPL version
-3 or later <http://gnu.org/licenses/gpl.html>. This is a free software. You are
-free to change and redistribute it. There is NO WARRANTY, to the extent
+Copyright © 2016-2018 CNRS, 2018-2019 |Meso|Star>. License GPLv3+: GNU GPL
+version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software.
+You are free to change and redistribute it. There is NO WARRANTY, to the extent
permitted by law.
SEE ALSO
diff --git a/src/solstice.c b/src/solstice.c
@@ -637,14 +637,6 @@ solstice_init
res = setup_sun_dirs(solstice, args);
if(res != RES_OK) goto error;
- if(!args->output_filename) {
- solstice->output = stdout;
- } else {
- res = open_output_stream(args->output_filename, args->force_overwriting,
- &solstice->output);
- if(res != RES_OK) goto error;
- }
-
if(args->rng_state_input_filename) {
solstice->rng_state_input = fopen(args->rng_state_input_filename, "r");
if(!solstice->rng_state_input) {
@@ -660,6 +652,14 @@ solstice_init
if(res != RES_OK) goto error;
}
+ if(!args->output_filename) {
+ solstice->output = stdout;
+ } else {
+ res = open_output_stream(args->output_filename, args->force_overwriting,
+ &solstice->output);
+ if(res != RES_OK) goto error;
+ }
+
res = load_data(solstice, args);
if(res != RES_OK) goto error;
diff --git a/src/solstice_args.c b/src/solstice_args.c
@@ -46,9 +46,10 @@ print_help(const char* program)
printf(
" -D <dirs> list of sun directions.\n");
printf(
-" -f overwrite the OUTPUT file if it already exists.\n");
+" -f overwrite the output files if they already exist, i.e. the\n"
+" OUTPUT file and the output RNG state.\n");
printf(
-" -G <rng> configure the random number generator.\n");
+" -G <rng> save and restore the state of the random number generator.\n");
printf(
" -g <dump> switch in dump geometry mode and configure it.\n");
printf(