← Back to team overview

dolfin team mailing list archive

Benchmark new ODE solvers against old ODE solver. [...]

 

Commit from logg (2005-06-23 00:52 CEST)
----------------

Benchmark new ODE solvers against old ODE solver.

The test problem src/demo/solvers/ode/bench has been updated
to compare the old ODE solver with the new solvers. The test problem
is a simple mechanical system with 1000 components. The file main.cpp
can be compiled both with the current version of DOLFIN and the old one
(version 0.4.11), but some settings need to be changed (see comments).
The solution is computed with a fixed constant and equal time step
for all components.

Now that this test has been done, I will remove the test problem.
(In a new commit so this test problem can be retrieved if necessary.)

Timing results (see below for logs):

  Old multi-adaptive solver: 6.61 s
  New multi-adaptive solver: 0.93 s
  New mono-adaptive solver:  0.26 s

(This is on my laptop, Intel Pentium M 1.4 GHz.)

Conclusion 1: The new multi-adaptive solver is a factor 7 faster than
the old one (and probably the speedup is better if the time steps are
multi-adaptive).

Conclusion 2: The overhead for the new multi-adaptive solver compared
to the new mono-adaptive solver (which we didn't have before) is a
factor 3.6 which is quite reasonable (but probably not optimal).

/Anders

Log from old multi-adaptive solver:
-----------------------------------

Automatically detected 3998 dependencies.
Solving ODE
  Solving primal problem
    Fixed point tolerance: 0.000100
    [Warning at TimeStepper.cpp:76: step()]: ODE solver is EXPERIMENTAL.
    | Time-stepping                                                   |
    |======|----------------------------------------------------------| 10.0%
    | Time-stepping                                                   |
    |=============|---------------------------------------------------| 20.0%
    | Time-stepping                                                   |
    |===================|---------------------------------------------| 30.0%
    | Time-stepping                                                   |
    |==========================|--------------------------------------| 40.0%
    | Time-stepping                                                   |
    |================================|--------------------------------| 50.0%
    | Time-stepping                                                   |
    |=======================================|-------------------------| 60.0%
    | Time-stepping                                                   |
    |=============================================|-------------------| 70.0%
    | Time-stepping                                                   |
    |====================================================|------------| 80.0%
    | Time-stepping                                                   |
    |==========================================================|------| 90.0%
    | Time-stepping                                                   |
    |=================================================================| 100.0%
    Solution computed in 6.610000 seconds.
    System is non-stiff, solution computed with simple fixed point iteration.
  Not solving the dual problem as requested.
  Not computing an error estimate. The solution may be inaccurate.
Number of fevals: 5957352

Log from new multi-adaptive solver:
-----------------------------------

Automatically detected 3998 dependencies.
Solving ODE
  *** Warning: ODE solver is EXPERIMENTAL.
  Initializing continous Galerkin method cG(1).
  Initializing PETSc (ignoring command-line arguments).
  Using multi-adaptive fixed point solver (default for mc/dG(q)).
  Using discrete tolerance tol = 0.000100.
  Computing transpose (inverse) of dependency pattern.
  | Time-stepping                                                   |
  |======|----------------------------------------------------------| 10.0%
  | Time-stepping                                                   |
  |=============|---------------------------------------------------| 20.0%
  | Time-stepping                                                   |
  |===================|---------------------------------------------| 30.0%
  | Time-stepping                                                   |
  |==========================|--------------------------------------| 40.0%
  | Time-stepping                                                   |
  |================================|--------------------------------| 50.0%
  | Time-stepping                                                   |
  |=======================================|-------------------------| 60.0%
  | Time-stepping                                                   |
  |=============================================|-------------------| 70.0%
  | Time-stepping                                                   |
  |====================================================|------------| 80.0%
  | Time-stepping                                                   |
  |==========================================================|------| 90.0%
  | Time-stepping                                                   |
  |=================================================================| 100.0%
  Multi-adaptive efficiency index: 1.000.
  Total number of (macro) time steps: 200.
  Average number of iterations per step: 1.89.
  Solution computed in 0.930000 seconds.
  Not computing an error estimate. The solution may be inaccurate.
Number of fevals: 4579000

Log from new mono-adaptive solver:
-----------------------------------

Automatically detected 3998 dependencies.
Solving ODE
  *** Warning: ODE solver is EXPERIMENTAL.
  Initializing continous Galerkin method cG(1).
  Initializing PETSc (ignoring command-line arguments).
  Using mono-adaptive fixed point solver (default for c/dG(q)).
  Using discrete tolerance tol = 0.000100.
  Warning: consider implementing mono-adaptive ODE::f() to improve efficiency.
  | Time-stepping                                                   |
  |======|----------------------------------------------------------| 10.0%
  | Time-stepping                                                   |
  |=============|---------------------------------------------------| 20.0%
  | Time-stepping                                                   |
  |===================|---------------------------------------------| 30.0%
  | Time-stepping                                                   |
  |==========================|--------------------------------------| 40.0%
  | Time-stepping                                                   |
  |================================|--------------------------------| 50.0%
  | Time-stepping                                                   |
  |=======================================|-------------------------| 60.0%
  | Time-stepping                                                   |
  |=============================================|-------------------| 70.0%
  | Time-stepping                                                   |
  |====================================================|------------| 80.0%
  | Time-stepping                                                   |
  |==========================================================|------| 90.0%
  | Time-stepping                                                   |
  |=================================================================| 100.0%
  Total number of (macro) time steps: 200.
  Average number of iterations per step: 1.89.
  Solution computed in 0.260000 seconds.
  Not computing an error estimate. The solution may be inaccurate.
Number of fevals: 4579000

  dolfin  src/demo/solvers/ode/bench/main.cpp  1.9