|
Origin Developer's Guide 1.0.2 |
|
This chapter describes how to run Origin programs and set Origin program parameters.
The easiest way to run an Origin program is to use the origin shell script or
origin.bat Windows batch file to start Origin from the
command line. These scripts are documented in
The Origin Command Line Program.
Almost all of Origin's behavior is controlled by parameters read from parameter files or set on the command line. Parameters and the parameter file hierarchy are discussed in Parameters and Parameter Files.
Finally, Origin provides a checkpointing mechanism to save and restart an evolutionary run, described in Checkpoints.
The origin shell script and
origin.bat batch file in origin/bin run the main Origin program, setting the
classpath and system environment variables to the correct values for your Origin installation. You must set your
path to include the location of the java executable before running these scripts.
The following command line options are supported:
-cp.-classpath and
JVM options are ignored. Checkpointing is described under Checkpoints.Most Origin programs write a brief summary of their progress to standard output, with more detailed logging
information written to the file origin.log in the current directory. You can change both the
location and
the level of logging by editing the Log4J configuration file
origin/conf/origin.log4j.properties, or use a different Log4J configuration file
by adding this file to the classpath and specifying
-Dlog4j.configuration=configfile on the Origin command line.
The Log4J configuration file format is documented on the
Apache Log4J web site.
Almost all of Origin's behavior is controlled by parameters read from parameter files. Origin parameter files are similar to Java property files and are almost identical to ECJ parameter files. Parameters are specified one per line in the form:
name = value
(the deprecated ECJ form name value is not supported).
Blank lines
and lines starting with # are ignored. The parameter value consists of all characters
following the = sign up to the line terminator, with leading and trailing whitespace removed.
Parameter file values are overridden by values specified on the Origin command line using the
-D or -p options.
Parameter values may interpolate other
parameter values, Java system properties, and field values from Java classes. The syntax for interpolating values
is the same as that used in Ant build files: strings of the form ${parametername} are
replaced by that parameter's value. If the named parameter does not exist the ${parameter}
string is left unchanged. This example shows the different forms of parameter interpolation:
foo = 2
bar = 4${foo}
program_banner = This is ${java.vm.version} for ${os.name}
problem_type = ${const:ec.app.ecsuite.ECSuite.PROB_ROSENBROK}
The parameter bar has the value "42", while the value of
program_banner includes the JVM version and and OS name from the Java system properties.
In the last case the const: prefix in the interpolation name
indicates that this is a reference to a Java field rather than a parameter value;
in this case PROB_ROSENBROK in
the Java class ec.app.ecsuite.ECSuite.
Interpolated Java fields must be declared static final.
Parameter values are interpreted as one of the following data types:
\uXXXX) are converted to their corresponding characters.0x or 0X it's parsed as a hexadecimal integer, while if it starts with a leading zero
it's treated as an octal number.
Anything else is considered a decimal integer. For compatibility with existing ECJ parameter files a value
starting with a leading
x or X not preceded by a zero is parsed as hexadecimal.
true or false.Origin parameter files can use the parent
property to include additional parameter files:
parent.n = pathnamewhere n is an integer starting at 0 and increasing by 1 for each parent parameter file. If a parameter is not found in a parameter file its parent parameter files (including any of their parents) are searched in depth-first sequence. This makes parent parameter files useful for setting default values and common parameters used by more than one program.
pathname is treated like any other pathname parameter- relative pathnames are interpreted relative to the directory containing the parameter file, and parameters may be interpolated into the pathname value. This allows a couple of common idioms:
parent.0 = ../common.params
myprogram.dir = /home/program/default/parameters
parent.1 = ${myprogram.dir}/program.params
In the first example a common parameter file is read from the parent directory of the containing parameter file.
The second example is a more complex: first myprogram.dir is set to the path of a
directory containing parameter files, and then
program.params is read from this directory. If we wanted to load a different
version of program.params we could use the -D command line option
to point myprogram.dir to the directory containing our alternate version:
origin -Dmyprogram.dir=/home/mystuff/parameters ...and
/home/mystuff/parameters/program.params would be read instead of
/home/program/default/parameters/program.params.
Note that using
-p parameter=value flag instead of -D won't work, because -p
parameter settings
aren't applied until
after all parameter files are read.
Origin sets the parameter origin.parameter.dir to the path of the
origin/conf/params directory in the Origin installation.
Some Origin evolutionary runs may take hours or days to complete. Origin provides a checkpointing mechanism that periodically saves the current state of the run to a file, and permits Origin to be restarted from an earlier checkpoint if the program is killed before the evolutionary run completes.
Checkpointing is enabled by setting the parameter checkpoint to true
and checkpoint-modulo to the interval in generations between checkpoints. For example,
invoking Origin with these flags:
origin -Dcheckpoint=true -Dcheckpoint-modulo=10 ...will save a checkpoint every 10 generations. Checkpoints files are saved in the current directory of the Origin program and have names of the form
ec.generation.gz. To restart a run from a checkpoint start Origin with:
origin -checkpoint checkpointfileThe evolutionary run will restart from the generation saved to that checkpoint. Origin will continue to checkpoint after being restarted, so an evolutionary run may be killed and resumed multiple times. Checkpoint files can be large, so you may want to periodically delete all but the most recent checkpoint.
| $Date: 2008-07-14 09:05:15 -0400 (Mon, 14 Jul 2008) $ |
|