function heated_plate_parfor_test ( )

%*****************************************************************************80
%
%% heated_plate_parfor_test() uses parpool() to run the heated_plate() code in parallel.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    18 December 2023
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../heated_plate_parfor' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'heated_plate_parfor_test():\n' );
  fprintf ( 1, '  heated_plate_parfor() solves the heat equation.\n' );
  fprintf ( 1, '  The parfor() function is used for parallel execution.\n' );

  tol = 0.1;
  filename = 'solution.txt';

  for w = [ 1, 4 ]

    pool = parpool ( w );

    tic
    heated_plate_parfor ( tol, filename );
    tw = toc;

    fprintf ( 1, '  %2d  %g\n', w, tw );
    delete ( pool );

  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'heated_plate_parfor_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../heated_plate_parfor' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the Yheated_plateHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 November 2022
%
%  Author:
%
%    John Burkardt
%
  t = now ( );
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

