Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71716 - in sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta: . performance
From: mario.mulansky_at_[hidden]
Date: 2011-05-04 12:18:34


Author: mariomulansky
Date: 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
New Revision: 71716
URL: http://svn.boost.org/trac/boost/changeset/71716

Log:
more on performance
Added:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/nr_rk54ck.cpp (contents, props changed)
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/perf_analysis.py (contents, props changed)
Text files modified:
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_algebra.hpp | 60 ++++++++++++++++++++++++++++++---------
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/Jamfile | 8 ++++-
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/generic_rk54ck.cpp | 19 +++++++-----
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/gsl_rk54ck.cpp | 9 ++++--
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/odeint_rk54ck.cpp | 6 +++
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/odeint_rk54ck_def_alg.cpp | 6 +++
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/perf_tests.py | 8 ++--
   sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/results.dat | 16 +++++-----
   8 files changed, 91 insertions(+), 41 deletions(-)

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_algebra.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_algebra.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_algebra.hpp 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -10,6 +10,8 @@
 
 #include <boost/array.hpp>
 
+#include <iostream>
+
 
 template< size_t n >
 struct fusion_algebra
@@ -17,11 +19,11 @@
     template< typename T , size_t dim >
     inline static void foreach( boost::array< T , dim > &x_tmp , const boost::array< T , dim > &x ,
             const boost::array< double , n > &a ,
- const boost::array< T , dim > *k_vector , const double dt )
+ const boost::array< T , dim > k_vector[n] , const double dt )
     {
         for( size_t i=0 ; i<dim ; ++i )
         {
- x_tmp[i] = x[i];
+ x_tmp[i] = x[i];// + a[0]*dt*k_vector[0][i];
             for( size_t j = 0 ; j<n ; ++j )
                 x_tmp[i] += a[j]*dt*k_vector[j][i];
         }
@@ -30,7 +32,7 @@
     template< typename T , size_t dim >
     inline static void foreach( boost::array< T , dim > &x_tmp ,
                 const boost::array< double , n > &a ,
- const boost::array< T , dim > *k_vector , const double dt )
+ const boost::array< T , dim > k_vector[n] , const double dt )
     {
         for( size_t i=0 ; i<dim ; ++i )
         {
@@ -61,7 +63,8 @@
     {
         for( size_t i=0 ; i<dim ; ++i )
         {
- x_tmp[i] = x[i] + a[0]*dt*k_vector[0][i];
+ x_tmp[i] = x[i];
+ x_tmp[i] += a[0]*dt*k_vector[0][i];
         }
     }
 
@@ -79,7 +82,9 @@
     {
         for( size_t i=0 ; i<dim ; ++i )
         {
- x_tmp[i] = x[i] + a[0]*dt*k_vector[0][i] + a[1]*dt*k_vector[1][i];
+ x_tmp[i] = x[i];
+ x_tmp[i] += a[0]*dt*k_vector[0][i];
+ x_tmp[i] += a[1]*dt*k_vector[1][i];
         }
     }
 
@@ -97,7 +102,10 @@
     {
         for( size_t i=0 ; i<dim ; ++i )
         {
- x_tmp[i] = x[i] + a[0]*dt*k_vector[0][i] + a[1]*dt*k_vector[1][i] + a[2]*dt*k_vector[2][i];
+ x_tmp[i] = x[i];
+ x_tmp[i] += a[0]*dt*k_vector[0][i];
+ x_tmp[i] += a[1]*dt*k_vector[1][i];
+ x_tmp[i] += a[2]*dt*k_vector[2][i];
         }
     }
 
@@ -114,8 +122,11 @@
     {
         for( size_t i=0 ; i<dim ; ++i )
         {
- x_tmp[i] = x[i] + a[0]*dt*k_vector[0][i] + a[1]*dt*k_vector[1][i] +
- a[2]*dt*k_vector[2][i] + a[3]*dt*k_vector[3][i];;
+ x_tmp[i] = x[i];
+ x_tmp[i] += a[0]*dt*k_vector[0][i];
+ x_tmp[i] += a[1]*dt*k_vector[1][i];
+ x_tmp[i] += a[2]*dt*k_vector[2][i];
+ x_tmp[i] += a[3]*dt*k_vector[3][i];
         }
     }
 
@@ -132,9 +143,12 @@
     {
         for( size_t i=0 ; i<dim ; ++i )
         {
- x_tmp[i] = x[i] + a[0]*dt*k_vector[0][i] + a[1]*dt*k_vector[1][i] +
- a[2]*dt*k_vector[2][i] + a[3]*dt*k_vector[3][i] +
- a[4]*dt*k_vector[4][i];
+ x_tmp[i] = x[i];
+ x_tmp[i] += a[0]*dt*k_vector[0][i];
+ x_tmp[i] += a[1]*dt*k_vector[1][i];
+ x_tmp[i] += a[2]*dt*k_vector[2][i];
+ x_tmp[i] += a[3]*dt*k_vector[3][i];
+ x_tmp[i] += a[4]*dt*k_vector[4][i];
         }
     }
 
@@ -151,13 +165,31 @@
     {
         for( size_t i=0 ; i<dim ; ++i )
         {
- x_tmp[i] = x[i] + a[0]*dt*k_vector[0][i] + a[1]*dt*k_vector[1][i] +
- a[2]*dt*k_vector[2][i] + a[3]*dt*k_vector[3][i] +
- a[4]*dt*k_vector[4][i] + a[5]*dt*k_vector[5][i];
+ x_tmp[i] = x[i];
+ x_tmp[i] += a[0]*dt*k_vector[0][i];
+ x_tmp[i] += a[1]*dt*k_vector[1][i];
+ x_tmp[i] += a[2]*dt*k_vector[2][i];
+ x_tmp[i] += a[3]*dt*k_vector[3][i];
+ x_tmp[i] += a[4]*dt*k_vector[4][i];
+ x_tmp[i] += a[5]*dt*k_vector[5][i];
+ }
+ }
+
+ template< typename T , size_t dim >
+ inline static void foreach(boost::array<T , dim> &x_tmp ,
+ const boost::array<double , 6> &a ,
+ const boost::array<T , dim> *k_vector , const double dt)
+ {
+ for (size_t i = 0 ; i < dim ; ++i)
+ {
+ x_tmp[i] = a[0] * dt * k_vector[0][i] + a[1] * dt * k_vector[1][i]
+ + a[2] * dt * k_vector[2][i] + a[3] * dt * k_vector[3][i]
+ + a[4] * dt * k_vector[4][i] + a[5] * dt * k_vector[5][i];
         }
     }
 
 };
 */
 
+
 #endif /* FUSION_ALGEBRA_HPP_ */

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/Jamfile
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/Jamfile (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/Jamfile 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -50,11 +50,15 @@
     ;
     
 exe odeint_rk54ck
- : odeint_rk54ck.cpp
+ : odeint_rk54ck.cpp
     ;
     
 exe odeint_rk54ck_def_alg
- : odeint_rk54ck_def_alg.cpp
+ : odeint_rk54ck_def_alg.cpp
+ ;
+
+exe nr_rk54ck
+ : nr_rk54ck.cpp
     ;
     
 exe gsl_rk54ck

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/generic_rk54ck.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/generic_rk54ck.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/generic_rk54ck.cpp 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -5,7 +5,6 @@
  * Author: mario
  */
 
-
 #include <iostream>
 #include <fstream>
 
@@ -61,14 +60,14 @@
     typedef rk54ck_fusion_type::coef_c_type coef_c_type;
 
     const boost::array< double , 1 > a1 = {{ 0.2 }};
- const boost::array< double , 2 > a2 = {{ 3.0/40 , 9.0/40 }};
- const boost::array< double , 3 > a3 = {{ 3.0/10 , -9.0/10 , 6.0/5 }};
- const boost::array< double , 4 > a4 = {{ -11.0/54 , 5.0/2 , -70.0/27 , 35.0/27 }};
- const boost::array< double , 5 > a5 = {{ 1631.0/55296 , 175.0/512 , 575.0/13824 , 44275.0/110592 , 253.0/4096 }};
+ const boost::array< double , 2 > a2 = {{ 3.0/40.0 , 9.0/40 }};
+ const boost::array< double , 3 > a3 = {{ 0.3 , -0.9 , 1.2 }};
+ const boost::array< double , 4 > a4 = {{ -11.0/54.0 , 2.5 , -70.0/27.0 , 35.0/27.0 }};
+ const boost::array< double , 5 > a5 = {{ 1631.0/55296.0 , 175.0/512.0 , 575.0/13824.0 , 44275.0/110592.0 , 253.0/4096.0 }};
 
     const coef_a_type a = fusion::make_vector( a1 , a2 , a3 , a4 , a5 );
- const coef_b_type b = {{ 37.0/378 , 0.0 , 250.0/621 , 125.0/594 , 0.0 , 512.0/1771 }};
- const coef_b_type b2 = {{ b[0]-2825.0/27648 , b[1]-0.0 , b[2]-18575.0/48384 , b[3]-13525.0/55296 , b[4]-277.0/14336 , b[5]-1.0/4 }};
+ const coef_b_type b = {{ 37.0/378.0 , 0.0 , 250.0/621.0 , 125.0/594.0 , 0.0 , 512.0/1771.0 }};
+ const coef_b_type b2 = {{ b[0]-2825.0/27648.0 , b[1]-0.0 , b[2]-18575.0/48384.0 , b[3]-13525.0/55296.0 , b[4]-277.0/14336.0 , b[5]-0.25 }};
     //const coef_b_type b = {{ 2825.0/27648 , 0.0 , 18575.0/48384 , 13525.0/55296 , 277.0/14336 , 1.0/4 }};
     //const coef_b_type b2 = {{ b[0]-37.0/378 , b[1]-0.0 , b[2]-250.0/621 , b[3]-125.0/594 , b[4]-0.0 , b[5]-512.0/1771 }};
     const coef_c_type c = {{ 0.0 , 0.2 , 0.3 , 0.6 , 1.0 , 7.0/8 }};
@@ -77,7 +76,7 @@
     //rk54ck_fusion_type rk54ck( a , b , c );
 
     const size_t num_of_steps = 20000000;
- const double dt = 1E-4;
+ double dt = 1E-10;
 
     accumulator_type acc;
     timer_type timer;
@@ -92,7 +91,11 @@
 
         timer.restart();
         for( size_t i=0 ; i<num_of_steps ; ++i, t+=dt )
+ {
             rk54ck.do_step( lorenz , x , t , dt , x_err );
+ if( i % 1000 == 0 ) // simulated stepsize control
+ dt += (dt*1E-3*rand())/RAND_MAX - dt*5E-4;
+ }
         acc( timer.elapsed() );
 
         clog.precision( 15 );

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/gsl_rk54ck.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/gsl_rk54ck.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/gsl_rk54ck.cpp 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -50,9 +50,8 @@
 
 int main()
 {
- const size_t num_of_steps = 20000000; // gsl rk4 routine makes error control by
- // additional doing two steps with half step size
- const double dt = 1E-4; // so it actually does 3 * num_of_steps steps
+ const size_t num_of_steps = 20000000;
+ double dt = 1E-10;
 
     accumulator_type acc;
     timer_type timer;
@@ -73,7 +72,11 @@
 
         timer.restart();
         for( size_t i=0 ; i<num_of_steps ; ++i, t+=dt )
+ {
             gsl_odeiv_step_apply ( s , t , dt , x , x_err , 0 , 0 , &sys );
+ if( i % 1000 == 0 ) // simulated stepsize control
+ dt += (dt*1E-3*rand())/RAND_MAX - dt*5E-4;
+ }
         acc( timer.elapsed() );
 
         clog.precision( 15 );

Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/nr_rk54ck.cpp
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/nr_rk54ck.cpp 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -0,0 +1,130 @@
+/*
+ * nr_rk4.cpp
+ *
+ * Created on: Apr 28, 2011
+ * Author: mario
+ */
+
+#include <iostream>
+#include <fstream>
+
+#include <boost/array.hpp>
+
+#include <boost/numeric/odeint/stepper/explicit_rk4.hpp>
+#include <boost/accumulators/accumulators.hpp>
+#include <boost/accumulators/statistics.hpp>
+#include <boost/timer.hpp>
+
+#define tab "\t"
+
+using namespace std;
+using namespace boost::accumulators;
+
+typedef accumulator_set<
+ double , stats< tag::mean , tag::variance >
+ > accumulator_type;
+
+ostream& operator<<( ostream& out , accumulator_type &acc )
+{
+ out << boost::accumulators::mean( acc ) << tab;
+// out << boost::accumulators::variance( acc ) << tab;
+ return out;
+}
+
+typedef boost::timer timer_type;
+
+
+typedef boost::array< double , 3 > state_type;
+
+inline void lorenz( const state_type &x , state_type &dxdt , const double t )
+{
+ const double sigma = 10.0;
+ const double R = 28.0;
+ const double b = 8.0 / 3.0;
+ dxdt[0] = sigma * ( x[1] - x[0] );
+ dxdt[1] = R * x[0] - x[1] - x[0] * x[2];
+ dxdt[2] = x[0]*x[1] - b * x[2];
+}
+
+
+template< class System , typename T , size_t dim >
+void rk54ck_step( System &sys , boost::array< T , dim > &x , const double t , const double dt , boost::array< T , dim > &xerr )
+{ // fast rk54ck implementation adapted from the book 'Numerical Recipes'
+ size_t i;
+ static const double a2 = 0.2 , a3 = 0.3 , a4 = 0.6 , a5 = 1.0 , a6 = 0.875 ,
+ b21 = 0.2 , b31 = 3.0 / 40.0 , b32 = 9.0 / 40.0 , b41 = 0.3 , b42 =
+ -0.9 , b43 = 1.2 , b51 = -11.0 / 54.0 , b52 = 2.5 , b53 =
+ -70.0 / 27.0 , b54 = 35.0 / 27.0 , b61 = 1631.0 / 55296.0 ,
+ b62 = 175.0 / 512.0 , b63 = 575.0 / 13824.0 , b64 = 44275.0
+ / 110592.0 , b65 = 253.0 / 4096.0 , c1 = 37.0 / 378.0 , c3 =
+ 250.0 / 621.0 , c4 = 125.0 / 594.0 , c6 = 512.0 / 1771.0 ,
+ dc1 = c1 - 2825.0 / 27648.0 , dc3 = c3 - 18575.0 / 48384.0 , dc4 =
+ c4 - 13525.0 / 55296.0 , dc5 = -277.00 / 14336.0 , dc6 = c6
+ - 0.25;
+ const size_t n = dim;
+ boost::array< T , dim > dydx , ak2 , ak3 , ak4 , ak5 , ak6 , ytemp;
+
+ sys( x , dydx , t );
+ for (i=0;i<n;i++)
+ ytemp[i] = x[i] + b21 * dt * dydx[i];
+
+ sys( ytemp , ak2 , t+a2*dt );
+ for (i=0;i<n;i++)
+ ytemp[i] = x[i] + dt*(b31*dydx[i]+b32*ak2[i]);
+
+ sys( ytemp , ak3 , t+a3*dt );
+ for (i=0;i<n;i++)
+ ytemp[i] = x[i] + dt*(b41*dydx[i]+b42*ak2[i]+b43*ak3[i]);
+
+ sys( ytemp , ak4 , t+a4*dt );
+ for (i=0;i<n;i++)
+ ytemp[i] = x[i] + dt*(b51*dydx[i]+b52*ak2[i]+b53*ak3[i]+b54*ak4[i]);
+
+ sys( ytemp, ak5 , t+a5*dt );
+ for (i=0;i<n;i++)
+ ytemp[i] = x[i] + dt*(b61*dydx[i]+b62*ak2[i]+b63*ak3[i]+b64*ak4[i]+b65*ak5[i]);
+
+ sys( ytemp , ak6 , t+a6*dt );
+ for (i=0;i<n;i++)
+ x[i] += dt*(c1*dydx[i]+c3*ak3[i]+c4*ak4[i]+c6*ak6[i]);
+ for (i=0;i<n;i++)
+ xerr[i] = dt*(dc1*dydx[i]+dc3*ak3[i]+dc4*ak4[i]+dc5*ak5[i]+dc6*ak6[i]);
+}
+
+
+const size_t loops = 20;
+
+int main( int argc , char **argv )
+{
+ const size_t num_of_steps = 20000000;
+ double dt = 1E-10;
+
+ accumulator_type acc;
+ timer_type timer;
+
+ srand( 12312354 );
+
+ for( size_t n=0 ; n<loops ; ++n )
+ {
+ state_type x = {{ 10.0 * rand()/RAND_MAX ,
+ 10.0 * rand()/RAND_MAX ,
+ 10.0 * rand()/RAND_MAX }};
+ state_type x_err;
+ double t = 0.0;
+
+ timer.restart();
+ for( size_t i=0 ; i<num_of_steps ; ++i, t+=dt )
+ {
+ rk54ck_step( lorenz , x , t , dt , x_err );
+ if( i % 1000 == 0 ) // simulated stepsize control
+ dt += (dt*1E-3*rand())/RAND_MAX - dt*5E-4;
+ }
+ acc( timer.elapsed() );
+
+ clog.precision( 15 );
+ clog.width( 20 );
+ clog << acc << " " << x[0] << tab << " " << x_err[0] << endl;
+ }
+ cout << acc << endl;
+ return 0;
+}

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/odeint_rk54ck.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/odeint_rk54ck.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/odeint_rk54ck.cpp 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -59,7 +59,7 @@
     rk54_ck_odeint_type rk54_ck_odeint;
 
     const size_t num_of_steps = 20000000;
- const double dt = 1E-4;
+ double dt = 1E-10;
 
     accumulator_type acc;
     timer_type timer;
@@ -76,7 +76,11 @@
 
         timer.restart();
         for( size_t i=0 ; i<num_of_steps ; ++i, t+=dt )
+ {
             rk54_ck_odeint.do_step( lorenz , x , t , dt , x_err );
+ if( i % 1000 == 0 ) // simulated stepsize control
+ dt += (dt*1E-3*rand())/RAND_MAX - dt*5E-4;
+ }
         acc( timer.elapsed() );
 
         clog.precision( 15 );

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/odeint_rk54ck_def_alg.cpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/odeint_rk54ck_def_alg.cpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/odeint_rk54ck_def_alg.cpp 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -57,7 +57,7 @@
     rk54_ck_odeint_type rk54_ck_odeint;
 
     const size_t num_of_steps = 20000000;
- const double dt = 1E-4;
+ double dt = 1E-10;
 
     accumulator_type acc;
     timer_type timer;
@@ -74,7 +74,11 @@
 
         timer.restart();
         for( size_t i=0 ; i<num_of_steps ; ++i, t+=dt )
+ {
             rk54_ck_odeint.do_step( lorenz , x , t , dt , x_err );
+ if( i % 1000 == 0 ) // simulated stepsize control
+ dt += (dt*1E-3*rand())/RAND_MAX - dt*5E-4;
+ }
         acc( timer.elapsed() );
 
         clog.precision( 15 );

Added: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/perf_analysis.py
==============================================================================
--- (empty file)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/perf_analysis.py 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -0,0 +1,46 @@
+from pylab import *
+
+results_rk4 = array(
+[[ 0.82 , 0.59 , 0.60 , 0.60 , 0.54 , 0.54 , 0.81 , 0.98 , 1.14 ] , #odeint
+ [ 0.64 , 0.56 , 0.54 , 0.60 , 0.77 , 0.65 , 0.85 , 0.98 , 1.09 ] , #generic
+ [ 0.96 , 0.64 , 0.62 , 0.60 , 0.80 , 0.47 , 1.05 , 0.63 , 0.76 ] , #nr
+ [ 1.52 , 1.61 , 1.35 , 1.77 , 1.07 , 1.06 , 1.07 , 1.28 , 1.62 ] , #gsl
+ [ 1.85 , 1.85 , 1.47 , 2.08 , 1.08 , 1.08 , 1.57 , 1.70 , 2.10 ]]) #rt gen
+
+results_rk54ck = array(
+[[ 1.34 , 1.14 , 1.38 , 1.00 , 0.95 , 1.53 , 1.91 ] , #odeint
+ [ 1.26 , 1.13 , 1.43 , 1.28 , 1.02 , 1.63 , 1.84 ] , #generic
+ [ 2.04 , 1.32 , 1.34 , 1.48 , 1.10 , 1.82 , 1.15 ] , #nr
+ [ 2.80 , 2.34 , 2.79 , 1.80 , 1.94 , 1.99 , 2.16 ]]) #gsl
+
+means_rk4 = 100*ones( 5 )
+error_rk4 = zeros( 5 )
+
+for i in arange(1,5):
+ tmp = results_rk4[0] / results_rk4[i]
+ means_rk4[i] = 100*mean( tmp )
+ error_rk4[i] = 100*sqrt(var( tmp ))
+
+means_rk54ck = 100*ones( 4 )
+error_rk54ck = zeros( 4 )
+
+for i in arange(1,4):
+ tmp = results_rk54ck[0] / results_rk54ck[i]
+ means_rk54ck[i] = 100*mean( tmp )
+ error_rk54ck[i] = 100*sqrt(var( tmp ))
+
+figure(1)
+title("Performance for RK4 and Lorenz System")
+bar( arange(5) , means_rk4 , 0.2 , color='blue' , linewidth=4 , edgecolor='blue' , yerr = error_rk4 , error_kw=dict(elinewidth=2, ecolor='red') )
+xlim( -0.5 , 4.5 )
+xticks( arange(5)+0.1 , ('odeint' , 'generic' , 'nr' , 'gsl' , 'rt gen' ) )
+ylabel('Performance in % relative to odeint implementation')
+
+figure(2)
+title("Performance for RK54CK and Lorenz System")
+bar( arange(4) , means_rk54ck , 0.2 , color='blue' , linewidth=4 , edgecolor='blue' , yerr = error_rk54ck , error_kw=dict(elinewidth=2, ecolor='red') )
+xlim( -0.5 , 3.5 )
+xticks( arange(4)+0.1 , ('odeint' , 'generic' , 'nr' , 'gsl' ) )
+ylabel('Performance in % relative to odeint implementation')
+
+show()

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/perf_tests.py
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/perf_tests.py (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/perf_tests.py 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -1,11 +1,11 @@
 from os import popen
 from os.path import isfile
 
-#bin_path = "bin/gcc-4.4/release/"
-bin_path = "bin/intel-linux/release/"
+bin_path = "bin/gcc-4.6/release/"
+#bin_path = "bin/intel-linux/release/"
 
-bins = [ "odeint_rk4" , "odeint_rk4_def_alg" , "generic_rk4" , "nr_rk4" , "gsl_rk4" , "rt_generic_rk4" ,
- "odeint_rk54ck" , "odeint_rk54ck_def_alg" , "generic_rk54ck" , "gsl_rk54ck" ]
+#bins = [ "odeint_rk4" , "odeint_rk4_def_alg" , "generic_rk4" , "nr_rk4" , "gsl_rk4" , "rt_generic_rk4" ,
+bins = [ "odeint_rk54ck" , "odeint_rk54ck_def_alg" , "generic_rk54ck" , "nr_rk54ck" , "gsl_rk54ck" ]
 results = []
 
 print "Performance tests for " , bin_path

Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/results.dat
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/results.dat (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/performance/results.dat 2011-05-04 12:18:33 EDT (Wed, 04 May 2011)
@@ -15,18 +15,18 @@
 icc 11.1 | 1.24 | 1.14 | 1.09 | 0.76 | 1.62 | 2.10 | PhenomII X4 945 @ 3 GHz
 
 
-Results for Runge-Kutta 54 Cash Karp
+Results for Runge-Kutta 54 Cash Karp (including simulated stepsize control)
 
             | odeint | def alg | generic | nr | gsl |
 -------------------------------------------------------------------------
-gcc 4.3.2 | 1.34 | 1.42 | 1.00 | | 2.90 | Core2Quad Q9550 @ 2.83 GHz
+gcc 4.3.2 | 1.34 | 1.42 | 1.26 | 2.04 | 2.80 | Core2Quad Q9550 @ 2.83 GHz
 gcc 4.4.1 | 1.06 | 1.05 | 1.15 | | 2.63 | PhenomII X4 945 @ 3 GHz
-gcc 4.4.1 | 1.05 | 1.03 | 1.05 | | 2.34 | Core i7 930 @ 2.80 GHz
-gcc 4.4.1 | 1.14 | 1.15 | 1.24 | | 2.79 | Opteron 2224 @ 3 GHz
-gcc 4.5.0 | 0.80 | 1.13 | 1.28 | | 1.80 | Core i7 870 @ 2.93 GHz
-gcc 4.6.0 | 0.80 | 0.80 | 0.97 | | 1.80 | Core i7 870 @ 2.93 GHz
-icc 12.0.2 | 1.42 | 1.58 | 1.54 | | 1.81 | Core i7 870 @ 2.93 GHz
-icc 11.1 | 1.73 | 1.93 | 1.80 | | 2.16 | Xeon X5650 @ 2.67 GHz
+gcc 4.4.1 | 1.14 | 1.14 | 1.13 | 1.32 | 2.34 | Core i7 930 @ 2.80 GHz
+gcc 4.4.1 | 1.38 | 1.38 | 1.43 | 1.34 | 2.79 | Opteron 2224 @ 3 GHz
+gcc 4.5.0 | 1.00 | 1.13 | 1.28 | 1.48 | 1.80 | Core i7 870 @ 2.93 GHz
+gcc 4.6.0 | 0.95 | 0.95 | 1.02 | 1.10 | 1.94 | Core i7 870 @ 2.93 GHz
+icc 12.0.2 | 1.53 | 1.82 | 1.63 | 1.82 | 1.99 | Core i7 870 @ 2.93 GHz
+icc 11.1 | 1.91 | 1.93 | 1.84 | 1.15 | 2.16 | Xeon X5650 @ 2.67 GHz
 gcc 4.4.1 | | | | | | Core2Quad Q6600 @ 2.40GHz
 msvc 9.0 | 12.8 | | 15.4 | | ---- | Via Nano @ 1.60 GHz
 icc 11.1 | 1.80 | 2.44 | 2.39 | | 2.69 | PhenomII X4 945 @ 3 GHz


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk