diff --git a/App/src/main.cpp b/App/src/main.cpp index 7e67748a4ba9e3258098c8091ef2d4f3c5a7824e..f2d3740b8d7e8ca18400d67f2423d8ef4d16ebda 100644 --- a/App/src/main.cpp +++ b/App/src/main.cpp @@ -32,7 +32,7 @@ int main(int argc, char **argv) AddCoreOptions(&command_line_options); command_line_options.parseCommandLine(argc, argv); - MSG::SetLevel(command_line_options["msgsvc"].as<std::string>()); + if(command_line_options.getVariables().count("msglog")) MSG::SetLevel(command_line_options["msglog"].as<std::string>()); // setting graphics environment TApplication *theApp(0); diff --git a/Core/Core.pro b/Core/Core.pro index 5c2f89814865e134eba16733976b3bef1a2d5c9c..c4c199fea896264e7aedff42bad6411e9dc061f6 100644 --- a/Core/Core.pro +++ b/Core/Core.pro @@ -6,7 +6,7 @@ TEMPLATE = lib CONFIG += plugin # to remove versions from file name QT -= core gui QMAKE_EXTENSION_SHLIB = so # making standard *.so extension -CONFIG += BORNAGAIN_PYTHON +#CONFIG += BORNAGAIN_PYTHON # ----------------------------------------------------------------------------- # source and headers diff --git a/Core/PythonAPI/src/IndexVector3D.pypp.cpp b/Core/PythonAPI/src/IndexVector3D.pypp.cpp index d20c1039258ea7b3695ca7d7ce9baf431de5faef..ed500517f28c1cf6aec89cbd88ef2abb996b7f82 100644 --- a/Core/PythonAPI/src/IndexVector3D.pypp.cpp +++ b/Core/PythonAPI/src/IndexVector3D.pypp.cpp @@ -83,11 +83,6 @@ void register_IndexVector3D_class(){ typedef bp::class_< Geometry::BasicVector3D< int > > IndexVector3D_exposer_t; IndexVector3D_exposer_t IndexVector3D_exposer = IndexVector3D_exposer_t( "IndexVector3D", bp::init< >() ); bp::scope IndexVector3D_scope( IndexVector3D_exposer ); - bp::scope().attr("X") = (int)Geometry::BasicVector3D<int>::X; - bp::scope().attr("Y") = (int)Geometry::BasicVector3D<int>::Y; - bp::scope().attr("Z") = (int)Geometry::BasicVector3D<int>::Z; - bp::scope().attr("NUM_COORDINATES") = (int)Geometry::BasicVector3D<int>::NUM_COORDINATES; - bp::scope().attr("SIZE") = (int)Geometry::BasicVector3D<int>::SIZE; IndexVector3D_exposer.def( bp::init< int const &, int const &, int const & >(( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") )) ); IndexVector3D_exposer.def( bp::self *= bp::other< double >() ); IndexVector3D_exposer.def( bp::self += bp::self ); diff --git a/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp b/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp index 29ea6cdd2800ace6baba417787464fd3c2be56af..e958fa1b6a7a4b52ec1f63ec3af2a321131fe6bd 100644 --- a/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp +++ b/Core/PythonAPI/src/PythonInterface_free_functions.pypp.cpp @@ -79,39 +79,6 @@ namespace bp = boost::python; void register_free_functions(){ - { //::Geometry::CrossProduct - - typedef ::Geometry::BasicVector3D< std::complex< double > > ( *CrossProduct_function_type )( ::Geometry::BasicVector3D< std::complex< double > > const &,::Geometry::BasicVector3D< std::complex< double > > const & ); - - bp::def( - "CrossProduct" - , CrossProduct_function_type( &::Geometry::CrossProduct ) - , ( bp::arg("left"), bp::arg("right") ) ); - - } - - { //::Geometry::CrossProduct - - typedef ::Geometry::BasicVector3D< double > ( *CrossProduct_function_type )( ::Geometry::BasicVector3D< double > const &,::Geometry::BasicVector3D< double > const & ); - - bp::def( - "CrossProduct" - , CrossProduct_function_type( &::Geometry::CrossProduct ) - , ( bp::arg("left"), bp::arg("right") ) ); - - } - - { //::Geometry::DotProduct - - typedef double ( *DotProduct_function_type )( ::Geometry::BasicVector3D< double > const &,::Geometry::BasicVector3D< double > const & ); - - bp::def( - "DotProduct" - , DotProduct_function_type( &::Geometry::DotProduct ) - , ( bp::arg("left"), bp::arg("right") ) ); - - } - { //::GetOutputData typedef ::PyObject * ( *GetOutputData_function_type )( ::Simulation const & ); diff --git a/Core/PythonAPI/src/cvector_t.pypp.cpp b/Core/PythonAPI/src/cvector_t.pypp.cpp index be59e9aae0fb8844c9d719c01cba2dc9c71ace4e..4dfd930c244b7652c0ed6a2a60acee099bc3fb46 100644 --- a/Core/PythonAPI/src/cvector_t.pypp.cpp +++ b/Core/PythonAPI/src/cvector_t.pypp.cpp @@ -83,11 +83,6 @@ void register_cvector_t_class(){ typedef bp::class_< Geometry::BasicVector3D< std::complex< double > > > cvector_t_exposer_t; cvector_t_exposer_t cvector_t_exposer = cvector_t_exposer_t( "cvector_t", bp::init< >() ); bp::scope cvector_t_scope( cvector_t_exposer ); - bp::scope().attr("X") = (int)Geometry::BasicVector3D<std::complex<double> >::X; - bp::scope().attr("Y") = (int)Geometry::BasicVector3D<std::complex<double> >::Y; - bp::scope().attr("Z") = (int)Geometry::BasicVector3D<std::complex<double> >::Z; - bp::scope().attr("NUM_COORDINATES") = (int)Geometry::BasicVector3D<std::complex<double> >::NUM_COORDINATES; - bp::scope().attr("SIZE") = (int)Geometry::BasicVector3D<std::complex<double> >::SIZE; cvector_t_exposer.def( bp::init< std::complex< double > const &, std::complex< double > const &, std::complex< double > const & >(( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") )) ); { //::Geometry::BasicVector3D< std::complex< double > >::cross @@ -287,14 +282,9 @@ void register_cvector_t_class(){ , z_function_type( &::Geometry::BasicVector3D< std::complex< double > >::z ) ); } - cvector_t_exposer.def( bp::self != bp::self ); cvector_t_exposer.def( bp::self + bp::self ); - cvector_t_exposer.def( +bp::self ); cvector_t_exposer.def( bp::self - bp::self ); - cvector_t_exposer.def( -bp::self ); - cvector_t_exposer.def( bp::self / bp::other< std::complex< double > >() ); - cvector_t_exposer.def( bp::self_ns::str( bp::self ) ); - cvector_t_exposer.def( bp::self == bp::self ); + cvector_t_exposer.def( bp::self / bp::other< double >() ); } } diff --git a/Core/PythonAPI/src/kvector_t.pypp.cpp b/Core/PythonAPI/src/kvector_t.pypp.cpp index 2f8e8e6b28c0bffab42975f99437f7aa9f5248bb..21fc19e5962dc5fb2c5f50a9d472e2bd33206aef 100644 --- a/Core/PythonAPI/src/kvector_t.pypp.cpp +++ b/Core/PythonAPI/src/kvector_t.pypp.cpp @@ -83,11 +83,6 @@ void register_kvector_t_class(){ typedef bp::class_< Geometry::BasicVector3D< double > > kvector_t_exposer_t; kvector_t_exposer_t kvector_t_exposer = kvector_t_exposer_t( "kvector_t", bp::init< >() ); bp::scope kvector_t_scope( kvector_t_exposer ); - bp::scope().attr("X") = (int)Geometry::BasicVector3D<double>::X; - bp::scope().attr("Y") = (int)Geometry::BasicVector3D<double>::Y; - bp::scope().attr("Z") = (int)Geometry::BasicVector3D<double>::Z; - bp::scope().attr("NUM_COORDINATES") = (int)Geometry::BasicVector3D<double>::NUM_COORDINATES; - bp::scope().attr("SIZE") = (int)Geometry::BasicVector3D<double>::SIZE; kvector_t_exposer.def( bp::init< double const &, double const &, double const & >(( bp::arg("x1"), bp::arg("y1"), bp::arg("z1") )) ); { //::Geometry::BasicVector3D< double >::cross @@ -287,17 +282,7 @@ void register_kvector_t_class(){ , z_function_type( &::Geometry::BasicVector3D< double >::z ) ); } - kvector_t_exposer.def( bp::self != bp::self ); - kvector_t_exposer.def( bp::self * bp::self ); - kvector_t_exposer.def( bp::other< double >() * bp::self ); - kvector_t_exposer.def( bp::self * bp::other< double >() ); - kvector_t_exposer.def( bp::self + bp::self ); - kvector_t_exposer.def( +bp::self ); - kvector_t_exposer.def( bp::self - bp::self ); - kvector_t_exposer.def( -bp::self ); - kvector_t_exposer.def( bp::self / bp::other< double >() ); kvector_t_exposer.def( bp::self_ns::str( bp::self ) ); - kvector_t_exposer.def( bp::self == bp::self ); } } diff --git a/Core/PythonAPI/src/vector_kvector_t.pypp.cpp b/Core/PythonAPI/src/vector_kvector_t.pypp.cpp index bb390ee42a5ecf754e7d4e8ad95978b6443c54cc..a2f98448a2bd83504065241fb590ee38dd96cc6e 100644 --- a/Core/PythonAPI/src/vector_kvector_t.pypp.cpp +++ b/Core/PythonAPI/src/vector_kvector_t.pypp.cpp @@ -83,6 +83,7 @@ void register_vector_kvector_t_class(){ typedef bp::class_< std::vector< Geometry::BasicVector3D<double> > > vector_kvector_t_exposer_t; vector_kvector_t_exposer_t vector_kvector_t_exposer = vector_kvector_t_exposer_t( "vector_kvector_t" ); bp::scope vector_kvector_t_scope( vector_kvector_t_exposer ); + //WARNING: the next line of code will not compile, because "::Geometry::BasicVector3D<double>" does not have operator== ! vector_kvector_t_exposer.def( bp::vector_indexing_suite< ::std::vector< Geometry::BasicVector3D<double> > >() ); } diff --git a/Examples/Performance/perf_history.txt b/Examples/Performance/perf_history.txt index 0e45b1216f9e7431179f770dbb8a1e08fff8ec98..dfd345f3a194526c05050a7f00ee41d825dcdeae 100644 --- a/Examples/Performance/perf_history.txt +++ b/Examples/Performance/perf_history.txt @@ -198,3 +198,7 @@ # (and ./App --mesocrystal2 gives 24.77 (4 threads), 54.66 (1 thread)) 2013-03-21 10:19:28 | jcnsopc73 | macosx64, 2800 MHz | 285714 | 24.0964 | 22.9885 | 5.71429 | +# after changes in BasicVector3D (no virtual destructor) +# (and ./App --mesocrystal2 gives 23.74 (4 threads), 51.54 (1 thread)) +2013-03-22 17:05:17 | jcnsopc73 | macosx64, 2800 MHz | 298507 | 24.0964 | 24.6914 | 6.25 | +2013-03-22 17:05:32 | jcnsopc73 | macosx64, 2800 MHz | 294118 | 24.3902 | 25 | 6.25 | diff --git a/Fit/Fit.pro b/Fit/Fit.pro index ddb6211be830282d0ed799b4d4811bc3dd0c49b7..62cc3e90ba292e9f384be59e7f45589b297da409 100644 --- a/Fit/Fit.pro +++ b/Fit/Fit.pro @@ -6,7 +6,7 @@ TEMPLATE = lib CONFIG += plugin # to remove versions from file name QT -= core gui QMAKE_EXTENSION_SHLIB = so # making standard *.so extension -CONFIG += BORNAGAIN_PYTHON +#CONFIG += BORNAGAIN_PYTHON CONFIG += BORNAGAIN_ROOT # ----------------------------------------------------------------------------- diff --git a/Macros/BoostPythonGenerator/MakePyCore.py b/Macros/BoostPythonGenerator/MakePyCore.py index 4f5c7217869450c1f00fa93fc251ce5629f6ac45..325b66380589a1ab9d8bd40d94b4772aef95d49c 100644 --- a/Macros/BoostPythonGenerator/MakePyCore.py +++ b/Macros/BoostPythonGenerator/MakePyCore.py @@ -100,8 +100,8 @@ def AdditionalRules(mb): #mb.classes(lambda decl: 'Geometry::BasicVector3D<std::complex<double> >' in decl.decl_string ).exclude() #mb.free_operators( lambda decl: 'Geometry::BasicVector3D<std::complex<double> >' in decl.decl_string ).exclude() #mb.free_functions( lambda decl: 'Geometry::BasicVector3D<std::complex<double> >' in decl.decl_string ).exclude() - mb.classes(lambda decl: 'Geometry::BasicVector3D<std::complex<double> const>' in decl.decl_string ).exclude() - mb.free_operators( lambda decl: 'Geometry::BasicVector3D<std::complex<double> const>' in decl.decl_string ).exclude() + #mb.classes(lambda decl: 'Geometry::BasicVector3D<std::complex<double> const>' in decl.decl_string ).exclude() + #mb.free_operators( lambda decl: 'Geometry::BasicVector3D<std::complex<double> const>' in decl.decl_string ).exclude() #mb.free_functions( lambda decl: 'Geometry::BasicVector3D<std::complex<double> const>' in decl.decl_string ).exclude() classes = mb.classes() # here we have to exclude all templated methods which are not defined complex<double>, otherwise py++ will try to generate wrappers