|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71663 - in sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta: . performance
From: mario.mulansky_at_[hidden]
Date: 2011-05-02 07:33:05
Author: mariomulansky
Date: 2011-05-02 07:33:04 EDT (Mon, 02 May 2011)
New Revision: 71663
URL: http://svn.boost.org/trac/boost/changeset/71663
Log:
reran performance tests
Text files modified:
sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_algebra.hpp | 40 +++++++++++++++++++++++++++++++++++++++-
sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_error_rk.hpp | 2 +-
sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_rk_new.hpp | 6 +++---
sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_foreach_performance.hpp | 4 +++-
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 | 23 ++++++++++++-----------
6 files changed, 64 insertions(+), 19 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-02 07:33:04 EDT (Mon, 02 May 2011)
@@ -49,7 +49,7 @@
/* !!!!!!! Actually, this is factor 3 slower with intel compiler, so we don'y use it !!!!!
* Update: Current implementation increases performance on msvc 9.0 by about 30%, so it is in use again....
- */
+ *
template<>
struct fusion_algebra< 1 >
@@ -121,5 +121,43 @@
};
+template<>
+struct fusion_algebra< 5 >
+{
+
+ 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 , 5 > &a ,
+ const boost::array< T , dim > *k_vector , const double dt )
+ {
+ 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];
+ }
+ }
+
+};
+
+template<>
+struct fusion_algebra< 6 >
+{
+
+ 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 , 6 > &a ,
+ const boost::array< T , dim > *k_vector , const double dt )
+ {
+ 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];
+ }
+ }
+
+};
+*/
#endif /* FUSION_ALGEBRA_HPP_ */
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_error_rk.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_error_rk.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_error_rk.hpp 2011-05-02 07:33:04 EDT (Mon, 02 May 2011)
@@ -43,7 +43,7 @@
{ }
template< class System >
- void do_step( System &system , state_type &x , double t , const double dt , state_type &x_err )
+ void do_step( const System &system , state_type &x , double t , const double dt , state_type &x_err )
{
base::do_step( system , x , t , dt );
// compute error estimate
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_rk_new.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_rk_new.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_explicit_rk_new.hpp 2011-05-02 07:33:04 EDT (Mon, 02 May 2011)
@@ -142,13 +142,13 @@
template< class System >
struct calculate_stage
{
- System &system;
+ const System &system;
state_type &x , &x_tmp;
state_type *F;
const double t;
const double dt;
- calculate_stage( System &_system , state_type &_x , state_type &_x_tmp , state_type *_F ,
+ calculate_stage( const System &_system , state_type &_x , state_type &_x_tmp , state_type *_F ,
const double _t , const double _dt )
: system( _system ) , x( _x ) , x_tmp( _x_tmp ) , F( _F ) , t( _t ) , dt( _dt )
{}
@@ -193,7 +193,7 @@
template< class System >
- void do_step( System &system , state_type &x , double t , const double dt )
+ void do_step( const System &system , state_type &x , double t , const double dt )
{
fusion::for_each( m_stages , calculate_stage< System >( system , x , m_x_tmp , m_F , t , dt ) );
}
Modified: sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_foreach_performance.hpp
==============================================================================
--- sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_foreach_performance.hpp (original)
+++ sandbox/odeint/branches/karsten/libs/numeric/odeint/ideas/fusion_runge_kutta/fusion_foreach_performance.hpp 2011-05-02 07:33:04 EDT (Mon, 02 May 2011)
@@ -6,6 +6,8 @@
#include <boost/fusion/iterator/distance.hpp>
#include <boost/mpl/bool.hpp>
+#include <iostream>
+
namespace boost { namespace fusion {
namespace detail
{
@@ -34,4 +36,4 @@
}
};
}
-} }
\ No newline at end of file
+} }
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-02 07:33:04 EDT (Mon, 02 May 2011)
@@ -1,13 +1,16 @@
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.4/release/"
+bin_path = "bin/intel-linux/release/"
bins = [ "odeint_rk4" , "generic_rk4" , "nr_rk4" , "gsl_rk4" , "rt_generic_rk4" ,
"odeint_rk54ck" , "generic_rk54ck" , "gsl_rk54ck" ]
results = []
+print "Performance tests for " , bin_path
+print
+
for bin in bins:
if isfile( bin_path + bin ):
print "Running" , bin
@@ -18,6 +21,7 @@
results.append( " -- " )
print "Results from" , bin_path
+print
for i in range(len(bins)):
print bins[i] , results[i]
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-02 07:33:04 EDT (Mon, 02 May 2011)
@@ -2,12 +2,12 @@
| odeint | generic | nr | gsl | rt gen |
-------------------------------------------------------------------------
-gcc 4.5.0 | 0.79 | 0.80 | 0.82 | 1.11 | 1.30 | Corei7 870 @ 2.93 GHz
-gcc 4.3.2 | 1.00 | 1.07 | 0.97 | 2.03 | 2.20 | Core2Quad Q9550 @ 2.83 GHz
-icc 12.0.2 | 0.95 | 0.87 | 1.09 | 1.12 | 1.35 | Corei7 870 @ 2.93 GHz
-icc 11.1 | 1.11 | 0.98 | 1.19 | 1.28 | 1.99 | Xeon X5650 @ 2.67 GHz
-gcc 4.4.1 | 1.19 | 1.22 | 1.24 | 1.97 | | Core2Quad Q6600 @ 2.40GHz
-msvc 9.0 | 5.84 | 6.30 | 5.55 | ---- | 12.7 | Via Nano @ 1.60 GHz
+gcc 4.5.0 | 0.78 | 0.76 | 0.80 | 1.07 | 1.08 | Corei7 870 @ 2.93 GHz
+gcc 4.3.2 | 0.84 | 0.64 | 0.96 | 1.52 | 1.85 | Core2Quad Q9550 @ 2.83 GHz
+icc 12.0.2 | 0.81 | 0.85 | 1.03 | 1.07 | 1.61 | Corei7 870 @ 2.93 GHz
+icc 11.1 | 0.98 | 1.03 | 0.64 | 1.35 | 1.99 | Xeon X5650 @ 2.67 GHz
+gcc 4.4.1 | 1.19 | 1.22 | 1.24 | 1.97 | | Core2Quad Q6600 @ 2.40GHz (to be repeated)
+msvc 9.0 | 5.84 | 6.30 | 5.55 | ---- | 12.7 | Via Nano @ 1.60 GHz (to be repeated)
gcc 4.4.1 | 0.59 | 0.56 | 0.64 | 1.61 | 1.85 | PhenomII X4 945 @ 3 GHz
icc 11.1 | 1.15 | 1.09 | 0.74 | 1.62 | 2.18 | PhenomII X4 945 @ 3 GHz
@@ -16,10 +16,11 @@
| odeint | generic | nr | gsl |
-------------------------------------------------------------
-gcc 4.5.0 | 0.84 | 1.34 | | 1.88 | Corei7 870 @ 2.93 GHz
-gcc 4.3.2 | 1.35 | 1.76 | | 2.80 | Core2Quad Q9550 @ 2.83 GHz
-icc 12.0.2 | 1.49 | 2.11 | | 1.91 | Corei7 870 @ 2.93 GHz
-icc 11.1 | 1.90 | 2.44 | | 2.16 | Xeon X5650 @ 2.67 GHz
+gcc 4.5.0 | 0.80 | 1.28 | | 1.80 | Corei7 870 @ 2.93 GHz
+gcc 4.3.2 | 1.41 | 1.27 | | 3.80 | Core2Quad Q9550 @ 2.83 GHz
+icc 12.0.2 | 1.41 | 2.03 | | 1.86 | Corei7 870 @ 2.93 GHz
+icc 11.1 | 1.90 | 2.40 | | 2.20 | Xeon X5650 @ 2.67 GHz
gcc 4.4.1 | | | | | Core2Quad Q6600 @ 2.40GHz
msvc 9.0 | | | | ---- | Via Nano @ 1.60 GHz
-gcc 4.4.1 | 1.11 | 1.15 | | 2.63 | PhenomII X4 945 @ 3 GHz
\ No newline at end of file
+gcc 4.4.1 | 1.11 | 1.15 | | 2.63 | PhenomII X4 945 @ 3 GHz
+icc 11.1 | 1.83 | 2.42 | | 2.67 | PhenomII X4 945 @ 3 GHz
\ No newline at end of file
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