% Script to assemble matrices for a 2D diffusion problem
% Runs in spmd mode - the spmd / end lines in assemb_co.m must be active

  tic;
%
%  Set parameter values.
%
  param = p_data();
%
%  Assemble the arrays using SPMD.
%
  [M1, M2, F, b,  x, e_conn] =  assemb_co(param);
  toc;
%
%  Compute the steady state solution using GMRES.
%  Gather the sparse arrays to lab #1.
%
  spmd
    M2_g = gather(M2 , 1);
    Fb_g = gather(F+b, 1);
  end

  setup.type = 'nofill';
  [L U] = ilu(M2_g{1}, setup);
  z_ss  = gmres(M2_g{1}, -Fb_g{1}, 200, 1.e-06, 10, L, U);
  toc

