If result==STOP or result==ESTN or result==EPOK, then the following mem- ber functions can be used to inquire about the estimate of a given parameter:
mean = sa1.getmean(n) ; // for the estimate of the mean of then-th // parameter
where mean is a variable of type double, and parameter number is an int. The following optional statistics are also provided:
stderr = sa1.getstderr(n) ; // for the standard error of // the estimator of the n-th parameter
sigma = sa1.getsigma(n) ; // for the relative precision of the estimate // of the n-th parameter
rlength = sa1.getrlength(n); // for the number of observations used // to obtain this estimate
ntrans = sa1.getntrans(n) ; // for the number of observations discarded // during the warmup period of the n-th parameter The variables stderr, sigma and mean are of type double, and rlength and ntrans are int.
Dynamic Precision Specication
Another requirement, often arising when exploring a large design space by means of simulation, is to focus attention on regions of the design space where a critical parameter is within a zone of interest. For example, if we are interested in the behaviour of a LAN under congestion, we may be interested in studying the case when the mean packet delays of stations exceed a given threshold. As a result, we could save the simulation time, if our simulation experiment can be stopped as soon as we are condent (in a statistical sense) that mean packet delays are outside our zone of interest. To satisfy such requirements, several new forms of the Spectralanalysis precision control object have been introduced.
Declaration
For dynamic precision specication, when the required precision varies with the estimated value of the parameter, we should declare a Spectralanalysis object like this:
Spectralanalysis sa2(max precision, condence, constraint, threshold, num parameter); where max precison and condence are dened as above. In this example we chose
the name sa2 for the instance of the object of type Spectralanalysis. constraint is either GEQ or LEQ denoting greater or less than or equal to, respectively. If constraint==LEQ,the meaning is that if the estimated parameter is less than or
equal to threshold, precision control is abandoned, otherwise the required precision is smaller or equal to max precision.
Object Use
To use the sa2 object for precision control in our program, add the following call to the program after the generation of an observation
result = sa2.processnewobs( new observation , parameter num) ;
where result is of type int, new observation is a double, parameter num is a double containing the value of the new observation, and parameter num is an int contain- ing the index of the parameter being estimated. This function returns one of the following int values:
STOP // Stop simulation; required precision of estimate(s) has been achieved
CONT // Continue collect observations; the desired precision has not been reached yet;
ITRP // Process still in transient stage
ESTN // Precision at a checkpoint was estimated, but the required precision has been not reached yet; continue collect observations SABP // An estimation was performed, abandon precision control (stop). If result==STOP or result==ESTN or result==SABP, then the functions intro- duced for objects related with single parameter estimation, can be also used to query results.
5.4.3 Random Number Generator Selection
During runtime, each activation of an AKAROA simulation program (simulation engine) must be driven by a unique random number stream. Users have the option of choosing the size (period) of these generators, and consequently the maximum number of simulation engines that can be employed on a simulation run.
When launched, each simulation engine rst contacts and registers with AKAROA's Directory Central process. One function of Directory Central is to allocate unique (virtual) random number generators by dispensing seeds to each simulation engine. These mutually uncorrelated virtual random number generators were produced by
extracting seeds from AKAROA's base multiplicative congruential generator which have a period of 231
,1, each seed pointing to a location in a random number se-
quence that is spaced from that of other seeds. For this reason, the smaller the size of virtual generator selected, the greater number of simulations can be used. The default generators used have a MEDIUM period of approximately 100000000, enabling up to twenty two simulation engines. Alternative generator choices, and their respective sizes are listed in Table 5.1. Suppose that we have declared sa1 to be an object of type Spectralanalysis. Then if we wish to use generators other then the default ones, we should invoke
sa1.set generator( type) ;
after declaring the sa1 object, before any calls to the random number generator. typecan be any of those listed in Table 5.1. As we can see from Table 5.1, currently up to forty four simulation engines can operate in parallel when each is using a generator which have a period equal to approximately 48000000. These "virtual" generators are dened by seeds obtained by segmenting the random number stream generated by AKAROA's base multiplicative congruential generator which have a period of 231
,1, into 44 disjoint sub-sequences.
One option for future research is the evaluation of additional random number generators suited for AKAROA's use. Incorporating more mutually uncorrelated generators in AKAROA would enabling the use of more simulation engines in parallel. By mutually uncorrelated, we mean that if we concatenated the sequences of pseudo-random numbers from each generator into a "macro-sequence", then the macro-sequence should also quality as a random sequence. The quality of the generators with respect to SA-PTS would include the degree in which they are mutually uncorrelated, in addition to randomness of individual generators, and their computational eciency and period.
Checkpoint Distribution
Within each simulation engine, and for each parameter, spectral analysis is per- formed to obtain an estimate of the precision of the local estimate at cheakpoints. Checkpoint locations are indicated by the number of steady state observations generated for the parameter by the simulation engine. By default, the distance between checkpoints increases geometrically where the rst checkpoint is deter- mined from the nature of the simulated process, thus following the well tested procedure in [PAWL91]. Alternatively, constant distances may be desired. To adopt this option, include the statement
sa1.set checkpoint type( CONST) ;
Table 5.1: Selection of random number generators in AKAROA
following the declaration of the Spectralanalysis object. Both checkpoint distri- bution options were evaluated, and their impact on the quality of estimators, and on the execution overhead, and the amount of communication required between machines are reported in Chapter 6.
5.4.4 Programming Interface for Parallel Simulations
To transform an existing sequential simulator which uses the spectral analysis object of AKAROA Control for precision control of estimates, into a simulator suited for parallel execution using the SA-PTS methodology, only a single word in the program needs to be capitalised. This is done simply by changing declaration of the precision control from
Spectralanalysis sa1(...) ; into
SPECTRALANALYSIS sa1(...) ; No other changes are necessary.
There are many attractive aspects of this 'invisible' parallel simulation man- ager interface. One is that the resulting parallel simulation program would appear essentially identical to the ordinary sequential simulator, both syntactically and semantically, no matter which of the various precision control options are used, or whether we are estimating one or multiple parameters. This totally shields
the user from the complexities of parallel programming and debugging, giving the user an illusion of a normal sequential program, thereby achieving our rst aim for AKAROA. The advantage is that the user can concentrate on building a correct se- quential simulator, the transformation to a parallel simulator being overhead free. For instance, recall from section 4.2.2 that a parallel simulation based on SA-PTS exists as a set of simulation processes (simulation engines) which cooperate with a set of global precision control processes, one precision control process for each parameter being estimated. Yet, the user need not be concerned with nor aware of the need for, or existance of the simulation and precision control processes, when writing a simulation program. During runtime, is a simulation engine need to contact a global precision control process, the machine address and port number of that process must be (somehow) located. Notice that the name of the machines where the global precision control processes might exist, and their port numbers, do not have to be specied. If the estimation process which is responsible for an estimator doesn't exist, one must be created, and this is also handled transpar- ently. Also at runtime each simulation process must be driven by a unique random number stream and this too is done automatically. Moreover, possible faults in the communications network between a processor running the simulation instance and another one running the estimation process must be detected and resolved. These tasks are handled invisibly, so the user is not attend to them during the programming phase.
Another signicant advantage is that any existing simulator whether written in C, C++, or a package that enables the import of C/C++ routines can easily be augmented with AKAROA's precision control objects for runlength control and hence be automatically transformed into a simulator suited for parallel execution.