22 float * X,
int * IX,
int * JX,
int * DESCX,
int * INCX,
23 float * Y,
int * IY,
int * JY,
int * DESCY,
int * INCY )
25 void pcdotc_( 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,
"PCDOTC",
"X", *N, 1, Xi, Xj, Xd, *INCX, 6, &info );
237 PB_Cchkvec( ctxt,
"PCDOTC",
"Y", *N, 1, Yi, Yj, Yd, *INCY, 11, &info );
239 if( info ) {
PB_Cabort( ctxt,
"PCDOTC", info );
return; }
246 if( *N == 0 )
return;
250 if( ( *N == 1 ) && ( ( Xd[
M_ ] == 1 ) || ( Yd[
M_ ] == 1 ) ) )
253 PB_Cpdot11( type, *N, ((
char *) DOT), ((
char *) X), Xi, Xj, Xd, *INCX,
254 ((
char *) Y), Yi, Yj, Yd, *INCY, type->
Fvvdotc );
266 if( ( XisRow = ( *INCX == Xd[
M_] ) ) != 0 )
267 XisD = ( ( Xd[
CSRC_] >= 0 ) && ( ( XnprocsD = npcol ) > 1 ) );
269 XisD = ( ( Xd[
RSRC_] >= 0 ) && ( ( XnprocsD = nprow ) > 1 ) );
273 if( ( YisRow = ( *INCY == Yd[
M_] ) ) != 0 )
274 YisD = ( ( Yd[
CSRC_] >= 0 ) && ( ( YnprocsD = npcol ) > 1 ) );
276 YisD = ( ( Yd[
RSRC_] >= 0 ) && ( ( YnprocsD = nprow ) > 1 ) );
280 RRorCC = ( ( XisRow && YisRow ) || ( !( XisRow ) && !( YisRow ) ) );
289 PB_Cinfog2l( Xi, Xj, Xd, nprow, npcol, myrow, mycol, &Xii, &Xjj,
293 XinbD = Xd[
INB_]; XnbD = Xd[
NB_];
294 Xld = Xd[
LLD_]; Xlinc = Xld;
295 XprocD = Xcol; XmyprocD = mycol;
296 XprocR = Xrow; XmyprocR = myrow; XnprocsR = nprow;
297 XisR = ( ( Xrow == -1 ) || ( XnprocsR == 1 ) );
298 Mfirstnb( Xinb1D, *N, Xj, XinbD, XnbD );
302 XinbD = Xd[
IMB_]; XnbD = Xd[
MB_];
303 Xld = Xd[
LLD_]; Xlinc = 1;
304 XprocD = Xrow; XmyprocD = myrow;
305 XprocR = Xcol; XmyprocR = mycol; XnprocsR = npcol;
306 XisR = ( ( Xcol == -1 ) || ( XnprocsR == 1 ) );
307 Mfirstnb( Xinb1D, *N, Xi, XinbD, XnbD );
312 PB_Cinfog2l( Yi, Yj, Yd, nprow, npcol, myrow, mycol, &Yii, &Yjj,
316 YinbD = Yd[
INB_]; YnbD = Yd[
NB_];
317 Yld = Yd[
LLD_]; Ylinc = Yld;
318 YprocD = Ycol; YmyprocD = mycol;
319 YprocR = Yrow; YmyprocR = myrow; YnprocsR = nprow;
320 YisR = ( ( Yrow == -1 ) || ( YnprocsR == 1 ) );
321 Mfirstnb( Yinb1D, *N, Yj, YinbD, YnbD );
325 YinbD = Yd[
IMB_]; YnbD = Yd[
MB_];
326 Yld = Yd[
LLD_]; Ylinc = 1;
327 YprocD = Yrow; YmyprocD = myrow;
328 YprocR = Ycol; YmyprocR = mycol; YnprocsR = npcol;
329 YisR = ( ( Ycol == -1 ) || ( YnprocsR == 1 ) );
330 Mfirstnb( Yinb1D, *N, Yi, YinbD, YnbD );
335 OneDgrid = ( ( XnprocsD == 1 ) && ( YnprocsD == 1 ) );
336 OneBlock = ( ( Xinb1D >= *N ) && ( Yinb1D >= *N ) );
340 Square = ( ( Xinb1D == Yinb1D ) && ( XnbD == YnbD ) &&
341 ( XnprocsD == YnprocsD ) );
360 if( ( OneDgrid || OneBlock || Square ) && ( XprocD == YprocD ) )
374 YprocR =
MModAdd1( XprocR, XnprocsR );
392 if( ( XmyprocR != XprocR ) && ( YmyprocR != YprocR ) )
411 if( ( OneDgrid || OneBlock || Square ) && ( XprocD == YprocD ) )
428 XprocR =
MModAdd1( YprocR, YnprocsR );
451 if( ( OneDgrid || OneBlock || Square ) && ( XprocD == YprocD ) )
465 XprocR =
MModAdd1( YprocR, YnprocsR );
489 if( ( ( RRorCC && ( XprocD == YprocD ) && ( XprocR == YprocR ) ) ||
490 ( !( RRorCC ) && ( XprocD == YprocR ) && ( XprocR == YprocD ) ) ) &&
491 ( OneDgrid || OneBlock || ( RRorCC && Square ) ) )
493 if( ( !XisR && ( XmyprocR == XprocR ) &&
494 !YisR && ( YmyprocR == YprocR ) ) ||
495 ( !XisR && YisR && ( YmyprocR == YprocR ) ) ||
496 ( !YisR && XisR && ( XmyprocR == XprocR ) ) ||
499 XnpD =
PB_Cnumroc( *N, 0, Xinb1D, XnbD, XmyprocD, XprocD,
501 YnpD =
PB_Cnumroc( *N, 0, Yinb1D, YnbD, YmyprocD, YprocD,
503 if( ( XnpD > 0 ) && ( YnpD > 0 ) )
505 dot( &XnpD, ((
char *) DOT),
Mptr( ((
char *) X), Xii, Xjj, Xld,
506 size ), &Xlinc,
Mptr( ((
char *) Y), Yii, Yjj, Yld, size ),
513 if( ( XisR && YisR ) || ( XmyprocR == XprocR ) )
517 Ccgsum2d( ctxt, &scope, top, 1, 1, ((
char *) DOT), 1, -1, 0 );
519 if( RRorCC && XisR && YisR )
return;
521 else if( ( RRorCC && OneDgrid ) || OneBlock || Square )
529 if( ( YmyprocR == YprocR ) )
535 YnpD =
PB_Cnumroc( *N, 0, Yinb1D, YnbD, YmyprocD, YprocD,
539 dst = XprocD +
MModSub( YmyprocD, YprocD, YnprocsD );
540 dst =
MPosMod( dst, XnprocsD );
541 if( XisRow ) { rdst = XprocR; cdst = dst; }
542 else { rdst = dst; cdst = XprocR; }
544 if( ( myrow == rdst ) && ( mycol == cdst ) )
546 dot( &YnpD, ((
char *) DOT),
Mptr( ((
char *) X), Xii, Xjj, Xld,
547 size ), &Xlinc,
Mptr( ((
char *) Y), Yii, Yjj, Yld,
554 Yld, size ), Yld, rdst, cdst );
557 Yld, size ), Yld, rdst, cdst );
561 if( XmyprocR == XprocR )
568 XnpD =
PB_Cnumroc( *N, 0, Xinb1D, XnbD, XmyprocD, XprocD,
572 src = YprocD +
MModSub( XmyprocD, XprocD, XnprocsD );
573 src =
MPosMod( src, YnprocsD );
574 if( YisRow ) { rsrc = YprocR; csrc = src; }
575 else { rsrc = src; csrc = YprocR; }
576 if( ( myrow != rsrc ) || ( mycol != csrc ) )
580 Ccgerv2d( ctxt, 1, XnpD, buf, 1, rsrc, csrc );
582 Ccgerv2d( ctxt, XnpD, 1, buf, XnpD, rsrc, csrc );
583 dot( &XnpD, ((
char *) DOT),
Mptr( ((
char *) X), Xii, Xjj, Xld,
584 size ), &Xlinc, buf, &ione );
585 if( buf ) free( buf );
591 Ccgsum2d( ctxt,
ROW, top, 1, 1, ((
char*)DOT), 1, -1, 0 );
606 XnpD =
PB_Cnumroc( *N, 0, Xinb1D, XnbD, XmyprocD, XprocD, XnprocsD );
610 PB_Cdescset( dbuf, 1, *N, 1, Xinb1D, 1, XnbD, XprocR, XprocD, ctxt,
615 PB_Cdescset( dbuf, *N, 1, Xinb1D, 1, XnbD, 1, XprocD, XprocR, ctxt,
618 if( ( XmyprocR == XprocR ) && ( XnpD > 0 ) )
624 Yd,
ROW, type->
zero, buf, 0, 0, dbuf, ( XisRow ?
ROW :
630 Yd,
COLUMN, type->
zero, buf, 0, 0, dbuf, ( XisRow ?
634 if( XmyprocR == XprocR )
638 dot( &XnpD, ((
char *) DOT),
Mptr( ((
char *) X), Xii, Xjj, Xld,
639 size ), &Xlinc, buf, &ione );
640 if( buf ) free( buf );
645 Ccgsum2d( ctxt,
ROW, top, 1, 1, ((
char*)DOT), 1, -1, 0 );
666 if( XmyprocR == XprocR )
675 if( XmyprocR == XprocR )
678 Ccgebr2d( ctxt,
ROW, top, 1, 1, ((
char*)DOT), 1, XmyprocD,
693 if( XprocR != YprocR )
695 if( XmyprocR == XprocR )
698 Ccgesd2d( ctxt, 1, 1, ((
char *) DOT), 1, YprocR,
701 Ccgesd2d( ctxt, 1, 1, ((
char *) DOT), 1, YmyprocD,
704 else if( YmyprocR == YprocR )
707 Ccgerv2d( ctxt, 1, 1, ((
char *) DOT), 1, XprocR,
710 Ccgerv2d( ctxt, 1, 1, ((
char *) DOT), 1, XmyprocD,
721 if( YmyprocR == YprocR )
726 if( YmyprocD == XprocR )
735 if( YmyprocD == XprocR )
745 else if( !( XisD ) && YisD )
751 PB_CpdotND( type, *N, ((
char *) DOT), ((
char *) X), Xi, Xj, Xd, *INCX,
752 ((
char *) Y), Yi, Yj, Yd, *INCY, type->
Fvvdotc );
754 else if( XisD && !( YisD ) )
763 PB_CpdotND( type, *N, ((
char *) DOT), ((
char *) Y), Yi, Yj, Yd, *INCY,
764 ((
char *) X), Xi, Xj, Xd, *INCX, type->
Fvvdotc );
776 PB_CpdotNN( type, *N, ((
char *) DOT), ((
char *) X), Xi, Xj, Xd, *INCX,
777 ((
char *) Y), Yi, Yj, Yd, *INCY, type->
Fvvdotc );