diff -Nur BTL-20030124/actions/action_aat_product.hh BTL/actions/action_aat_product.hh --- BTL-20030124/actions/action_aat_product.hh 2002-12-02 14:57:49.000000000 +0100 +++ BTL/actions/action_aat_product.hh 2003-11-12 19:06:26.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : action_aat_product.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef ACTION_AAT_PRODUCT #define ACTION_AAT_PRODUCT #include "utilities.h" @@ -26,103 +26,39 @@ #include "init/init_vector.hh" #include "init/init_matrix.hh" -using namespace std; - template -class Action_aat_product { +class Action_aat_product +{ + Action_aat_product(const Action_aat_product &); public : - // Ctor - - Action_aat_product( int size ):_size(size) - { - MESSAGE("Action_aat_product Ctor"); - - // STL matrix and vector initialization - - init_matrix(A_stl,_size); - init_matrix(X_stl,_size); - init_matrix(resu_stl,_size); - - // generic matrix and vector initialization - - Interface::matrix_from_stl(A_ref,A_stl); - Interface::matrix_from_stl(X_ref,X_stl); - - Interface::matrix_from_stl(A,A_stl); - Interface::matrix_from_stl(X,X_stl); - - } - - // invalidate copy ctor - - Action_aat_product( const Action_aat_product & ) - { - INFOS("illegal call to Action_aat_product Copy Ctor"); - exit(0); - } + Action_aat_product(int size); // Dtor + ~Action_aat_product(); - ~Action_aat_product( void ){ - - MESSAGE("Action_aat_product Dtor"); - - // deallocation - - Interface::free_matrix(A,_size); - Interface::free_matrix(X,_size); - - Interface::free_matrix(A_ref,_size); - Interface::free_matrix(X_ref,_size); - - } - // action name - - static inline std::string name( void ) - { - return "aat_"+Interface::name(); + static inline std::string name() { + return "aat_" + Interface::name(); } - double nb_op_base( void ){ + double nb_op_base() { return 2.0*_size*_size*_size; } - inline void initialize( void ){ - + void initialize() { Interface::copy_matrix(A_ref,A,_size); Interface::copy_matrix(X_ref,X,_size); - } - inline void calculate( void ) { - - Interface::aat_product(A,X,_size); - + void calculate( void ) { + Interface::aat_product(A,X,_size); } - void check_result( void ){ - - // calculation check - - Interface::matrix_to_stl(X,resu_stl); - - STL_interface::aat_product(A_stl,X_stl,_size); - - typename Interface::real_type error= - STL_interface::norm_diff(X_stl,resu_stl); - - if (error>1.e-6){ - INFOS("WRONG CALCULATION...residual=" << error); - exit(0); - } - - } - -private : + void check_result(); +private : typename Interface::stl_matrix A_stl; typename Interface::stl_matrix X_stl; typename Interface::stl_matrix resu_stl; @@ -133,13 +69,61 @@ typename Interface::gene_matrix A; typename Interface::gene_matrix X; - int _size; - }; - -#endif +/* + * Implementation + */ +template +Action_aat_product::Action_aat_product(int size) + : _size(size) +{ + MESSAGE("Action_aat_product Ctor"); + + // STL matrix and vector initialization + init_matrix(A_stl,_size); + init_matrix(X_stl,_size); + init_matrix(resu_stl,_size); + + // generic matrix and vector initialization + Interface::matrix_from_stl(A_ref,A_stl); + Interface::matrix_from_stl(X_ref,X_stl); + + Interface::matrix_from_stl(A,A_stl); + Interface::matrix_from_stl(X,X_stl); +} + +template +Action_aat_product::~Action_aat_product() +{ + MESSAGE("Action_aat_product Dtor"); + + // deallocation + Interface::free_matrix(A,_size); + Interface::free_matrix(X,_size); + + Interface::free_matrix(A_ref,_size); + Interface::free_matrix(X_ref,_size); +} + +template +void Action_aat_product::check_result() +{ + // calculation check + + Interface::matrix_to_stl(X,resu_stl); + STL_interface::aat_product(A_stl,X_stl,_size); + typename Interface::real_type error= + STL_interface::norm_diff(X_stl,resu_stl); + + if (error>1.e-6){ + INFOS("WRONG CALCULATION...residual=" << error); + exit(0); + } +} + +#endif diff -Nur BTL-20030124/actions/action_ata_product.hh BTL/actions/action_ata_product.hh --- BTL-20030124/actions/action_ata_product.hh 2002-12-02 14:58:14.000000000 +0100 +++ BTL/actions/action_ata_product.hh 2003-11-12 19:13:07.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : action_ata_product.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef ACTION_ATA_PRODUCT #define ACTION_ATA_PRODUCT #include "utilities.h" @@ -26,103 +26,39 @@ #include "init/init_vector.hh" #include "init/init_matrix.hh" -using namespace std; - template -class Action_ata_product { +class Action_ata_product +{ + Action_ata_product(const Action_ata_product &); public : - // Ctor - - Action_ata_product( int size ):_size(size) - { - MESSAGE("Action_ata_product Ctor"); - - // STL matrix and vector initialization - - init_matrix(A_stl,_size); - init_matrix(X_stl,_size); - init_matrix(resu_stl,_size); - - // generic matrix and vector initialization - - Interface::matrix_from_stl(A_ref,A_stl); - Interface::matrix_from_stl(X_ref,X_stl); - - Interface::matrix_from_stl(A,A_stl); - Interface::matrix_from_stl(X,X_stl); - - } - - // invalidate copy ctor - - Action_ata_product( const Action_ata_product & ) - { - INFOS("illegal call to Action_ata_product Copy Ctor"); - exit(0); - } + Action_ata_product(int size); // Dtor + ~Action_ata_product(); - ~Action_ata_product( void ){ - - MESSAGE("Action_ata_product Dtor"); - - // deallocation - - Interface::free_matrix(A,_size); - Interface::free_matrix(X,_size); - - Interface::free_matrix(A_ref,_size); - Interface::free_matrix(X_ref,_size); - - } - // action name - - static inline std::string name( void ) - { - return "ata_"+Interface::name(); + static inline std::string name() { + return "ata_" + Interface::name(); } - double nb_op_base( void ){ + double nb_op_base() { return 2.0*_size*_size*_size; } - inline void initialize( void ){ - + void initialize() { Interface::copy_matrix(A_ref,A,_size); Interface::copy_matrix(X_ref,X,_size); - } inline void calculate( void ) { - - Interface::ata_product(A,X,_size); - + Interface::ata_product(A,X,_size); } - void check_result( void ){ - - // calculation check - - Interface::matrix_to_stl(X,resu_stl); - - STL_interface::ata_product(A_stl,X_stl,_size); - - typename Interface::real_type error= - STL_interface::norm_diff(X_stl,resu_stl); - - if (error>1.e-6){ - INFOS("WRONG CALCULATION...residual=" << error); - exit(0); - } - - } - -private : + void check_result(); +private : typename Interface::stl_matrix A_stl; typename Interface::stl_matrix X_stl; typename Interface::stl_matrix resu_stl; @@ -133,13 +69,60 @@ typename Interface::gene_matrix A; typename Interface::gene_matrix X; - int _size; - }; - -#endif +/* + * Implementation + */ +template +Action_ata_product::Action_ata_product(int size) + : _size(size) +{ + MESSAGE("Action_ata_product Ctor"); + + // STL matrix and vector initialization + init_matrix(A_stl,_size); + init_matrix(X_stl,_size); + init_matrix(resu_stl,_size); + + // generic matrix and vector initialization + Interface::matrix_from_stl(A_ref,A_stl); + Interface::matrix_from_stl(X_ref,X_stl); + + Interface::matrix_from_stl(A,A_stl); + Interface::matrix_from_stl(X,X_stl); +} + +template +Action_ata_product::~Action_ata_product() +{ + MESSAGE("Action_ata_product Dtor"); + + // deallocation + Interface::free_matrix(A,_size); + Interface::free_matrix(X,_size); + + Interface::free_matrix(A_ref,_size); + Interface::free_matrix(X_ref,_size); +} + +template +void Action_ata_product::check_result() +{ + // calculation check + Interface::matrix_to_stl(X,resu_stl); + STL_interface::ata_product(A_stl,X_stl,_size); + typename Interface::real_type error= + STL_interface::norm_diff(X_stl,resu_stl); + + if (error>1.e-6){ + INFOS("WRONG CALCULATION...residual=" << error); + exit(0); + } +} + +#endif diff -Nur BTL-20030124/actions/action_axpy.hh BTL/actions/action_axpy.hh --- BTL-20030124/actions/action_axpy.hh 2003-01-08 11:11:35.000000000 +0100 +++ BTL/actions/action_axpy.hh 2003-11-12 19:07:44.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : action_axpy.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef ACTION_AXPY #define ACTION_AXPY #include "utilities.h" @@ -26,106 +26,39 @@ #include "init/init_vector.hh" #include "init/init_matrix.hh" -using namespace std; - template -class Action_axpy { - -public : +class Action_axpy +{ + Action_axpy(const Action_axpy &); +public: // Ctor - - Action_axpy( int size ):_size(size),_coef(1.0) - { - MESSAGE("Action_axpy Ctor"); - - // STL vector initialization - - init_vector(X_stl,_size); - init_vector(Y_stl,_size); - init_vector(resu_stl,_size); - - // generic matrix and vector initialization - - Interface::vector_from_stl(X_ref,X_stl); - Interface::vector_from_stl(Y_ref,Y_stl); - - Interface::vector_from_stl(X,X_stl); - Interface::vector_from_stl(Y,Y_stl); - - - } - - // invalidate copy ctor - - Action_axpy( const Action_axpy & ) - { - INFOS("illegal call to Action_axpy Copy Ctor"); - exit(0); - } + Action_axpy(int size); // Dtor + ~Action_axpy(); - ~Action_axpy( void ){ - - MESSAGE("Action_axpy Dtor"); - - // deallocation - - Interface::free_vector(X_ref); - Interface::free_vector(Y_ref); - - Interface::free_vector(X); - Interface::free_vector(Y); - - - } - // action name - - static inline std::string name( void ) - { - return "axpy_"+Interface::name(); + static inline std::string name() { + return "axpy_" + Interface::name(); } - double nb_op_base( void ){ + double nb_op_base() { return 2.0*_size; } - inline void initialize( void ){ - + void initialize() { Interface::copy_vector(X_ref,X,_size); Interface::copy_vector(Y_ref,Y,_size); - } - inline void calculate( void ) { - - Interface::axpy(_coef,X,Y,_size); - + void calculate() { + Interface::axpy(_coef,X,Y,_size); } + void check_result(); - void check_result( void ){ - - // calculation check - - Interface::vector_to_stl(Y,resu_stl); - - STL_interface::axpy(_coef,X_stl,Y_stl,_size); - - typename Interface::real_type error= - STL_interface::norm_diff(Y_stl,resu_stl); - - if (error>1.e-6){ - INFOS("WRONG CALCULATION...residual=" << error); - exit(0); - } - - } - -private : - +private : typename Interface::stl_vector X_stl; typename Interface::stl_vector Y_stl; typename Interface::stl_vector resu_stl; @@ -139,13 +72,59 @@ typename Interface::real_type _coef; int _size; +}; - -}; - +/* + * Implementation + */ +template +Action_axpy::Action_axpy(int size) + : _coef(1.0), _size(size) +{ + MESSAGE("Action_axpy Ctor"); + + // STL vector initialization + init_vector(X_stl,_size); + init_vector(Y_stl,_size); + init_vector(resu_stl,_size); + + // generic matrix and vector initialization + Interface::vector_from_stl(X_ref,X_stl); + Interface::vector_from_stl(Y_ref,Y_stl); + + Interface::vector_from_stl(X,X_stl); + Interface::vector_from_stl(Y,Y_stl); +} -#endif +template +Action_axpy::~Action_axpy() +{ + MESSAGE("Action_axpy Dtor"); + + // deallocation + Interface::free_vector(X_ref); + Interface::free_vector(Y_ref); + + Interface::free_vector(X); + Interface::free_vector(Y); +} + +template +void Action_axpy::check_result() +{ + // calculation check + Interface::vector_to_stl(Y,resu_stl); + STL_interface::axpy(_coef,X_stl,Y_stl,_size); + typename Interface::real_type error= + STL_interface::norm_diff(Y_stl,resu_stl); + if (error>1.e-6){ + INFOS("WRONG CALCULATION...residual=" << error); + exit(0); + } +} + +#endif diff -Nur BTL-20030124/actions/action_matrix_matrix_product.hh BTL/actions/action_matrix_matrix_product.hh --- BTL-20030124/actions/action_matrix_matrix_product.hh 2002-12-02 14:57:27.000000000 +0100 +++ BTL/actions/action_matrix_matrix_product.hh 2003-11-12 19:49:11.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : action_matrix_matrix_product.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef ACTION_MATRIX_MATRIX_PRODUCT #define ACTION_MATRIX_MATRIX_PRODUCT #include "utilities.h" @@ -26,109 +26,40 @@ #include "init/init_vector.hh" #include "init/init_matrix.hh" -using namespace std; - template -class Action_matrix_matrix_product { - -public : +class Action_matrix_matrix_product +{ + Action_matrix_matrix_product(const Action_matrix_matrix_product &); +public: // Ctor - - Action_matrix_matrix_product( int size ):_size(size) - { - MESSAGE("Action_matrix_matrix_product Ctor"); - - // STL matrix and vector initialization - - init_matrix(A_stl,_size); - init_matrix(B_stl,_size); - init_matrix(X_stl,_size); - init_matrix(resu_stl,_size); - - // generic matrix and vector initialization - - Interface::matrix_from_stl(A_ref,A_stl); - Interface::matrix_from_stl(B_ref,B_stl); - Interface::matrix_from_stl(X_ref,X_stl); - - Interface::matrix_from_stl(A,A_stl); - Interface::matrix_from_stl(B,B_stl); - Interface::matrix_from_stl(X,X_stl); - - } - - // invalidate copy ctor - - Action_matrix_matrix_product( const Action_matrix_matrix_product & ) - { - INFOS("illegal call to Action_matrix_matrix_product Copy Ctor"); - exit(0); - } + Action_matrix_matrix_product(int size); // Dtor + ~Action_matrix_matrix_product(); - ~Action_matrix_matrix_product( void ){ - - MESSAGE("Action_matrix_matrix_product Dtor"); - - // deallocation - - Interface::free_matrix(A,_size); - Interface::free_matrix(B,_size); - Interface::free_matrix(X,_size); - - Interface::free_matrix(A_ref,_size); - Interface::free_matrix(B_ref,_size); - Interface::free_matrix(X_ref,_size); - - } - // action name - - static inline std::string name( void ) - { - return "matrix_matrix_"+Interface::name(); + static inline std::string name() { + return "matrix_matrix_" + Interface::name(); } - double nb_op_base( void ){ + double nb_op_base() { return 2.0*_size*_size*_size; } - inline void initialize( void ){ - + void initialize() { Interface::copy_matrix(A_ref,A,_size); Interface::copy_matrix(B_ref,B,_size); Interface::copy_matrix(X_ref,X,_size); - } - inline void calculate( void ) { - - Interface::matrix_matrix_product(A,B,X,_size); - + inline void calculate() { + Interface::matrix_matrix_product(A,B,X,_size); } - void check_result( void ){ - - // calculation check - - Interface::matrix_to_stl(X,resu_stl); - - STL_interface::matrix_matrix_product(A_stl,B_stl,X_stl,_size); - - typename Interface::real_type error= - STL_interface::norm_diff(X_stl,resu_stl); - - if (error>1.e-6){ - INFOS("WRONG CALCULATION...residual=" << error); - exit(0); - } - - } - -private : + void check_result(); +private : typename Interface::stl_matrix A_stl; typename Interface::stl_matrix B_stl; typename Interface::stl_matrix X_stl; @@ -142,13 +73,66 @@ typename Interface::gene_matrix B; typename Interface::gene_matrix X; - int _size; - }; - -#endif +/* + * Implementation + */ +template +Action_matrix_matrix_product::Action_matrix_matrix_product(int size) + : _size(size) +{ + MESSAGE("Action_matrix_matrix_product Ctor"); + + // STL matrix and vector initialization + init_matrix(A_stl,_size); + init_matrix(B_stl,_size); + init_matrix(X_stl,_size); + init_matrix(resu_stl,_size); + + // generic matrix and vector initialization + Interface::matrix_from_stl(A_ref,A_stl); + Interface::matrix_from_stl(B_ref,B_stl); + Interface::matrix_from_stl(X_ref,X_stl); + + Interface::matrix_from_stl(A,A_stl); + Interface::matrix_from_stl(B,B_stl); + Interface::matrix_from_stl(X,X_stl); +} +template +Action_matrix_matrix_product::~Action_matrix_matrix_product() +{ + MESSAGE("Action_matrix_matrix_product Dtor"); + + // deallocation + Interface::free_matrix(A,_size); + Interface::free_matrix(B,_size); + Interface::free_matrix(X,_size); + + Interface::free_matrix(A_ref,_size); + Interface::free_matrix(B_ref,_size); + Interface::free_matrix(X_ref,_size); +} + +template +void Action_matrix_matrix_product::check_result() +{ + // calculation check + Interface::matrix_to_stl(X,resu_stl); + + STL_interface::matrix_matrix_product(A_stl,B_stl,X_stl,_size); + + typename Interface::real_type error= + STL_interface::norm_diff(X_stl,resu_stl); + + if (error>1.e-6){ + INFOS("WRONG CALCULATION...residual=" << error); + exit(0); + } +} + +#endif diff -Nur BTL-20030124/actions/action_matrix_vector_product.hh BTL/actions/action_matrix_vector_product.hh --- BTL-20030124/actions/action_matrix_vector_product.hh 2002-12-02 14:58:57.000000000 +0100 +++ BTL/actions/action_matrix_vector_product.hh 2003-11-12 19:08:45.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : action_matrix_vector_product.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef ACTION_MATRIX_VECTOR_PRODUCT #define ACTION_MATRIX_VECTOR_PRODUCT #include "utilities.h" @@ -26,109 +26,40 @@ #include "init/init_vector.hh" #include "init/init_matrix.hh" -using namespace std; - template -class Action_matrix_vector_product { +class Action_matrix_vector_product +{ + Action_matrix_vector_product(const Action_matrix_vector_product &); public : - // Ctor - - Action_matrix_vector_product( int size ):_size(size) - { - MESSAGE("Action_matrix_vector_product Ctor"); - - // STL matrix and vector initialization - - init_matrix(A_stl,_size); - init_vector(B_stl,_size); - init_vector(X_stl,_size); - init_vector(resu_stl,_size); - - // generic matrix and vector initialization - - Interface::matrix_from_stl(A_ref,A_stl); - Interface::vector_from_stl(B_ref,B_stl); - Interface::vector_from_stl(X_ref,X_stl); - - Interface::matrix_from_stl(A,A_stl); - Interface::vector_from_stl(B,B_stl); - Interface::vector_from_stl(X,X_stl); - - } - - // invalidate copy ctor - - Action_matrix_vector_product( const Action_matrix_vector_product & ) - { - INFOS("illegal call to Action_matrix_vector_product Copy Ctor"); - exit(0); - } + Action_matrix_vector_product(int size); // Dtor + ~Action_matrix_vector_product(); - ~Action_matrix_vector_product( void ){ - - MESSAGE("Action_matrix_vector_product Dtor"); - - // deallocation - - Interface::free_matrix(A,_size); - Interface::free_vector(B); - Interface::free_vector(X); - - Interface::free_matrix(A_ref,_size); - Interface::free_vector(B_ref); - Interface::free_vector(X_ref); - - } - // action name - - static inline std::string name( void ) - { - return "matrix_vector_"+Interface::name(); + static inline std::string name() { + return "matrix_vector_" + Interface::name(); } - double nb_op_base( void ){ + double nb_op_base(){ return 2.0*_size*_size; } - inline void initialize( void ){ - + void initialize() { Interface::copy_matrix(A_ref,A,_size); Interface::copy_vector(B_ref,B,_size); Interface::copy_vector(X_ref,X,_size); - - } - - inline void calculate( void ) { - - Interface::matrix_vector_product(A,B,X,_size); - } - void check_result( void ){ - - // calculation check - - Interface::vector_to_stl(X,resu_stl); - - STL_interface::matrix_vector_product(A_stl,B_stl,X_stl,_size); - - typename Interface::real_type error= - STL_interface::norm_diff(X_stl,resu_stl); - - if (error>1.e-6){ - INFOS("WRONG CALCULATION...residual=" << error); - exit(0); - } - + inline void calculate() { + Interface::matrix_vector_product(A,B,X,_size); } -private : + void check_result(); +private: typename Interface::stl_matrix A_stl; typename Interface::stl_vector B_stl; typename Interface::stl_vector X_stl; @@ -142,13 +73,71 @@ typename Interface::gene_vector B; typename Interface::gene_vector X; - int _size; - }; - -#endif +/* + * Implementation + */ +template +Action_matrix_vector_product::Action_matrix_vector_product( int size ) + : _size(size) +{ + MESSAGE("Action_matrix_vector_product Ctor"); + + // STL matrix and vector initialization + + init_matrix(A_stl,_size); + init_vector(B_stl,_size); + init_vector(X_stl,_size); + init_vector(resu_stl,_size); + + // generic matrix and vector initialization + + Interface::matrix_from_stl(A_ref,A_stl); + Interface::vector_from_stl(B_ref,B_stl); + Interface::vector_from_stl(X_ref,X_stl); + + Interface::matrix_from_stl(A,A_stl); + Interface::vector_from_stl(B,B_stl); + Interface::vector_from_stl(X,X_stl); + +} + +template +Action_matrix_vector_product::~Action_matrix_vector_product() +{ + + MESSAGE("Action_matrix_vector_product Dtor"); + + // deallocation + + Interface::free_matrix(A,_size); + Interface::free_vector(B); + Interface::free_vector(X); + + Interface::free_matrix(A_ref,_size); + Interface::free_vector(B_ref); + Interface::free_vector(X_ref); + +} + +template +void Action_matrix_vector_product::check_result() +{ + // calculation check + Interface::vector_to_stl(X,resu_stl); + + STL_interface::matrix_vector_product(A_stl,B_stl,X_stl,_size); + + typename Interface::real_type error= + STL_interface::norm_diff(X_stl,resu_stl); + if (error>1.e-6){ + INFOS("WRONG CALCULATION...residual=" << error); + exit(0); + } +} +#endif diff -Nur BTL-20030124/data/aat.hh BTL/data/aat.hh --- BTL-20030124/data/aat.hh 2002-12-04 15:06:08.000000000 +0100 +++ BTL/data/aat.hh 2003-12-07 19:31:27.000000000 +0100 @@ -1,21 +1,21 @@ #!/usr/bin/gnuplot -persist # -# +# # G N U P L O T # Linux version 3.7 # patchlevel 0 # last modified Thu Jan 14 19:34:53 BST 1999 -# +# # Copyright(C) 1986 - 1993, 1998, 1999 # Thomas Williams, Colin Kelley and many others -# +# # Type `help` to access the on-line reference manual # The gnuplot FAQ is available from # -# +# # Send comments and requests for help to # Send bugs, suggestions and mods to -# +# # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 # set output 'bench_gcc.ps' set noclip points @@ -76,9 +76,9 @@ set mytics default set mx2tics default set my2tics default -set xtics border mirror norotate autofreq -set ytics border mirror norotate autofreq -set ztics border nomirror norotate autofreq +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq set nox2tics set noy2tics set title "A x At product " 0.000000,0.000000 "" @@ -104,5 +104,5 @@ set rmargin -1 set tmargin -1 set locale "C" -set xrange [10:1000] +set xrange [1:100] ##set yrange [0:400] diff -Nur BTL-20030124/data/ata.hh BTL/data/ata.hh --- BTL-20030124/data/ata.hh 2002-12-04 15:06:08.000000000 +0100 +++ BTL/data/ata.hh 2003-12-07 19:31:36.000000000 +0100 @@ -1,21 +1,21 @@ #!/usr/bin/gnuplot -persist # -# +# # G N U P L O T # Linux version 3.7 # patchlevel 0 # last modified Thu Jan 14 19:34:53 BST 1999 -# +# # Copyright(C) 1986 - 1993, 1998, 1999 # Thomas Williams, Colin Kelley and many others -# +# # Type `help` to access the on-line reference manual # The gnuplot FAQ is available from # -# +# # Send comments and requests for help to # Send bugs, suggestions and mods to -# +# # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 # set output 'bench_gcc.ps' set noclip points @@ -76,9 +76,9 @@ set mytics default set mx2tics default set my2tics default -set xtics border mirror norotate autofreq -set ytics border mirror norotate autofreq -set ztics border nomirror norotate autofreq +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq set nox2tics set noy2tics set title "At x A product " 0.000000,0.000000 "" @@ -104,5 +104,5 @@ set rmargin -1 set tmargin -1 set locale "C" -set xrange [10:1000] +set xrange [1:100] ##set yrange [0:400] diff -Nur BTL-20030124/data/axpy.hh BTL/data/axpy.hh --- BTL-20030124/data/axpy.hh 2003-01-06 11:07:11.000000000 +0100 +++ BTL/data/axpy.hh 2003-11-15 07:06:46.000000000 +0100 @@ -1,21 +1,21 @@ #!/usr/bin/gnuplot -persist # -# +# # G N U P L O T # Linux version 3.7 # patchlevel 0 # last modified Thu Jan 14 19:34:53 BST 1999 -# +# # Copyright(C) 1986 - 1993, 1998, 1999 # Thomas Williams, Colin Kelley and many others -# +# # Type `help` to access the on-line reference manual # The gnuplot FAQ is available from # -# +# # Send comments and requests for help to # Send bugs, suggestions and mods to -# +# # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 # set output 'bench_gcc.ps' set noclip points @@ -76,9 +76,9 @@ set mytics default set mx2tics default set my2tics default -set xtics border mirror norotate autofreq -set ytics border mirror norotate autofreq -set ztics border nomirror norotate autofreq +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq set nox2tics set noy2tics set title "Y+=alpha*X " 0.000000,0.000000 "" @@ -104,5 +104,5 @@ set rmargin -1 set tmargin -1 set locale "C" -set xrange [1:1000000] +set xrange [1:100] ##set yrange [0:550] diff -Nur BTL-20030124/data/matrix_matrix.hh BTL/data/matrix_matrix.hh --- BTL-20030124/data/matrix_matrix.hh 2003-01-06 11:08:38.000000000 +0100 +++ BTL/data/matrix_matrix.hh 2003-11-15 07:06:16.000000000 +0100 @@ -1,21 +1,21 @@ #!/usr/bin/gnuplot -persist # -# +# # G N U P L O T # Linux version 3.7 # patchlevel 0 # last modified Thu Jan 14 19:34:53 BST 1999 -# +# # Copyright(C) 1986 - 1993, 1998, 1999 # Thomas Williams, Colin Kelley and many others -# +# # Type `help` to access the on-line reference manual # The gnuplot FAQ is available from # -# +# # Send comments and requests for help to # Send bugs, suggestions and mods to -# +# # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 # set output 'bench_gcc.ps' set noclip points @@ -76,9 +76,9 @@ set mytics default set mx2tics default set my2tics default -set xtics border mirror norotate autofreq -set ytics border mirror norotate autofreq -set ztics border nomirror norotate autofreq +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq set nox2tics set noy2tics set title "matrix matrix product " 0.000000,0.000000 "" @@ -104,5 +104,5 @@ set rmargin -1 set tmargin -1 set locale "C" -set xrange [1:1000] +set xrange [1:100] ##set yrange [0:400] diff -Nur BTL-20030124/data/matrix_vector.hh BTL/data/matrix_vector.hh --- BTL-20030124/data/matrix_vector.hh 2003-01-06 11:08:29.000000000 +0100 +++ BTL/data/matrix_vector.hh 2003-11-15 07:06:24.000000000 +0100 @@ -1,21 +1,21 @@ #!/usr/bin/gnuplot -persist # -# +# # G N U P L O T # Linux version 3.7 # patchlevel 0 # last modified Thu Jan 14 19:34:53 BST 1999 -# +# # Copyright(C) 1986 - 1993, 1998, 1999 # Thomas Williams, Colin Kelley and many others -# +# # Type `help` to access the on-line reference manual # The gnuplot FAQ is available from # -# +# # Send comments and requests for help to # Send bugs, suggestions and mods to -# +# # set terminal postscript landscape noenhanced monochrome dashed defaultplex "Helvetica" 14 # set output 'bench_gcc.ps' set noclip points @@ -76,9 +76,9 @@ set mytics default set mx2tics default set my2tics default -set xtics border mirror norotate autofreq -set ytics border mirror norotate autofreq -set ztics border nomirror norotate autofreq +set xtics border mirror norotate autofreq +set ytics border mirror norotate autofreq +set ztics border nomirror norotate autofreq set nox2tics set noy2tics set title "matrix vector product " 0.000000,0.000000 "" @@ -104,5 +104,5 @@ set rmargin -1 set tmargin -1 set locale "C" -set xrange [1:1000] +set xrange [1:100] ##set yrange [0:400] diff -Nur BTL-20030124/data/mk_gnuplot_script.sh BTL/data/mk_gnuplot_script.sh --- BTL-20030124/data/mk_gnuplot_script.sh 2003-01-10 11:52:01.000000000 +0100 +++ BTL/data/mk_gnuplot_script.sh 2003-11-30 14:56:49.000000000 +0100 @@ -26,8 +26,8 @@ BASE=${LAST##*/} ; BASE=${FILE##*/} ; AVANT=bench_${WHAT}_ ; REDUC=${BASE##*$AVANT} ; TITLE=${REDUC%.dat} echo "'"$LAST"'" title "'"$TITLE"'" >> $WHAT.gnuplot -#echo set term postscript color >> $WHAT.gnuplot -#echo set output "'"$WHAT.ps"'" >> $WHAT.gnuplot +echo set term postscript color >> $WHAT.gnuplot +echo set output "'"$WHAT.ps"'" >> $WHAT.gnuplot echo set term pbm small color >> $WHAT.gnuplot echo set output "'"$WHAT.ppm"'" >> $WHAT.gnuplot echo plot \\ >> $WHAT.gnuplot @@ -62,7 +62,3 @@ gnuplot -persist < $WHAT.gnuplot rm $WHAT.gnuplot - - - - diff -Nur BTL-20030124/data/mk_mean_script.sh BTL/data/mk_mean_script.sh --- BTL-20030124/data/mk_mean_script.sh 2003-01-21 16:57:53.000000000 +0100 +++ BTL/data/mk_mean_script.sh 2003-11-30 15:10:01.000000000 +0100 @@ -10,7 +10,7 @@ mkdir $WORK_DIR DATA_FILE=`find $DIR -name "*.dat" | grep _${WHAT}` -echo +echo for FILE in $DATA_FILE do ##echo hello world @@ -19,7 +19,7 @@ ##echo "mk_mean_script1" ${TITLE} cp $FILE ${WORK_DIR}/${TITLE} - + done cd $WORK_DIR @@ -29,11 +29,3 @@ cd .. rm -R $WORK_DIR - - - - - - - - diff -Nur BTL-20030124/data/mk_new_gnuplot.sh BTL/data/mk_new_gnuplot.sh --- BTL-20030124/data/mk_new_gnuplot.sh 2003-01-10 12:02:58.000000000 +0100 +++ BTL/data/mk_new_gnuplot.sh 2003-11-30 15:58:09.000000000 +0100 @@ -5,6 +5,7 @@ DATA_FILE=`cat ../order_lib` +echo set grid xtics ytics mxtics mytics >> $WHAT.gnuplot echo plot \\ >> $WHAT.gnuplot for FILE in $DATA_FILE @@ -12,7 +13,21 @@ LAST=$FILE done +# GUI plot +for FILE in $DATA_FILE +do + if [ $FILE != $LAST ] + then + echo "'"$FILE"'" ",\\" >> $WHAT.gnuplot + fi +done +echo "'"$LAST"'" >> $WHAT.gnuplot +# postscript plot +echo set size 2,1.412 >> $WHAT.gnuplot +echo set terminal postscript eps color \"Arial\" 24 >> $WHAT.gnuplot +echo set output "'"../${DIR}/$WHAT.eps"'" >> $WHAT.gnuplot +echo plot \\ >> $WHAT.gnuplot for FILE in $DATA_FILE do if [ $FILE != $LAST ] @@ -22,10 +37,9 @@ done echo "'"$LAST"'" >> $WHAT.gnuplot -echo set term postscript color >> $WHAT.gnuplot -echo set output "'"../${DIR}/$WHAT.ps"'" >> $WHAT.gnuplot -#echo set term pbm color >> $WHAT.gnuplot -#echo set output "'"../${DIR}/$WHAT.ppm"'" >> $WHAT.gnuplot +# png plot +echo set terminal png small color >> $WHAT.gnuplot +echo set output "'"../${DIR}/$WHAT.png"'" >> $WHAT.gnuplot echo plot \\ >> $WHAT.gnuplot for FILE in $DATA_FILE do @@ -39,7 +53,3 @@ gnuplot -persist < $WHAT.gnuplot rm $WHAT.gnuplot - - - - diff -Nur BTL-20030124/data/order_lib BTL/data/order_lib --- BTL-20030124/data/order_lib 1970-01-01 01:00:00.000000000 +0100 +++ BTL/data/order_lib 2003-12-07 19:31:44.000000000 +0100 @@ -0,0 +1,7 @@ +ATLAS +C +ublas +f77 +tvmet +STL +blitz diff -Nur BTL-20030124/generic_bench/bench.hh BTL/generic_bench/bench.hh --- BTL-20030124/generic_bench/bench.hh 2003-03-08 22:40:23.000000000 +0100 +++ BTL/generic_bench/bench.hh 2003-11-12 19:57:27.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : bench.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef BENCH_HH #define BENCH_HH #include "bench_parameter.hh" @@ -31,58 +31,47 @@ //#include "timers/x86_perf_analyzer.hh" //#include "timers/STL_perf_analyzer.hh" -using namespace std; - -template class Perf_Analyzer, class Action> -void bench( int size_min, int size_max, int nb_point ){ - - // bench name - - string filename="bench_"+Action::name()+".dat"; +template < + template class Perf_Analyzer, + class Action +> +void bench(int size_min, int size_max, int nb_point) { + // bench name + std::string filename="bench_" + Action::name() + ".dat"; INFOS("starting " < tab_mflops(nb_point); std::vector tab_sizes(nb_point); // matrices and vector size calculations - - size_lin_log(nb_point,size_min,size_max,tab_sizes); + size_lin_log(nb_point, size_min, size_max, tab_sizes); // loop on matrix size - Perf_Analyzer perf_action; - for (int i=nb_point-1;i>=0;i--){ - + for (int i = nb_point-1; i >= 0; i--) { INFOS("size=" < -void bench( int size_min, int size_max, int nb_point ){ +void bench(int size_min, int size_max, int nb_point) { // if the rdtsc is not available : - bench(size_min,size_max,nb_point); + bench(size_min, size_max, nb_point); // if the rdtsc is available : - // bench(size_min,size_max,nb_point); - + // bench(size_min,size_max,nb_point); // Only for small problem size. Otherwize it will be too long - //bench(size_min,size_max,nb_point); - //bench(size_min,size_max,nb_point); - + // bench(size_min,size_max,nb_point); + // bench(size_min,size_max,nb_point); } #endif diff -Nur BTL-20030124/generic_bench/bench.hh~ BTL/generic_bench/bench.hh~ --- BTL-20030124/generic_bench/bench.hh~ 2003-03-13 15:36:19.000000000 +0100 +++ BTL/generic_bench/bench.hh~ 1970-01-01 01:00:00.000000000 +0100 @@ -1,88 +0,0 @@ -//===================================================== -// File : bench.hh -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#ifndef BENCH_HH -#define BENCH_HH -#include "bench_parameter.hh" -#include -#include "utilities.h" -#include "size_lin_log.hh" -#include "dump_file_x_y.hh" -#include -#include -#include "timers/portable_perf_analyzer.hh" -#include "timers/mixed_perf_analyzer.hh" -#include "timers/x86_perf_analyzer.hh" -#include "timers/STL_perf_analyzer.hh" - -using namespace std; - -template class Perf_Analyzer, class Action> -void bench( int size_min, int size_max, int nb_point ){ - - // bench name - - string filename="bench_"+Action::name()+".dat"; - - INFOS("starting " < tab_mflops(nb_point); - std::vector tab_sizes(nb_point); - - // matrices and vector size calculations - - size_lin_log(nb_point,size_min,size_max,tab_sizes); - - // loop on matrix size - - Perf_Analyzer perf_action; - - for (int i=nb_point-1;i>=0;i--){ - - INFOS("size=" < -void bench( int size_min, int size_max, int nb_point ){ - - // if the rdtsc is not available : - //bench(size_min,size_max,nb_point); - // if the rdtsc is available : - bench(size_min,size_max,nb_point); - - - // Only for small problem size. Otherwize it will be too long - //bench(size_min,size_max,nb_point); - //bench(size_min,size_max,nb_point); - -} - -#endif diff -Nur BTL-20030124/generic_bench/bench_parameter.hh BTL/generic_bench/bench_parameter.hh --- BTL-20030124/generic_bench/bench_parameter.hh 2003-03-17 14:42:37.000000000 +0100 +++ BTL/generic_bench/bench_parameter.hh 2003-11-13 21:37:12.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : bench_parameter.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,34 +16,34 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef BENCH_PARAMETER_HH #define BENCH_PARAMETER_HH // minimal time for each measurement #define REAL_TYPE double // minimal time for each measurement -#define MIN_TIME 2.0 +#define MIN_TIME 2.0 // nb of point on bench curves -#define NB_POINT 100 +#define NB_POINT 20 // min vector size for axpy bench #define MIN_AXPY 20 // max vector size for axpy bench -#define MAX_AXPY 1000000 +#define MAX_AXPY 100 // min matrix size for matrix vector product bench -#define MIN_MV 10 +#define MIN_MV 1 // max matrix size for matrix vector product bench -#define MAX_MV 1000 +#define MAX_MV 100 // min matrix size for matrix matrix product bench -#define MIN_MM 10 +#define MIN_MM 1 // max matrix size for matrix matrix product bench -#define MAX_MM 1000 +#define MAX_MM 100 // min matrix size for LU bench -#define MIN_LU 10 +#define MIN_LU 1 // max matrix size for LU bench -#define MAX_LU 1000 +#define MAX_LU 100 // max size for tiny vector and matrix -#define TINY_MV_MAX_SIZE 5 +#define TINY_MV_MAX_SIZE 10 // default nb_sample for x86 timer #define DEFAULT_NB_SAMPLE 1000 diff -Nur BTL-20030124/generic_bench/bench_parameter.hh~ BTL/generic_bench/bench_parameter.hh~ --- BTL-20030124/generic_bench/bench_parameter.hh~ 2003-03-08 22:39:52.000000000 +0100 +++ BTL/generic_bench/bench_parameter.hh~ 1970-01-01 01:00:00.000000000 +0100 @@ -1,52 +0,0 @@ -//===================================================== -// File : bench_parameter.hh -// Author : L. Plagne -// Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#ifndef BENCH_PARAMETER_HH -#define BENCH_PARAMETER_HH - -// minimal time for each measurement -#define REAL_TYPE double -// minimal time for each measurement -#define MIN_TIME 2.0 -// nb of point on bench curves -#define NB_POINT 100 -// min vector size for axpy bench -#define MIN_AXPY 20 -// max vector size for axpy bench -#define MAX_AXPY 1000000 -// min matrix size for matrix vector product bench -#define MIN_MV 10 -// max matrix size for matrix vector product bench -#define MAX_MV 1000 -// min matrix size for matrix matrix product bench -#define MIN_MM 10 -// max matrix size for matrix matrix product bench -#define MAX_MM 1000 -// min matrix size for LU bench -#define MIN_LU 10 -// max matrix size for LU bench -#define MAX_LU 1000 -// max size for tiny vector and matrix -#define TINY_MV_MAX_SIZE 10 -// default nb_sample for x86 timer -#define DEFAULT_NB_SAMPLE 1000 - - - -#endif diff -Nur BTL-20030124/generic_bench/init/init_function.hh BTL/generic_bench/init/init_function.hh --- BTL-20030124/generic_bench/init/init_function.hh 2002-11-21 16:04:06.000000000 +0100 +++ BTL/generic_bench/init/init_function.hh 2003-10-31 21:41:10.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : init_function.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:18 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef INIT_FUNCTION_HH #define INIT_FUNCTION_HH @@ -30,24 +30,24 @@ return index_i+index_j; } -double pseudo_random(int index) +double pseudo_random(int /* index */) { // INFOS("random="<<(std::rand()/double(RAND_MAX))); return std::rand()/double(RAND_MAX); } -double pseudo_random(int index_i, int index_j) +double pseudo_random(int /* index_i */, int /* index_j */) { return std::rand()/double(RAND_MAX); } -double null_function(int index) +double null_function(int /* index */) { return 0.0; } -double null_function(int index_i, int index_j) +double null_function(int /* index_i */, int /* index_j */) { return 0.0; } diff -Nur BTL-20030124/generic_bench/init/init_matrix.hh BTL/generic_bench/init/init_matrix.hh --- BTL-20030124/generic_bench/init/init_matrix.hh 2002-11-21 16:04:06.000000000 +0100 +++ BTL/generic_bench/init/init_matrix.hh 2003-11-02 11:44:15.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : init_matrix.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:19 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef INIT_MATRIX_HH #define INIT_MATRIX_HH @@ -29,7 +29,7 @@ X.resize(size); - for (int j=0;j(A[row],size,row); } - - + + } #endif diff -Nur BTL-20030124/generic_bench/init/init_vector.hh BTL/generic_bench/init/init_vector.hh --- BTL-20030124/generic_bench/init/init_vector.hh 2002-11-21 16:04:06.000000000 +0100 +++ BTL/generic_bench/init/init_vector.hh 2003-11-11 19:30:52.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : init_vector.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:18 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef INIT_VECTOR_HH #define INIT_VECTOR_HH @@ -29,7 +29,7 @@ X.resize(size); - for (int i=0;i +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:16 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef BENCH_STATIC_HH #define BENCH_STATIC_HH #include "bench_parameter.hh" @@ -28,51 +28,41 @@ #include "timers/mixed_perf_analyzer.hh" #include "timers/x86_perf_analyzer.hh" -using namespace std; - - -template class Perf_Analyzer, template class Action, template class Interface> -void bench_static( void ){ - - string filename="bench_"+Action >::name()+".dat"; +template < + template class Perf_Analyzer, + template class Action, + template class Interface, + unsigned Sz +> +void bench_static() +{ + std::string filename="bench_" + Action >::name() + ".dat"; INFOS("starting " < tab_mflops; std::vector tab_sizes; - static_size_generator::go(tab_sizes,tab_mflops); - - dump_file_x_y(tab_sizes,tab_mflops,filename); + static_size_generator::go(tab_sizes, tab_mflops); + dump_file_x_y(tab_sizes, tab_mflops, filename); } // default Perf Analyzer +template < + template class Action, + template class Interface, + unsigned Sz +> +void bench_static() +{ + // if the rdtsc is not available : + bench_static(); + // if the rdtsc is available : + // bench_static(); -template class Action, template class Interface> -void bench_static( void ){ - - bench_static(); - //bench_static(); - //bench_static(); - + // Only for small problem size. Otherwize it will be too long + // bench_static(); } #endif - - - - - - - - - - - - - - - diff -Nur BTL-20030124/generic_bench/static/static_size_generator.hh BTL/generic_bench/static/static_size_generator.hh --- BTL-20030124/generic_bench/static/static_size_generator.hh 2003-01-09 14:33:50.000000000 +0100 +++ BTL/generic_bench/static/static_size_generator.hh 2003-11-12 18:26:52.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : static_size_generator.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, mar déc 3 18:59:36 CET 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,41 +16,47 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef _STATIC_SIZE_GENERATOR_HH #define _STATIC_SIZE_GENERATOR_HH -#include -using namespace std; +#include //recursive generation of statically defined matrix and vector sizes - -template class Perf_Analyzer, template class Action, template class Interface> -struct static_size_generator{ - static void go(vector & tab_sizes, vector & tab_mflops) +template < + int SIZE, + template class Perf_Analyzer, + template class Action, + template class Interface +> +struct static_size_generator +{ + static void go(std::vector& tab_sizes, std::vector& tab_mflops) { tab_sizes.push_back(SIZE); Perf_Analyzer > > perf_action; tab_mflops.push_back(perf_action.eval_mflops(SIZE)); - static_size_generator::go(tab_sizes,tab_mflops); + + static_size_generator::go(tab_sizes,tab_mflops); }; }; //recursion end - -template class Perf_Analyzer, template class Action, template class Interface> -struct static_size_generator<1,Perf_Analyzer,Action,Interface>{ - static void go(vector & tab_sizes, vector & tab_mflops) +template < + template class Perf_Analyzer, + template class Action, + template class Interface +> +struct static_size_generator<1, Perf_Analyzer, Action, Interface> +{ + static void go(std::vector& tab_sizes, std::vector& tab_mflops) { tab_sizes.push_back(1); + Perf_Analyzer > > perf_action; tab_mflops.push_back(perf_action.eval_mflops(1)); }; }; #endif - - - - diff -Nur BTL-20030124/generic_bench/timers/portable_perf_analyzer.hh BTL/generic_bench/timers/portable_perf_analyzer.hh --- BTL-20030124/generic_bench/timers/portable_perf_analyzer.hh 2003-01-15 11:06:09.000000000 +0100 +++ BTL/generic_bench/timers/portable_perf_analyzer.hh 2003-11-12 20:09:14.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : portable_perf_analyzer.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, mar déc 3 18:59:35 CET 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef _PORTABLE_PERF_ANALYZER_HH #define _PORTABLE_PERF_ANALYZER_HH @@ -24,111 +24,118 @@ #include "timers/portable_timer.hh" template -class Portable_Perf_Analyzer{ -public: - Portable_Perf_Analyzer( void ):_nb_calc(1),_nb_init(1),_chronos(){ - MESSAGE("Portable_Perf_Analyzer Ctor"); - }; - Portable_Perf_Analyzer( const Portable_Perf_Analyzer & ){ - INFOS("Copy Ctor not implemented"); - exit(0); - }; - ~Portable_Perf_Analyzer( void ){ - MESSAGE("Portable_Perf_Analyzer Dtor"); - }; - - - - inline double eval_mflops(int size) - { - - Action action(size); - - double time_baseline=time_init(action); - - while (time_baseline < MIN_TIME) { - - _nb_init*=2; - time_baseline=time_init(action); - } - - time_baseline=time_baseline/(double(_nb_init)); - - double time_action=time_calculate(action); - - while (time_action < MIN_TIME) { - - _nb_calc*=2; - time_action=time_calculate(action); - } - - // INFOS("size="< +Portable_Perf_Analyzer::~Portable_Perf_Analyzer() +{ + MESSAGE("Portable_Perf_Analyzer Dtor"); +}; + +template +double Portable_Perf_Analyzer::time_init(Action& action) +{ + // time measurement + _chronos.start(); + + for (unsigned ii = 0; ii < _nb_init; ii++){ + action.initialize(); + } + + _chronos.stop(); + + return _chronos.user_time(); +} + +template +double Portable_Perf_Analyzer::time_calculate(Action& action) +{ + // time measurement + _chronos.start(); + + for (unsigned ii = 0; ii <_nb_calc; ii++) { + // the measured bench self + action.initialize(); + action.calculate(); + } + + _chronos.stop(); + + return _chronos.user_time(); +} + +template +double Portable_Perf_Analyzer::eval_mflops(int size) +{ + Action action(size); + + double time_baseline = time_init(action); + + while (time_baseline < MIN_TIME) { + _nb_init*=2; + time_baseline=time_init(action); + } + + time_baseline=time_baseline/(double(_nb_init)); + + // perform the benchmark timing + double time_action=time_calculate(action); + + while (time_action < MIN_TIME) { + _nb_calc*=2; + time_action=time_calculate(action); + } + + // INFOS("size="<::iterator itr; for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) - { - outfile << (*itr).first << " " << (*itr).second << endl ; - } - + { + outfile << (*itr).first << " " << (*itr).second << endl ; + } + outfile.close(); } void dump_history(string filemane){ - + ofstream outfile (filemane.c_str(),ios::out) ; - for(int i=0 ; i<_history_mean_clicks.size() ; i++) - { - outfile << i << " " - << _history_mean_clicks[i] << " " - << _history_shortest_clicks[i] << " " + for(unsigned i=0 ; i<_history_mean_clicks.size() ; i++) + { + outfile << i << " " + << _history_mean_clicks[i] << " " + << _history_shortest_clicks[i] << " " << _history_most_occured_clicks[i] << endl ; - } - + } + outfile.close(); } - + double get_mean_clicks( void ){ - + std::map::iterator itr; - + unsigned long long mean_clicks=0; for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) - { - + { + mean_clicks+=(*itr).second*(*itr).first; - } + } return mean_clicks/double(_nb_sample); } double get_shortest_clicks( void ){ - + return double((*_counted_clicks.begin()).first); } @@ -188,18 +188,18 @@ std::map::iterator itr; for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) - { - + { + if (max_occurence<=(*itr).second){ max_occurence=(*itr).second; moc=(*itr).first; } - } - - return double(moc); + } + + return double(moc); } - + void clear( void ) { _counted_clicks.clear(); @@ -212,9 +212,9 @@ } - + private : - + union { unsigned long int n32[2] ; @@ -237,7 +237,7 @@ unsigned long long _nb_sample; - + }; diff -Nur BTL-20030124/generic_bench/timers/x86_timer.hh~ BTL/generic_bench/timers/x86_timer.hh~ --- BTL-20030124/generic_bench/timers/x86_timer.hh~ 2003-01-07 17:31:58.000000000 +0100 +++ BTL/generic_bench/timers/x86_timer.hh~ 1970-01-01 01:00:00.000000000 +0100 @@ -1,245 +0,0 @@ -//===================================================== -// File : x86_timer.hh -// Author : L. Plagne -// Copyright (C) EDF R&D, mar déc 3 18:59:35 CET 2002 -//===================================================== -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -#ifndef _X86_TIMER_HH -#define _X86_TIMER_HH - -#include -#include -#include -#include -//#include "system_time.h" -#include -#include "utilities.h" -#include -#include -#include -#include - -// frequence de la becanne en Hz -//#define FREQUENCY 648000000 -//#define FREQUENCY 1400000000 -#define FREQUENCY 1695000000 - -using namespace std; - - -class X86_Timer { - -public : - - X86_Timer( void ):_frequency(FREQUENCY),_nb_sample(0) - { - MESSAGE("X86_Timer Default Ctor"); - } - - inline void start( void ){ - - rdtsc(_click_start.n32[0],_click_start.n32[1]); - - } - - - inline void stop( void ){ - - rdtsc(_click_stop.n32[0],_click_stop.n32[1]); - - } - - - inline double frequency( void ){ - return _frequency; - } - - double get_elapsed_time_in_second( void ){ - - return (_click_stop.n64-_click_start.n64)/double(FREQUENCY); - - - } - - unsigned long long get_click( void ){ - - return (_click_stop.n64-_click_start.n64); - - } - - inline void find_frequency( void ){ - - time_t initial, final; - int dummy=2; - - initial = time(0); - start(); - do { - dummy+=2; - } - while(time(0)==initial); - // On est au debut d'un cycle d'une seconde !!! - initial = time(0); - start(); - do { - dummy+=2; - } - while(time(0)==initial); - final=time(0); - stop(); - INFOS("fine grained time : "<< get_elapsed_time_in_second()); - INFOS("coarse grained time : "<< final-initial); - _frequency=_frequency*get_elapsed_time_in_second()/double(final-initial); - INFOS("CPU frequency : "<< _frequency); - - } - - void add_get_click( void ){ - - _nb_sample++; - _counted_clicks[get_click()]++; - fill_history_clicks(); - - } - - void dump_statistics(string filemane){ - - ofstream outfile (filemane.c_str(),ios::out) ; - - std::map::iterator itr; - for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) - { - outfile << (*itr).first << " " << (*itr).second << endl ; - } - - outfile.close(); - - } - - void dump_history(string filemane){ - - ofstream outfile (filemane.c_str(),ios::out) ; - - - - for(int i=0 ; i<_history_mean_clicks.size() ; i++) - { - outfile << i << " " - << _history_mean_clicks[i] << " " - << _history_shortest_clicks[i] << " " - << _history_most_occured_clicks[i] << endl ; - } - - outfile.close(); - - } - - - - double get_mean_clicks( void ){ - - std::map::iterator itr; - - unsigned long long mean_clicks=0; - - for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) - { - - mean_clicks+=(*itr).second*(*itr).first; - } - - return mean_clicks/double(_nb_sample); - - } - - double get_shortest_clicks( void ){ - - return double((*_counted_clicks.begin()).first); - - } - - void fill_history_clicks( void ){ - - _history_mean_clicks.push_back(get_mean_clicks()); - _history_shortest_clicks.push_back(get_shortest_clicks()); - _history_most_occured_clicks.push_back(get_most_occured_clicks()); - - } - - - double get_most_occured_clicks( void ){ - - unsigned long long moc=0; - unsigned long long max_occurence=0; - - std::map::iterator itr; - - for(itr=_counted_clicks.begin() ; itr!=_counted_clicks.end() ; itr++) - { - - if (max_occurence<=(*itr).second){ - max_occurence=(*itr).second; - moc=(*itr).first; - } - } - - return double(moc); - - } - - void clear( void ) - { - _counted_clicks.clear(); - - _history_mean_clicks.clear(); - _history_shortest_clicks.clear(); - _history_most_occured_clicks.clear(); - - _nb_sample=0; - } - - - -private : - - union - { - unsigned long int n32[2] ; - unsigned long long n64 ; - } _click_start; - - union - { - unsigned long int n32[2] ; - unsigned long long n64 ; - } _click_stop; - - double _frequency ; - - map _counted_clicks; - - vector _history_mean_clicks; - vector _history_shortest_clicks; - vector _history_most_occured_clicks; - - unsigned long long _nb_sample; - - - -}; - - -#endif diff -Nur BTL-20030124/generic_bench/utils/dump_file_x_y.hh BTL/generic_bench/utils/dump_file_x_y.hh --- BTL-20030124/generic_bench/utils/dump_file_x_y.hh 2002-11-21 16:04:06.000000000 +0100 +++ BTL/generic_bench/utils/dump_file_x_y.hh 2003-11-12 19:53:23.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : dump_file_x_y.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:20 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,9 +16,10 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef DUMP_FILE_X_Y_HH #define DUMP_FILE_X_Y_HH + #include #include @@ -27,21 +28,17 @@ // [] operator for seting element // the vector element must have the << operator define -using namespace std; - template -void dump_file_x_y(const Vector_A & X, const Vector_B & Y, const std::string & filename){ - - ofstream outfile (filename.c_str(),ios::out) ; - int size=X.size(); - - for (int i=0;i +// Author : L. Plagne // Copyright (C) EDF R&D, mar déc 3 18:59:37 CET 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef SIZE_LIN_LOG #define SIZE_LIN_LOG @@ -30,41 +30,27 @@ X.resize(nb_point); - if (nb_point>ten){ - - for (int i=0;i ten) { + for (int i = 0; i < nine; i++) { + X[i] = i+1; } Vector log_size; - size_log(nb_point-nine,ten,size_max,log_size); - for (int i=0;i(); - bench_static(); - bench_static(); + bench_static(); + bench_static(); + bench_static(); return 0; } - - diff -Nur BTL-20030124/libs/tvmet/main.cpp BTL/libs/tvmet/main.cpp --- BTL-20030124/libs/tvmet/main.cpp 2003-01-21 13:05:17.000000000 +0100 +++ BTL/libs/tvmet/main.cpp 2003-11-14 13:29:57.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : main.cpp -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,21 +16,24 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #include "utilities.h" #include "tvmet_interface.hh" #include "static/bench_static.hh" #include "action_matrix_vector_product.hh" #include "action_matrix_matrix_product.hh" #include "action_axpy.hh" +#include "action_ata_product.hh" +#include "action_aat_product.hh" + int main() { - bench_static(); - bench_static(); - bench_static(); + bench_static(); + bench_static(); + bench_static(); + bench_static(); + bench_static(); return 0; } - - diff -Nur BTL-20030124/libs/tvmet/Makefile BTL/libs/tvmet/Makefile --- BTL-20030124/libs/tvmet/Makefile 2003-01-21 11:38:53.000000000 +0100 +++ BTL/libs/tvmet/Makefile 2003-10-30 19:02:08.000000000 +0100 @@ -1,8 +1,8 @@ -include $(BENCH_BASE)/Makefile.in +include $(BENCH_BASE)/Makefile.in -LIBS=$(LIBS_BASE) -INCLUDES=-I. $(INCLUDES_BASE) -I$(TVMET_INCLUDES) -OPTIM=$(OPTIM_BASE) +LIBS=$(LIBS_BASE) +INCLUDES=-I. $(INCLUDES_BASE) -I$(TVMET_ROOT)/include +OPTIM=$(shell echo `$(TVMET_ROOT)/tvmet-config --cxxflags`) DEBUG=$(DEBUG_BASE) CXXFLAGS = $(OPTIM) $(INCLUDES) @@ -13,8 +13,8 @@ all : $(DEPEND_BASE) main -main: Makefile main.o - $(CXX) -o main main.o $(LIBS) +main: Makefile main.o + $(CXX) -o main main.o $(LIBS) ########################################################################### diff -Nur BTL-20030124/libs/tvmet/tvmet_interface.hh BTL/libs/tvmet/tvmet_interface.hh --- BTL-20030124/libs/tvmet/tvmet_interface.hh 2003-01-21 12:05:19.000000000 +0100 +++ BTL/libs/tvmet/tvmet_interface.hh 2003-11-13 18:20:13.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : tvmet_interface.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:30 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef TVMET_INTERFACE_HH #define TVMET_INTERFACE_HH @@ -25,117 +25,98 @@ #include -using namespace tvmet; - template -class tvmet_interface{ - +class tvmet_interface +{ public : - + typedef real real_type ; typedef std::vector stl_vector; typedef std::vector stl_matrix; - - typedef Vector gene_vector; - typedef Matrix gene_matrix; - static inline std::string name( void ) - { + typedef tvmet::Vector gene_vector; + typedef tvmet::Matrix gene_matrix; + + static inline std::string name() { return "tvmet"; } - - - static void free_matrix(gene_matrix & A, int N){ - - return ; - } - - static void free_vector(gene_vector & B){ - - return ; - - } - - static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ - - for (int i=0; i +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:27 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #include "utilities.h" #include "ublas_interface.hh" #include "bench.hh" @@ -26,14 +26,16 @@ #include "action_ata_product.hh" #include "action_aat_product.hh" +using namespace std; + int main() { - bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); + bench > >(MIN_AXPY,MAX_AXPY,NB_POINT); + + bench > >(MIN_MV,MAX_MV,NB_POINT); - bench > >(MIN_MV,MAX_MV,NB_POINT); + bench > >(MIN_MM,MAX_MM,NB_POINT); - bench > >(MIN_MM,MAX_MM,NB_POINT); - bench > >(MIN_MM,MAX_MM,NB_POINT); bench > >(MIN_MM,MAX_MM,NB_POINT); @@ -41,5 +43,3 @@ return 0; } - - diff -Nur BTL-20030124/libs/ublas/ublas_interface.hh BTL/libs/ublas/ublas_interface.hh --- BTL-20030124/libs/ublas/ublas_interface.hh 2002-11-29 16:43:28.000000000 +0100 +++ BTL/libs/ublas/ublas_interface.hh 2003-11-13 21:58:08.000000000 +0100 @@ -1,14 +1,14 @@ //===================================================== // File : ublas_interface.hh -// Author : L. Plagne +// Author : L. Plagne // Copyright (C) EDF R&D, lun sep 30 14:23:27 CEST 2002 //===================================================== -// +// // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -16,7 +16,7 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// +// #ifndef UBLAS_INTERFACE_HH #define UBLAS_INTERFACE_HH @@ -29,7 +29,6 @@ #include #include - template class ublas_interface{ @@ -45,65 +44,65 @@ //typedef numerics::vector > gene_vector; typedef typename boost::numeric::ublas::matrix gene_matrix; typedef typename boost::numeric::ublas::vector gene_vector; - + static inline std::string name( void ) { return "ublas"; } - + static void free_matrix(gene_matrix & A, int N){ - + return ; } - + static void free_vector(gene_vector & B){ - + return ; - + } - + static inline void matrix_from_stl(gene_matrix & A, stl_matrix & A_stl){ - + A.resize(A_stl.size(),A_stl[0].size()); - + for (int i=0; i1.3.0 +TVMET_ROOT=/home/opetzold/work/tvmet ## UBLAS - -BOOST_ROOT=/home01/lplagne/public/boost/boost_1_28_0 +BOOST_ROOT=/usr/include/boost ## BLITZ - -##BLITZ_ROOT=/home01/lplagne/public/blitz/blitz-20001213 -BLITZ_ROOT=/home01/lplagne/public/blitz/blitz-0.6 +BLITZ_ROOT=/home/opetzold/work/blitz++-0.7 ## MTL -MTL_ROOT=/home01/lplagne/public/MTL/include +##MTL_ROOT=/home01/lplagne/public/MTL/include ##MTL_ROOT=/home01/lplagne/public/MTL/mtl-2.1.2-20 ##MTL_PATCH=/home01/lplagne/mtl_patch/mtl-spec-1.0 ##ITL_ROOT=/home01/lplagne/public/MTL/ITL/itl-4.0.0-1 ## ATLAS - -ATLAS_BLAS_LIB=/home01/lplagne/public/atlas/ATLAS/lib/Linux_PIIISSE1 -ATLAS_BLAS_INCLUDE2=/home01/lplagne/public/atlas/ATLAS/include/Linux_PIIISSE1 -ATLAS_BLAS_INCLUDE=/home01/lplagne/public/atlas/ATLAS/include +ATLAS_BLAS_LIB=/usr/local/lib +ATLAS_BLAS_INCLUDE2=/usr/local/include/atlas/Linux_P4SSE2 +ATLAS_BLAS_INCLUDE=/usr/local/include/atlas ## C_BLAS - -C_BLAS_INCLUDE=/home01/lplagne/public/blas_netlib/CBLAS/src -C_BLAS_LIB=/home01/lplagne/public/blas_netlib/CBLAS/lib/LINUX/cblas_LINUX.a -F77_BLAS_LIB=/home01/lplagne/public/blas_netlib/f77_blas/libblas.a +#C_BLAS_INCLUDE=/home01/lplagne/public/blas_netlib/CBLAS/src +#C_BLAS_LIB=/home01/lplagne/public/blas_netlib/CBLAS/lib/LINUX/cblas_LINUX.a +#F77_BLAS_LIB=/home01/lplagne/public/blas_netlib/f77_blas/libblas.a ## INTEL_BLAS - -INTEL_BLAS_INCLUDE=/opt/intel/mkl/include -IBLIB=/opt/intel/mkl/lib/32 -INTEL_BLAS_LIB=$(IBLIB)/libmkl_lapack.a $(IBLIB)/libmkl_p3.a $(IBLIB)/libmkl_p4.a $(IBLIB)/libguide.a $(IBLIB)/libmkl_def.a -lg2c -lpthread -##INTEL_BLAS_LIB=-L/opt/intel/mkl/lib/32 -lmkl_lapack64 -lmkl_lapack32 -lmkl_p4 -lmkl_p3 -lguide -lmkl_def -lg2c +#INTEL_BLAS_INCLUDE=/opt/intel/mkl/include +#IBLIB=/opt/intel/mkl/lib/32 +#INTEL_BLAS_LIB=$(IBLIB)/libmkl_lapack.a $(IBLIB)/libmkl_p3.a $(IBLIB)/libmkl_p4.a $(IBLIB)/libguide.a $(IBLIB)/libmkl_def.a -lg2c -lpthread +##INTEL_BLAS_LIB=-L/opt/intel/mkl/lib/32 -lmkl_lapack64 -lmkl_lapack32 -lmkl_p4 -lmkl_p3 -lguide -lmkl_def -lg2c -## INCLUDES +## INCLUDES ACTIONS=$(BENCH_BASE)/actions @@ -52,13 +45,13 @@ INCLUDES_BASE= -I$(BENCH_BASE)/includes -I$(STL) -I$(GENERIC) -I$(ACTIONS) -I$(BENCH_UTILS) -## LIBS +## LIBS -LIBS_BASE = -lm +LIBS_BASE = -lm ##CXX = KCC -DEFINED_VAR= +DEFINED_VAR= CXX=g++ $(DEFINED_VAR) MAKE_LIB= ar cr @@ -78,7 +71,7 @@ ########################################################################### -.SUFFIXES: .o .cpp +.SUFFIXES: .o .cpp .cpp.o: $(CXX) $(CXXFLAGS) -c $< @@ -86,14 +79,14 @@ ########################################################################### ########################################################################### -.SUFFIXES: .o .cxx +.SUFFIXES: .o .cxx .cxx.o: $(CXX) $(CXXFLAGS) -c $< ########################################################################### -default: +default: make all test_conf : @@ -105,5 +98,3 @@ clean: rm -f *.o *.ii *.int.c *.s *~ \#* main core rm *.dat *.a rm -rf ti_files - -