#include #include #include #include "mpl_blas.h" #define PRECISION float /* #define DEBUG */ /*************************************************************************** * * * DATA PARALLEL BLAS based on MPL * * * * Internal routine, this routine is not supposed to be * * called by user programs. * * * * Version 1.0 1/4-92 , * * For MasPar MP-1 computers * * * * para//ab, University of Bergen, NORWAY * * * * The calling sequence may be changed in a future version. * * Please report any BUGs, ideas for improvement or other * * comments to * * adm@parallab.uib.no * * * * Future versions may then reflect your suggestions. * * The most current version of this software is available * * from netlib@nac.no , send the message `send index from maspar' * * * * REVISIONS: * * * ***************************************************************************/ #ifdef __STDMPL__ visible void mpl_sgemv1(int m, int n, PRECISION alpha, plural PRECISION *a, plural PRECISION *x, PRECISION beta, plural PRECISION *y) #else visible void mpl_sgemv1(m, n, alpha, a, x, beta, y) PRECISION alpha, beta; int m, n; register plural PRECISION *a,*x,*y; #endif /* MasPar Blas 2 routine y := beta*y + alpha*A*x written July 20, 1990 revised November 1, 1990 NEW VERSION Dec 12, 1990 (array A has columns in the x-direction) by Erik Boman, University of Bergen * Comments: * works only for m and n < nproc * the use of register variables should be optimized */ { register plural PRECISION sum, xtmp, ytmp; register plural PRECISION *xtemp; register int i,j; register int mask; int nbx,nby,ncols; register plural int ix=ixproc, iy=iyproc; /* put pointer arguments into local variables */ #ifdef DEBUG extern show(); #endif if (m>nproc) { printf("Error in mpl_sgemv1 : m > nproc\n"); exit(1); } if (n>nproc) { printf("Error in mpl_sgemv1 : n > nproc\n"); exit(1); } /* * Form A*x */ if ((m <= nxproc) && (n <= nyproc)){ #ifdef DEBUG printf(" Parameters to mpl_sgemv1: m= %d n= %d \n", m,n); { plural PRECISION debug = *x; show(&debug,nyproc,nxproc,"x"); } #endif /* first "transpose" x (towards SW) */ if (iy == 0){ xtmp = *x; xnetcSW[n-1].xtmp = xtmp; } #ifdef DEBUG { plural PRECISION debug = xtmp; show(&debug,nyproc,nxproc,"x'"); } #endif sum = zero; /* distributing x */ if (ix == 0){ xnetcE[m-1].xtmp = xtmp; } #ifdef DEBUG { plural PRECISION debug = xtmp; show(&debug,nyproc,nxproc,"x' after distribution"); } #endif /* multiplying */ if (iy PE grid */ /* * End of mpl_sgemv1 . */ }