High Performance Computing 1
MatVec.f
•
else
c   slaves receive b, then compute dot products until
c   done message received        
call MPI_BCAST(b, cols, MPI_DOUBLE_PRECISION, master,     
    &                   MPI_COMM_WORLD, ierr)
c        skip if more processes than work        
if (rank .gt. rows)    
goto 200     
90            call MPI_RECV(buffer, cols, MPI_DOUBLE_PRECISION, master,     
    &                  MPI_ANY_TAG, MPI_COMM_WORLD, status, ierr)        
if (status(MPI_TAG) .eq. 0) then           
go to 200        
else           
row = status(MPI_TAG)           
ans = 0.0           
do 100 i = 1,cols              
  ans = ans+buffer(i)*b(i)
100          continue