function ode_sweep_parfor_test ( )

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

  bvals = 0.1 : 0.05 : 5;
  kvals = 1.5 : 0.05 : 5;

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ode_sweep_parfor_test():\n' );
  fprintf ( 1, '  ode_sweep_parfor() sweeps through sets of values of \n' );
  fprintf ( 1, '  parameters B and K, computing the solution X(T) of each\n' );
  fprintf ( 1, '  corresponding ODE.\n' );
  fprintf ( 1, '  For each solution X(T), determine the maximum value P(B,K) over time.\n' );
  fprintf ( 1, '  Construct a contour plot of P(B,K).\n' );
  fprintf ( 1, '  Use the parfor() command to carry out these computations in parallel.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of K values = %d\n', length ( kvals ) );
  fprintf ( 1, '  Number of B values = %d\n', length ( bvals ) );
  fprintf ( 1, '  Number of times the ODE must be solved = %d\n', ...
    length ( kvals ) * length ( bvals ) );
  fprintf ( 1, '\n' );

  w = 4;
  pool = parpool ( w );

  pvals = ode_sweep_parfor ( bvals, kvals );

  delete ( pool );

  ode_sweep_display ( bvals, kvals, pvals );
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'ode_sweep_parfor_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../ode_sweep_parfor' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the YhelloHMS 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

