#include #include #include #include "mpl_blas.h" #define PRECISION double /* #define DEBUG */ visible void mpl_dgemv1(m, n, alpha, a, x, beta, y) /*************************************************************************** * * * 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: * * * ***************************************************************************/ PRECISION alpha, beta; int m, n; register plural PRECISION *a,*x,*y; /* 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_dgemv1 : m > nproc\n"); exit(1); } if (n>nproc) { printf("Error in mpl_dgemv1 : n > nproc\n"); exit(1); } /* * Form A*x */ if ((m <= nxproc) && (n <= nyproc)){ #ifdef DEBUG printf(" Parameters to mpl_dgemv1: m= %d n= %d \n", m,n); { plural double 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 double debug = xtmp; show(&debug,nyproc,nxproc,"x'"); } #endif sum = zero; /* distributing x */ if (ix == 0){ xnetcE[m-1].xtmp = xtmp; } #ifdef DEBUG { plural double debug = xtmp; show(&debug,nyproc,nxproc,"x' after distribution"); } #endif /* multiplying */ if (iy PE grid */ /* * End of mpl_dgemv1 . */ }