Usage and notes

See the Notes section for information on directory structure in the CVS repository.

Everything here is still work in progress . . .

Usage

There are two ways of using this system:
  1. Instantiating the classes from your own driver routine;
  2. Using the command line interface, an interactive or script-driven parser that instantiates classes and can run a simulation for you.
Since the performance bottleneck is running the simulation itself, there is no speed advantage to either approach. It is a matter of convenience and state.

The testing directory contains many examples of calling the classes directly. Although these routines were designed for testing, they are good examples for your own application.

For example, the routines testtemp2, testtemp3 and multilevel test the tempered simulation class for a single level without MPI, with MPI, and for multiple levels with MPI, respectively. Changing mulilevel to work without MPI is trivial (use the differences between testtemp2 and testtemp3 as an example).

The main test driver is multilevel, so I will discuss it in particular although the others are similar.

Run

Here, we start up a multilevel simulation on 24 processors in the Beowulf cluster. Each level will run 100 steps ( -n 100), there are two components ( -M 2), we will continue for four levels ( -N 4), print out state information ( -S), with a maximum temperature of 16384 ( -t 16384), each cell will use Legendre integration with 21 knots ( -I 21), at nice level 10 ( -P 10). The directory containing input and output files is /home/weinberg/BIE/testing .

This mpirun command calling syntax is for LAM-MPI. Others are similar. cp ../examples/Galaxy/data/galaxy.data data.dat cp ../examples/Galaxy/data/prior.dat.galaxy . mpirun -c 12 N multilevel -- -n 100 \ -M 2 -N 4 -S -t 16384 -I 21 -P 10 &! output &

The beginning of the file output is shown below.

Results

Some explanation:

  • value is the posterior probability (log)
  • mean shows the mean over the states in the simulation so far.
  • stdev is the standard deviation about the mean. For the five independent variables, the overall excursions should be larger than stdev*2. This is expected since these variables are partly dependent.
  • swaps is the number alternative tempered states that have been accepted to start. Zero so far, but we started close to the equilibrium value, so this is not unexpected.
  • up, down, prob is the log probability gained increasing in temperature and decreasing again. The probability of the new state is exp(up-down).
  • P(accept): shows the number of states accepted during mixing at each of the 23 temperature levels. We want fractions greater than 0.2 for good mixing. The mixing is good here.
Graphical output:

Each of the four figures below show the state variables and log of the posterior probability (up to an additive arbitrary constant) as a function of iteration number. You will see that 100 steps is not quite enough for convergence (but this is only an example).

Notes

The main directores in the repository are:
       doc             contains the source for this documentatation
                       in Doc++ form.  You can recompile (e.g.) the 
                       web-based by:
                                cd doc
                                make html

        include         class headers

        src             class C++ source

        libVector       source for vector class with makefile.  This is
                        well-tested production code.

        libcutils       some standard random number generators.  This is
                        not currently used . . .

        libsrnd         random variate generators, GNU string class and 
                        a few other statistical sundries from GNU libraries

        testing         contains the test drivers.  The main test routines
                        are called:

                        makedata  - used to generate "synthetic" data
                        testdata  - checks MappedGrid binning routine
                        testsimu  - tests class hierarchy with a trivial,
                                    dummy implementation of the Simulation
                                    class
                        testtemp  - creates a TemperedSimulation instance
                                    but doesn't do anything
                        testtemp2 - test tempered simulation without MPI
                        testtemp3 - test tempered simulation *with* MPI

			multilevel - multiple resolution test driver
				    *with MPI

			multilevelN - multiple resolution test driver
				    *without* MPI

                        It is only the latter two that do anything
                        meaningful and these can be made by:
                                cd testing
                                make testtemp2
                                make testtemp3
				make multilevel

	

The make file in the testing directory (Makefile may have to be tweaked). This code was developed under Linux with MPI implementation LAM 7.1.1. Besides possible include file adjustments, it should otherwise be fairly generic Unix.

The DOC++ software is part of many Linux distributions and downloadable from http://www.zib.de/Visual/software/doc++


Send suggestions, questions, and feedback to WEINBERG at ASTRO dot UMASS dot EDU.
Documentation generated at Fri Mar 26 00:35:11 2010 by doxygen