int pgemm_abt_matpan( int nb_alg, PLA_Obj alpha, PLA_Obj a, PLA_Obj b, PLA_Obj beta,  PLA_Obj c )    
{                                                                          
  < declarations >
                                                                            /* scale C by beta */
  PLA_Scal( beta, c );
                                                                  /* create constant mscalar 1 */
       < usual calls to create zero >
                                                         /* take a view of all of both C and B */
  PLA_Obj_view_all( c,           &ccur );
  PLA_Obj_view_all( b,           &bcur );
                                                   /* create dupl. pmvectors for copies of panels
                                                         of B and  contibutions to banels of C */
  PLA_Pmvector_create_conf_to( a, PLA_PROJ_ONTO_COL, PLA_ALL_COLS, nb_alg, &c1dup );
  PLA_Pmvector_create_conf_to( a, PLA_PROJ_ONTO_ROW, PLA_ALL_ROWS, nb_alg, &b1dup );
                                                              /* Loop until no more of C and B */
  while ( TRUE ) {
                                                             /* determine width of next update */
    PLA_Obj_global_width ( ccur, &width_c );
    PLA_Obj_global_length( bcur, &length_b );
    if ( ( size = min3( width_c, length_b, nb_alg )) == 0 ) break;
                                                             /* split off first column of Ccur */
    PLA_Obj_vert_split_2( ccur, size,              &c1, &ccur );
                                                                /* split off first row of Bcur */
    PLA_Obj_horz_split_2( bcur, size,              &b1, 
                                                   &bcur );
                                                                        /* size the workspaces */
    PLA_Obj_vert_split_2( c1dup, size,           &c1dup_cur, &star );
    PLA_Obj_horz_split_2( b1dup, size,           &b1dup_cur, 
                                                   &star );
                                                                         /* annotate the views */
    PLA_Obj_set_orientation( c1, PLA_PROJ_ONTO_COL );                     
    PLA_Obj_set_orientation( b1, PLA_PROJ_ONTO_ROW );                     
                                                                                  /* spread b1 */
    PLA_Copy( b1, b1dup_cur );
                                                      /* perform local matrix-panel multiplies */
    PLA_Local_gemm( PLA_NOTRANS, PLA_TRANS, alpha, a, b1dup_cur, zero,  c1dup_cur); 
                                                                 /* reduce c1dup_cur into c1 */
    PLA_Reduce( c1dup_cur, MPI_SUM, c1 );
  }
                                                                             /* Free the views */
          < usual calls >
}
