next up previous contents
Next: 4.6 Completion and Synchronization Up: 4 Application Program Interface Previous: 4.4 Accessing a Vector

4.5 Accessing a Matrix

 

We provide a similar interface for adding a local matrix to a global object. place HR here

figure4679

figure4683

figure4686

place HR here Let us consider PLA_API_axpy_matrix_to_global. On the calling node, the local matrix is given by its row and column dimension, in size_row and size_col, the address where it starts in memory, in local_matrix, and the local leading dimension, local_ldim. The local matrix is assumed to use column-major storage, like FORTRAN. Thus the local leading dimension can be viewed as the stride between elements in a row of the matrix. The target object is given by obj, which can be of any object type. This time, both row and column displacement (alignments) into the object must be given, in displ_row and displ_col. The scaling parameter, in alpha, allows a multiple of the local data to be added. The operation performed is

eqnarray4344

where C represents the target (global) object and A the local matrix. The notation

displaymath13471

is used to indicate the sub-matrix of C with upper-left entry tex2html_wrap_inline13481 and lower-right entry tex2html_wrap_inline13483 . The data type of the data at the address alpha is assumed to be the same as the data type of the local matrix and the target object. Notice that the call is only performed on the node that owns the local matrix. All nodes can simultaneously perform such calls to enter local matrices in global objects.

The operation performed by PLA_API_axpy_global_to_matrix reverses the above. Now C equals the local vector and A the global, so that the operation performed becomes

displaymath13472

Again, only the node that owns the local matrix makes the call and all nodes can make similar calls simultaneously.

Often, a locally computed matrix contributes to a given object, but not as a contiguous sub-matrix. For this PLAPACK provides a call that contributes multiple sub-matrices. PLAPACK also provides the mirror operation, gathering a number of sub-matrices from a global object into a local matrix. place HR here

figure4726

figure4730

figure4733

place HR here As for the equivalent vector routines, it is important to realize that the above calls only initiate the operation. The data cannot be assumed to have arrived in the target until the object is closed, or a call to PLA_Obj_API_sync is performed for the given global object.


next up previous contents
Next: 4.6 Completion and Synchronization Up: 4 Application Program Interface Previous: 4.4 Accessing a Vector

rvdg@cs.utexas.edu