APPSPACK has a serial executable and library. This is not the preferred method of running APPSPACK, but it is useful for debugging purposes. The library may be used as part of a custom communication interface, see Using the Serial APPSPACK Library with a Custom Communication Interface.
Go to the directory where you have installed APPSPACK, run the configuration tool, and compile the code. |
This will create the following:
Try a simple example as follows.
- src/appspack - the default executable
- src/libappspack.a - the default library that can be linked with larger codes
- examples/example1 - a simple example executable
In serial mode, APPSPACK executes only one simulation at a time.
The APPSPACK input file,
APPSPACK in Serial Mode
example1.apps, may be adapted to your own application. It is formatted as follows.
executable = example1
n_parameters = 2
initial_point = 0.2 0.3
lower_bounds = -1 -1
upper_bounds = 1 1
scale = 1 1
params_prefix = /tmp/example1_input
result_prefix = /tmp/example1_output
The order of the parameters is important. The are described as follows.
Simulations are executed via a C stdlib system() call. In this example, the simulation is executed by the program
executable - name of the executable file (use the full path if there are any problems)
n_parameters - number of parameters to be varied
lower_bounds - lower bounds on each parameter
upper_bounds - upper bounds on each parameter
scale - scale of each parameter; ideally each parameter is O(1)
params_prefix - prefix to the input file that will be fed to the executable
result_prefix - prefix of the output file that will be created by the executable
example1 (specified by
executable in the APPSPACK input file). APPSPACK communicates with the simulation via input and ouput files.
Specifically, before writing each simulation, APPSPACK writes a file named something like
/tmp/example1_input.000_032. In this case the globally unique id, or GUID, is the 000_032. This changes for each execution of the simulation code. The prefix,
/tmp/example1_input, is specified by
params_prefix in the APPSPACK input file.
An example parameter file is formatted as follows.
The first line indicated the number of parameters, and the paramters are then listed, one per line.
The simulator will then execute the simulation via the following command
example1 /tmp/example1_input.000_032 /tmp/example1_output.000_032
The simulation itself is expected to read in the file
/tmp/example1_input.000_032 and output the file
Finally, APPSPACK will read the resulting output file, which should contain a single value. For example,
Generated on Mon Oct 27 15:14:48 2003 for APPSPACK by
1.3.4 written by Dimitri van Heesch,