next up previous contents
Next: General implementation Up: Example: Parallelizing Rank-1 Update Previous: Example: Parallelizing Rank-1 Update

Simple implementation

As explained in Chapter 1, the following steps will perform the rank-1 update tex2html_wrap_inline14583 :

We will now show how to translate these operations into PLAPACK code.

Consider again the driver code for matrix-vector multiply given in Example 2.3, yielding objects a, x, and y. The following statements will perform the spread of x within columns of nodes, and the spread of y within rows of nodes:

PLA_Obj_datatype( a, &datatype );
PLA_Pvector_create( datatype, PLA_PROJ_ONTO_ROW, PLA_ALL_ROWS,
                    n, template, PLA_ALIGN_FIRST, &xdup );
PLA_Copy( x, xdup );
PLA_Pvector_create( datatype, PLA_PROJ_ONTO_COL, PLA_ALL_COLS,
                    m, template, PLA_ALIGN_FIRST, &ydup );
PLA_Copy( y, ydup );
After this, all information is available locally to perform the local rank-one update. Before doing so, we need to create duplicated multiscalar to hold the constant ``1''.
PLA_Mscalar_create( datatype, PLA_ALL_ROWS, PLA_ALL_COLS, 1, 1, template, &one );
PLA_Obj_set_to_one( one );

PLA_Local_ger( one, y, x, a );

next up previous contents
Next: General implementation Up: Example: Parallelizing Rank-1 Update Previous: Example: Parallelizing Rank-1 Update

rvdg@cs.utexas.edu