 
 
 
 
 
 
 Next: How to install ALIAS
Up: ALIAS-C++
 Previous: Parser, Generic Solver and
   Next: How to install ALIAS
Up: ALIAS-C++
 Previous: Parser, Generic Solver and
Interval analysis has a structure that is appropriate for a distributed implementation. Indeed the principle of the algorithm is to process a list of boxes, the processing for a box being independent of the other boxes in the list (except that it may have be stopped). A classical distributed implementation will rely on the master/slave paradigm. A master computer will manage the list of boxes and monitor the activity of the slaves. As soon as a slave is free the master will send a box to this slave. The slave, which has its own list of boxes, will perform a few iteration of the solving algorithm and then send back to the master the remaining boxes to be processed in its list and eventually the solutions it has found. After receiving a signal from the slave the master will receive the boxes from the slave and append them to its list of boxes. This slave being now free the master will send him another box in its list.
Hence most of the calculation will be performed by the slaves. It may happen however that at a given time all the slaves are busy processing boxes. The master itself may then start a few iteration of the solving algorithm on the current box of its list while carefully monitoring the activity of the slaves.
The structure of the interval analysis algorithms is very convenient for using the above paradigm:
 unknowns the master will have to send 
2
 unknowns the master will have to send 
2 floating numbers that describe a box. It may however be
interesting to send other information such as the derivatives but
still the amount of data will be low
 floating numbers that describe a box. It may however be
interesting to send other information such as the derivatives but
still the amount of data will be low
The gain in computation time will in general be lower than the number of used slaves. This is due to
 before starting the processing of the box
 before starting the processing of the box
In any case a key point of a distributed implementation is to be able to
There are different methods to stop the current bisection process:
 : this is obtained by setting the global variable 
ALIAS_Parallel_Max_Bisection 
to
: this is obtained by setting the global variable 
ALIAS_Parallel_Max_Bisection 
to  .
. 
A safety procedure may be used as
the number of bisection may be large before getting the right number
of 
boxes (for example when using the single bisection mode): the
maximal number of bisection may be indicated by setting the global
variable
ALIAS_Parallel_Max_Split 
 and the procedure will return if this
number is reached and the number of unprocessed boxes
is lower than ALIAS_Parallel_Max_Bisection (otherwise the
process will continue until this number is reached).
.
. 
A safety procedure may be used as
the number of bisection may be large before getting the right number
of 
boxes (for example when using the single bisection mode): the
maximal number of bisection may be indicated by setting the global
variable
ALIAS_Parallel_Max_Split 
 and the procedure will return if this
number is reached and the number of unprocessed boxes
is lower than ALIAS_Parallel_Max_Bisection (otherwise the
process will continue until this number is reached).
 :  this is obtained by setting the global variable 
ALIAS_Parallel_Max_Bisection 
to
:  this is obtained by setting the global variable 
ALIAS_Parallel_Max_Bisection 
to  
 and the number of boxes still to be processed
 is lower than a given
threshold
 and the number of boxes still to be processed
 is lower than a given
threshold  :   this is obtained by setting the global variable 
ALIAS_Parallel_Max_Bisection 
to
:   this is obtained by setting the global variable 
ALIAS_Parallel_Max_Bisection 
to  and the global variable 
ALIAS_Parallel_Max_Box 
to
 and the global variable 
ALIAS_Parallel_Max_Box 
to  . A
safety mechanism is enforced in that case to avoid that only one of the
slave computer will perform all the computation: if
 . A
safety mechanism is enforced in that case to avoid that only one of the
slave computer will perform all the computation: if  bisections have been done the procedure will return the error code
-1. The value of
bisections have been done the procedure will return the error code
-1. The value of  is given by the global variable
ALIAS_Safety_Factor with a default value of 
2
 is given by the global variable
ALIAS_Safety_Factor with a default value of 
2 
 and the number of boxes still to be processed
 is lower than a given
threshold
 and the number of boxes still to be processed
 is lower than a given
threshold  :   this is obtained by setting the global variable 
ALIAS_Parallel_Max_Bisection 
to
:   this is obtained by setting the global variable 
ALIAS_Parallel_Max_Bisection 
to  and the global variable 
ALIAS_Parallel_Max_Reverse 
to
 and the global variable 
ALIAS_Parallel_Max_Reverse 
to  
 
 and
ALIAS_Parallel_Box[1]=
 and
