The user interacts with the library through CLA_Matrix_interface
objects. Their constructor takes no arguments. A call to make_multiplier
(described below) will properly initialize them. The class has two methods
the user needs to use. First, is the multiply method. It has the
following signature:
void multiply(double alpha, double beta, double *data, void (*fptr) (void *),
void *usr_data, int x, int y);
Each element of the user's and arrays must call this method to
perform the multiplication.
The parameters alpha and beta correspond to and
in
. The same value must be passed for each
of these two parameters at each elemnts of and .
The paremeter data specifies where the data to be mutiplier is
held. This is a two-dimensional array stored in a one-dimensional array. The
size of the array is determined at creation time (based on user paremeters)
and does not have to be specified at this point. For and data
should contain the matrices to be multiplied. For , it is the destination
where the result will be stored (and if , the data which will
be multiplied by and added to ).
The fptr paremeter specifies the
callback which the library calls (at array when the computation is
complete. When it is called, it passes usr_data to it. Only
the elements of the array must specify a non-null value for fptr.
The values of x and y specify the coordinates of the calling
element in the users chare array (these should always be thisIndex.x and
thisIndex.y, respectively).
The second function of the CLA_Matrix_interface objects is the
sync method. This should be called at each element of the array when it
is ready to migrate. It takes as arguments two intergers, x and y,
which should always be thisIndex.x and thisIndex.y, respectively.
Note that migration is currently only supported for the ``2D'' algorithm.