Quicknote on using Drone
Drone is a Tcl/Tk script that makes it easy to run (and rerun)
simulation experiments. To run an experiment using drone, one
must specify:
- the program to be run, and the directory in which it is located.
- some directories into which simulation output, errors and log
entries will be written.
- some base parameters settings which will be common to
all runs of the experiment.
- some "sweep" parameters to vary as part of the experiment,
and values to assign to those parameters for each "case."
and a few other items (e.g., an email address to which a message
should be sent when the experiment is done.).
To be used with drone, a program must meet
certain specifications. In some cases it possible to write
a "wrapper" script that in effect makes a program that
does not meet drone specifications look like it does. This is the
approach taken with the Lilgp GP program (see below).
There is
full online documentation for Drone, which you can
read for to see all the gory details, some examples, etc.
The rest of this page shows a couple of examples of how to
use drone, one with a Swarm-based program, and one with
a Lilgp based program.
IMPORTANT NOTE on data from experiments.
Experiments can generate very large amounts of data.
Because the data produced from experiments can be re-generated
(i.e., just by re-running the experiment that generated the data),
we ask you NOT
to put that data in (or below) your home directory, which
is backed up to tape each Friday night
(and is mirrored to disks every night).
Instead, to reduce the burden on our tape backup system,
please place output data from experimental runs on our scratch disks.
The scratch areas are mirrored each day, so there is protection from
disk failure; however, the scratch areas are not backed up to tape.
For more information about the scratch disk areas, see our
scratch disks description.
For detailed instructions on how to use the scratch space
with drone/Swarm/UM-ExpTools experiments, please see the description on
how to run experiments with the Tipping program.
All the steps you need to do are described in that example.
Using Drone with Swarm-based Programs
Swarm-based programs can be used with drone if they meet drone's
interface and output requirements.
All the CSCS Demo programs, which are compiled
with the UM-ExptTools lib for parameter processing,
meet drone's requirements.
See the directory
/users/rlr/SwarmStuff/CSCS-Demos
for these demos, including Schelling's Tipping Model,
some Iterated Prisoner's Dilemma models, and Axelrod's cultural
diversity model.
For detailed instructions on how to use drone with one
of those programs, see
How to use drone with the CSCS Tipping program.
Similar steps can be used to use Drone to run
experiments with any Swarm/UM-ExpTools program.
Using Drone with Lilgp GP applications
Because lilgp does not accept the basic run-time
parameters drone uses to control experimental runs,
we have to use a 'wrapper' script, i.e., a script
which takes drone-type run time parameters on its
command line, and then emits a a lilgp run command
with those same parameter values.
The file /users/rlr/GP/Lilgp/lilgpwrap
is an example lilgpwrap script that can be used to run with drone.
The key line that must be changed in that script is right near
the top of the file:
set wrap(appPath) "/old/users/rlr/GP/Lilgp/regression/gp"
That line should be pointed to the program you want to run.
To put it another way: for every lilgp program you with drone,
you need to copy the lilgpwrap and then edit that copy
to point to the program you want to run.
Once you have done that, you can tell drone to run that
lilgpwrap script in the drone control file, just as one does
for any program to be used with drone.
An example, in the directory
/users/rlr/GP/Lilgp/regression/Exper1
there is a control file, test-1.ctrl. This file points drone
to the program to run with these lines at the top of that file:
param rootDir = /users/rlr/GP/Lilgp/regression/Exper1
param programDir = /users/rlr/GP/Lilgp/regression
param programName = lilgpwrap
As with other drone control files (see above), the rootDir
specifies the directory into which the errorlogs, expdata,
logs and hostfiles (if any) are located.
The programDir specifies the directory in which the program
drone is to run is located, in thise case, your lilgpwrap
script. You will want to change those two lines
so they point to some place in your own file space
(i.e., under your home directory somewhere).
And the programName is the program to run, i.e., lilgpwrap.
There are then two lines, one that names the log file for the
series of experiments (related runs of drone), and one that
specifies an email-addr for the person doing the runs:
param seriesLogFile = regression.log
param emailAddr = rlriolo@umich.edu
Drone will send messages to this address, e.g., on error or
when an experiment is done.
Thus you will want to change these lines, too.
The test-1.ctrl file also specifies that the following
subdirectories be used:
errorlogs/
expdata/
logs/
hostfiles/
There is no reason to change these, unless you have
some other names you would prefer for these directories.
The way I used it was:
cd /users/rlr/GP/Lilgp/regression/Exper1
drone test-1.ctrl
The other common things to change in such a *.ctrl file are:
- numRuns number of runs with different seeds for
each "case" (combination of parameter values)
- useLocalHost 1 means only on local host
0 means uses hosts in hostFile
- hostFile list of hosts to use. Currently these
must be PSCS hosts, and you must have the same
login and password on all of them.
- Program specific parameters in the section demarked with:
@begin
...
@end
These are the 'base' settings for parameters.
- Sweep parameter control.
These define the 'cases' to be run, and override the
base parameter settings
In particular, in test-1.ctrl I have these lines for
setting base parameters and sweeping:
begin input file
###
### sample input parameter file for symbolic regression.
###
pop_size = 100
max_generations = 20
random_seed = 1111
#output.basename = regress
# how to generate the initial population
init.method = half_and_half
init.depth = 2-6
# limits on tree size.
max_depth = 17
## breeding parameters (emulates Koza Ch. 7)
breed_phases = 2
breed[1].operator = crossover, select=fitness
breed[1].rate = 0.9
breed[2].operator = reproduction, select=fitness
breed[2].rate = 0.1
end input file
sweep max_generations 20 40 60
sweep pop_size 50 100 200
This will result in 9 cases for the various combinations
of the max_generations and pop_size parameters.
Using Drone under Windows
The following steps have been used by some users to
get Drone to work on their windows machines.
Note you will need to have the cygwin unix emulator
package installed (it comes with the Swarm installation
for Windows).
If you try out these instructions, and find problems with
any of the steps, please let us know so we can
correct/amend the instructions.
1) Download Expect for NT from:
http://bmrc.berkeley.edu/people/chaffee/expectnt.html
2) Run the Expect setup program (a windows executable) to install it
into a directory, say c:/Expect
3) Assuming you are using a Cygwin bash shell, in your .bash_login,
update your path variable to include your bin directory for expect. A
simple way to do it for this case is:
PATH=$PATH:/Expect/bin
Note: this step may not be necessary since the drone file includes a
line which tells it the location of the exact executable.
4) Install a copy of Drone on your machine in say, c:/Drone. Note that
you may need to change the file c:/Drone/Makefile to add a line:
CC=gcc
Also, you may need to change c:/Drone/examples/stublet/Makefile to
explicitly use gcc in the same way.
After making those two changes, you can run the following command from
the c:/Drone directory:
make install
5) Change the first line of the drone file to use your local version of
expect. So, in this case the first line would be:
#!/Expect/bin/expect.exe --
(Note: this assumes you already have Cygwin installed and are using a
bash shell and can therefore reference the c:/Expect directory as simply
/Expect)
6) Assuming you are now in the drone directory, you can test the
installation by typing:
./drone -v (This gives the version number)
./drone -h (This gives the help output)
For some reason, you have to use the "./drone" syntax instead of simply
"drone".
You can also try out the stublet example included with the Drone (see
the Drone documentation). Note here, that in creating directories in
cygwin bash only allows directory names without slashes. So, you cannot
execute a command like:
mkdir tmp/
Instead, the command must be:
mkdir tmp
You may need to change the stublet.ctrl file to make sure the names of
directories do not have slashes following them.
Note also that drone on windows will not send email after the experiment
is finished unless you have configured some kind of sendmail tool.