22 float * X,
int * IX,
int * JX,
int * DESCX,
int * INCX,
23 float * Y,
int * IY,
int * JY,
int * DESCY,
int * INCY )
25 void psdot_( N, DOT, X, IX, JX, DESCX, INCX, Y, IY, JY, DESCY, INCY )
29 int * INCX, * INCY, * IX, * IY, * JX, * JY, * N;
209 int OneBlock, OneDgrid, RRorCC, Square, Xcol, Xi, Xii, XinbD,
210 Xinb1D, XisD, XisR, XisRow, Xj, Xjj, Xld, Xlinc, XmyprocD,
211 XmyprocR, XnbD, XnpD, XnprocsD, XnprocsR, XprocD, XprocR,
212 Xrow, Ycol, Yi, Yii, YinbD, Yinb1D, YisD, YisR, YisRow, Yj,
213 Yjj, Yld, Ylinc, YmyprocD, YmyprocR, YnbD, YnpD, YnprocsD,
214 YnprocsR, YprocD, YprocR, Yrow, cdst, csrc, ctxt, dst, info,
215 ione=1, mycol, myrow, npcol, nprow, rdst, rsrc, size, src;
234 if( !( info = ( ( nprow == -1 ) ? -( 601 +
CTXT_ ) : 0 ) ) )
236 PB_Cchkvec( ctxt,
"PSDOT",
"X", *N, 1, Xi, Xj, Xd, *INCX, 6, &info );
237 PB_Cchkvec( ctxt,
"PSDOT",
"Y", *N, 1, Yi, Yj, Yd, *INCY, 11, &info );
239 if( info ) {
PB_Cabort( ctxt,
"PSDOT", info );
return; }
245 if( *N == 0 )
return;
249 if( ( *N == 1 ) && ( ( Xd[
M_ ] == 1 ) || ( Yd[
M_ ] == 1 ) ) )
252 PB_Cpdot11( type, *N, ((
char *) DOT), ((
char *) X), Xi, Xj, Xd, *INCX,
253 ((
char *) Y), Yi, Yj, Yd, *INCY, type->
Fvvdotu );
265 if( ( XisRow = ( *INCX == Xd[
M_] ) ) != 0 )
266 XisD = ( ( Xd[
CSRC_] >= 0 ) && ( ( XnprocsD = npcol ) > 1 ) );
268 XisD = ( ( Xd[
RSRC_] >= 0 ) && ( ( XnprocsD = nprow ) > 1 ) );
272 if( ( YisRow = ( *INCY == Yd[
M_] ) ) != 0 )
273 YisD = ( ( Yd[
CSRC_] >= 0 ) && ( ( YnprocsD = npcol ) > 1 ) );
275 YisD = ( ( Yd[
RSRC_] >= 0 ) && ( ( YnprocsD = nprow ) > 1 ) );
279 RRorCC = ( ( XisRow && YisRow ) || ( !( XisRow ) && !( YisRow ) ) );
288 PB_Cinfog2l( Xi, Xj, Xd, nprow, npcol, myrow, mycol, &Xii, &Xjj,
292 XinbD = Xd[
INB_]; XnbD = Xd[
NB_];
293 Xld = Xd[
LLD_]; Xlinc = Xld;
294 XprocD = Xcol; XmyprocD = mycol;
295 XprocR = Xrow; XmyprocR = myrow; XnprocsR = nprow;
296 XisR = ( ( Xrow == -1 ) || ( XnprocsR == 1 ) );
297 Mfirstnb( Xinb1D, *N, Xj, XinbD, XnbD );
301 XinbD = Xd[
IMB_]; XnbD = Xd[
MB_];
302 Xld = Xd[
LLD_]; Xlinc = 1;
303 XprocD = Xrow; XmyprocD = myrow;
304 XprocR = Xcol; XmyprocR = mycol; XnprocsR = npcol;
305 XisR = ( ( Xcol == -1 ) || ( XnprocsR == 1 ) );
306 Mfirstnb( Xinb1D, *N, Xi, XinbD, XnbD );
311 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
315 YinbD = Yd[
INB_]; YnbD = Yd[
NB_];
316 Yld = Yd[
LLD_]; Ylinc = Yld;
317 YprocD = Ycol; YmyprocD = mycol;
318 YprocR = Yrow; YmyprocR = myrow; YnprocsR = nprow;
319 YisR = ( ( Yrow == -1 ) || ( YnprocsR == 1 ) );
320 Mfirstnb( Yinb1D, *N, Yj, YinbD, YnbD );
324 YinbD = Yd[
IMB_]; YnbD = Yd[
MB_];
325 Yld = Yd[
LLD_]; Ylinc = 1;
326 YprocD = Yrow; YmyprocD = myrow;
327 YprocR = Ycol; YmyprocR = mycol; YnprocsR = npcol;
328 YisR = ( ( Ycol == -1 ) || ( YnprocsR == 1 ) );
329 Mfirstnb( Yinb1D, *N, Yi, YinbD, YnbD );
334 OneDgrid = ( ( XnprocsD == 1 ) && ( YnprocsD == 1 ) );
335 OneBlock = ( ( Xinb1D >= *N ) && ( Yinb1D >= *N ) );
339 Square = ( ( Xinb1D == Yinb1D ) && ( XnbD == YnbD ) &&
340 ( XnprocsD == YnprocsD ) );
359 if( ( OneDgrid || OneBlock || Square ) && ( XprocD == YprocD ) )
373 YprocR =
MModAdd1( XprocR, XnprocsR );
391 if( ( XmyprocR != XprocR ) && ( YmyprocR != YprocR ) )
410 if( ( OneDgrid || OneBlock || Square ) && ( XprocD == YprocD ) )
427 XprocR =
MModAdd1( YprocR, YnprocsR );
450 if( ( OneDgrid || OneBlock || Square ) && ( XprocD == YprocD ) )
464 XprocR =
MModAdd1( YprocR, YnprocsR );
488 if( ( ( RRorCC && ( XprocD == YprocD ) && ( XprocR == YprocR ) ) ||
489 ( !( RRorCC ) && ( XprocD == YprocR ) && ( XprocR == YprocD ) ) ) &&
490 ( OneDgrid || OneBlock || ( RRorCC && Square ) ) )
492 if( ( !XisR && ( XmyprocR == XprocR ) &&
493 !YisR && ( YmyprocR == YprocR ) ) ||
494 ( !XisR && YisR && ( YmyprocR == YprocR ) ) ||
495 ( !YisR && XisR && ( XmyprocR == XprocR ) ) ||
498 XnpD =
PB_Cnumroc( *N, 0, Xinb1D, XnbD, XmyprocD, XprocD,
500 YnpD =
PB_Cnumroc( *N, 0, Yinb1D, YnbD, YmyprocD, YprocD,
502 if( ( XnpD > 0 ) && ( YnpD > 0 ) )
504 dot( &XnpD, ((
char *) DOT),
Mptr( ((
char *) X), Xii, Xjj, Xld,
505 size ), &Xlinc,
Mptr( ((
char *) Y), Yii, Yjj, Yld, size ),
512 if( ( XisR && YisR ) || ( XmyprocR == XprocR ) )
516 Csgsum2d( ctxt, &scope, top, 1, 1, ((
char *) DOT), 1, -1, 0 );
518 if( RRorCC && XisR && YisR )
return;
520 else if( ( RRorCC && OneDgrid ) || OneBlock || Square )
528 if( ( YmyprocR == YprocR ) )
534 YnpD =
PB_Cnumroc( *N, 0, Yinb1D, YnbD, YmyprocD, YprocD,
538 dst = XprocD +
MModSub( YmyprocD, YprocD, YnprocsD );
539 dst =
MPosMod( dst, XnprocsD );
540 if( XisRow ) { rdst = XprocR; cdst = dst; }
541 else { rdst = dst; cdst = XprocR; }
543 if( ( myrow == rdst ) && ( mycol == cdst ) )
545 dot( &YnpD, ((
char *) DOT),
Mptr( ((
char *) X), Xii, Xjj, Xld,
546 size ), &Xlinc,
Mptr( ((
char *) Y), Yii, Yjj, Yld,
553 Yld, size ), Yld, rdst, cdst );
556 Yld, size ), Yld, rdst, cdst );
560 if( XmyprocR == XprocR )
567 XnpD =
PB_Cnumroc( *N, 0, Xinb1D, XnbD, XmyprocD, XprocD,
571 src = YprocD +
MModSub( XmyprocD, XprocD, XnprocsD );
572 src =
MPosMod( src, YnprocsD );
573 if( YisRow ) { rsrc = YprocR; csrc = src; }
574 else { rsrc = src; csrc = YprocR; }
575 if( ( myrow != rsrc ) || ( mycol != csrc ) )
579 Csgerv2d( ctxt, 1, XnpD, buf, 1, rsrc, csrc );
581 Csgerv2d( ctxt, XnpD, 1, buf, XnpD, rsrc, csrc );
582 dot( &XnpD, ((
char *) DOT),
Mptr( ((
char *) X), Xii, Xjj, Xld,
583 size ), &Xlinc, buf, &ione );
584 if( buf ) free( buf );
590 Csgsum2d( ctxt,
ROW, top, 1, 1, ((
char*)DOT), 1, -1, 0 );
605 XnpD =
PB_Cnumroc( *N, 0, Xinb1D, XnbD, XmyprocD, XprocD, XnprocsD );
609 PB_Cdescset( dbuf, 1, *N, 1, Xinb1D, 1, XnbD, XprocR, XprocD, ctxt,
614 PB_Cdescset( dbuf, *N, 1, Xinb1D, 1, XnbD, 1, XprocD, XprocR, ctxt,
617 if( ( XmyprocR == XprocR ) && ( XnpD > 0 ) )
623 Yd,
ROW, type->
zero, buf, 0, 0, dbuf, ( XisRow ?
ROW :
629 Yd,
COLUMN, type->
zero, buf, 0, 0, dbuf, ( XisRow ?
633 if( XmyprocR == XprocR )
637 dot( &XnpD, ((
char *) DOT),
Mptr( ((
char *) X), Xii, Xjj, Xld,
638 size ), &Xlinc, buf, &ione );
639 if( buf ) free( buf );
644 Csgsum2d( ctxt,
ROW, top, 1, 1, ((
char*)DOT), 1, -1, 0 );
665 if( XmyprocR == XprocR )
674 if( XmyprocR == XprocR )
677 Csgebr2d( ctxt,
ROW, top, 1, 1, ((
char*)DOT), 1, XmyprocD,
692 if( XprocR != YprocR )
694 if( XmyprocR == XprocR )
697 Csgesd2d( ctxt, 1, 1, ((
char *) DOT), 1, YprocR,
700 Csgesd2d( ctxt, 1, 1, ((
char *) DOT), 1, YmyprocD,
703 else if( YmyprocR == YprocR )
706 Csgerv2d( ctxt, 1, 1, ((
char *) DOT), 1, XprocR,
709 Csgerv2d( ctxt, 1, 1, ((
char *) DOT), 1, XmyprocD,
720 if( YmyprocR == YprocR )
725 if( YmyprocD == XprocR )
734 if( YmyprocD == XprocR )
744 else if( !( XisD ) && YisD )
750 PB_CpdotND( type, *N, ((
char *) DOT), ((
char *) X), Xi, Xj, Xd, *INCX,
751 ((
char *) Y), Yi, Yj, Yd, *INCY, type->
Fvvdotu );
753 else if( XisD && !( YisD ) )
759 PB_CpdotND( type, *N, ((
char *) DOT), ((
char *) Y), Yi, Yj, Yd, *INCY,
760 ((
char *) X), Xi, Xj, Xd, *INCX, type->
Fvvdotu );
768 PB_CpdotNN( type, *N, ((
char *) DOT), ((
char *) X), Xi, Xj, Xd, *INCX,
769 ((
char *) Y), Yi, Yj, Yd, *INCY, type->
Fvvdotu );