#include "Bdef.h"

void sgupk_sum(MatInf, buff)
MATINFO  *MatInf;
char  *buff;
{
   int m, n, lda, i, j;
   float *A, *v;

   m = MatInf->M;
   n = MatInf->N;
   lda = MatInf->lda;
   A = (float *) MatInf->A;
   v = (float *) buff;

   if (m != 1)
   {
      for(j=0; j < n; j++)
      {
	 i = pvm_upkfloat(v, m, 1);
	 Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__);
	 for (i=0; i < m; i++) A[i] += v[i];
	 A += lda;
      }
   }
   else
   {
      i = pvm_upkfloat((float *) v, n, 1);
      Mpvmerror(i, "pvm_upkfloat", __LINE__, __FILE__);
      for (i=j=0; j < n; j++, i += lda) A[i] += v[j];
   }
}
