swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replicator script (was Re: run with random seed?


From: Rick Riolo
Subject: Re: Replicator script (was Re: run with random seed?
Date: Mon, 18 Jun 2001 08:56:02 -0400 (EDT)

Note that this is the kind of functionality that Drone provides,
plus many, many more features.

Also note that if your program can't handle the way
Drone passes parameters to the programs it runs, you can
a) do some custimization within the Drone control file itself
b) write a simple perl (or other) wrapper script,
   which accepts paramters as drone likes them, but then
   calls your program with parameters specfied as it likes them.

See
   www.pscs.umich.edu/CSCS/lab/documentation/SwarmStuff/drone-quicknote.html
and the reference on that page to the full Drone documentation.

One disadvantage of Drone is that it uses expect (an addon
to tcl/tk), but that is not too hard to install (at least
under linux/unix).

- r

Rick Riolo                           address@hidden
Center for Study of Complex Systems (CSCS)
4477 Randall Lab
University of Michigan         Ann Arbor MI 48109-1120
Phone: 734 763 3323                  Fax: 734 763 9267
http://www.pscs.umich.edu/PEOPLE/rlr-home.html

On Sun, 17 Jun 2001 address@hidden wrote:

> Date: Sun, 17 Jun 2001 10:35:06 -0500
> From: address@hidden
> Reply-To: address@hidden
> To: address@hidden
> Subject: Replicator script (was Re: run with random seed?
>
> "Marcus G. Daniels" wrote:
> >
> > KG> -s, --varyseed      Run with a random seed
> >
> > KG> May I take this to mean that the time is used as the random seed?
> >
> > The `seconds since 1970' * the current process id is used as the random 
> > seed.
>
> Speaking of -s, I've recently started to wish there were two more
> default command line flags in Swarm programs to ease the replication of
> simulations.  I would like a standard -S to specify a seed value and -R
> to indicate run number.  Here's why.
>
> I've written a perl program that can repeat a simulation N times while
> sweeping through a set of parameters.
>
> http://lark.cc.ukans.edu/~pauljohn/Swarm/MySwarmCode/replicator.pl
>
> In the top of the script, it explains all about it.  The script assumes
> the user's program can take a specific value for a random seed with the
> -S (or --seed=) flag and the run number -R (or --run=).  Other flags are
> program dependent.
>
> Now, if a user has a program "myThing" and wants to sweep over
> parameters, then this script makes it as easy as
>
> perl replicator.pl --program=myThing --NRUNS=10 --sweep myParam=1,2,3
> --sweep my2ndParam=0.1,0.3,0.4  --sweep my3rdParam=1000
>
> You can put as many parameters with "sweeps" as you want. You can also
> directly edit a config section of replicator.pl instead of giving the
> command line stuff.  This script presupposes the program can accept
> --seed and --run as arguments, because it creates 10 runs of the model
> for each "mix and match" combination of parameters.
>
> My opinion is that we should consider putting some script like that into
> the Swarm distribution itself, to ease the process of repeating a
> simulation many times with various seeds.
>
> As I say in the script's top part, I think drone is great and I use it
> all the time, but installation and configuration have been a major
> challenge for my associates and this script gets all the work done we
> need.
>
> I'm accepting patches/bug reports/tips.  As far as I know, I've followed
> all the good Perl housekeeping policies, with -w and the "use strict"
> pragma.
>
> After posting that script I just thought of the unlikely possibility
> that the perl rand function might draw the same number twice if a
> simulation is run 1000 times. Is that possible?  I can easily code
> around this problem, I think.
>
> --
> Paul E. Johnson                       email: address@hidden
> Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
> University of Kansas                  Office: (785) 864-9086
> Lawrence, Kansas 66045                FAX: (785) 864-5700
>
>                   ==================================
>    Swarm-Support is for discussion of the technical details of the day
>    to day usage of Swarm.  For list administration needs (esp.
>    [un]subscribing), please send a message to <address@hidden>
>    with "help" in the body of the message.
>
>


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]