ALIAS_Parallel_Box[1]= . If
. If  , then no boxes
remains to be processed otherwise the box numbers to be
processed start at
, then no boxes
remains to be processed otherwise the box numbers to be
processed start at  and finish at
 and finish at  (hence there are
 (hence there are  boxes to be processed). The boxes are stored in
the interval matrix array 
Box_Solve_General_Interval. 
If the
system has
boxes to be processed). The boxes are stored in
the interval matrix array 
Box_Solve_General_Interval. 
If the
system has  unknowns, the box for each unknown in the
box numbered
 unknowns, the box for each unknown in the
box numbered  are given by
 are given by 
 Box_Solve_General_Interval(i,n).
For procedures involving the gradient of the functions you may
retrieve the simplified gradient in the integer matrix
Box_Solve_General_Interval(i,n).
For procedures involving the gradient of the functions you may
retrieve the simplified gradient in the integer matrix
The variable ALIAS_Parallel_Slave should be set to 0 for a sequential use of the algorithm, to 1 if the algorithm is run by a master computer and to 2 if the algorithm is run by a slave computer.
Using this stop criteria we may implement a parallel version of the ALIAS procedures, see the ALIAS-Maple manual.
If the master/slave scheme is used the master may perform some steps of a solving algorithm but for efficiency purpose it is necessary that the master monitor the slaves to determine if one has completed its calculation. This is the role of the ALIAS_Slave_Returned procedure that stops the processing done by the master as soon as a slave is free. Such a procedure may be found in the lib_Slave.a library: it is based on the pvm message passing mechanism (see the ALIAS-Maple manual). For the non parallel processing the equivalent procedure may be found in the lib_No_Slave.a library. Hence according to a sequential or a parallel use one of this library has to be linked to the main program.
For solving procedures involving the use of the gradient we may use two schemes:
The ALIAS-Maple library offers a parallel implementation of some solving algorithm. Communication between the slaves and the master is ensured by the message passing mechanism pvm. See the ALIAS-Maple manual for a detailed account of the distributed implementation.
This implementation uses some specific C++ procedures.
void ALIAS_Prepare_Buffer(int DimVar,INTERVAL_VECTOR &X,char *buffer)which put in the string buffer the lower and upper bounds of the DimVar ranges contained in the interval vector X.
The master and slaves exchange strings and in the parallel implementation offered currently by ALIAS all data are contained in these strings (this may change in the near future as PVM offers other possibility). Each numerical data is introduced by few control character. The following control character are used:
Using this convention we may used the following procedure to decode the string sent by the master or the slave:
 
int ALIAS_Read_Buffer(char *mess,
          int Nb_Var, int Nb_Eq,INTERVAL_MATRIX &Box,int *Nb_Total,
          INTERVAL_MATRIX &Sol,int *Nb_Sol,int *Nb_Split,
          INTEGER_VECTOR &IPar,int *Nb_Ipar,
          VECTOR &FPar,int *Nb_Fpar,INTERVAL_MATRIX &BoxPar,
          int *Nb_BoxPar)
 
where mess is the string and
 
If is necessary we may transmit also the simplified jacobian associated to the boxes using the procedure:
 
int ALIAS_Read_Buffer_Gradient(char *mess,
          int Nb_Var, int Nb_Eq,INTERVAL_MATRIX &Box,
          INTEGER_MATRIX &GBox,int *Nb_Total,
          INTERVAL_MATRIX &Sol,int *Nb_Sol,int *Nb_Split,
          INTEGER_VECTOR &IPar,int *Nb_Ipar,
          VECTOR &FPar,int *Nb_Fpar,INTERVAL_MATRIX &BoxPar,
          int *Nb_BoxPar)
 
Here the boxes followed by the simplified jacobian GBox are introduced by the control character BG.
If the true jacobian has to be transmitted we use:
 
int ALIAS_Read_Buffer_Hessian(char *mess,
          int Nb_Var, int Nb_Eq,INTERVAL_MATRIX &Box,
          INTERVAL_MATRIX &GBox,int *Nb_Total,
          INTERVAL_MATRIX &Sol,INTEGER_VECTOR &Is_Kanto,
          int *Nb_Sol,int *Nb_Split,
          INTEGER_VECTOR &IPar,int *Nb_Ipar,
          VECTOR &FPar,int *Nb_Fpar,INTERVAL_MATRIX &BoxPar,
          int *Nb_BoxPar)
 
Here the boxes followed by the jacobian GBox are
introduced by the control character BG. 
Furthermore each solution is followed by an integer that indicates the 
type of the solution and can be accessed by Is_Kanto.
 
 
 
 
 
 
 Next: How to install ALIAS
Up: ALIAS-C++
 Previous: Parser, Generic Solver and
   Next: How to install ALIAS
Up: ALIAS-C++
 Previous: Parser, Generic Solver and
jean-pierre merlet