summaryrefslogtreecommitdiff
path: root/libs/mpi/src/python/py_timer.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2013-06-25 22:59:01 +0000
committer <>2013-09-27 11:49:28 +0000
commit8c4528713d907ee2cfd3bfcbbad272c749867f84 (patch)
treec09e2ce80f47b90c85cc720f5139089ad9c8cfff /libs/mpi/src/python/py_timer.cpp
downloadboost-tarball-baserock/morph.tar.gz
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_54_0.tar.bz2.boost_1_54_0baserock/morph
Diffstat (limited to 'libs/mpi/src/python/py_timer.cpp')
-rw-r--r--libs/mpi/src/python/py_timer.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/libs/mpi/src/python/py_timer.cpp b/libs/mpi/src/python/py_timer.cpp
new file mode 100644
index 000000000..88b1b4062
--- /dev/null
+++ b/libs/mpi/src/python/py_timer.cpp
@@ -0,0 +1,48 @@
+// (C) Copyright 2006 Douglas Gregor <doug.gregor -at- gmail.com>
+
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// Authors: Douglas Gregor
+
+/** @file timer.cpp
+ *
+ * This file reflects the Boost.MPI @c timer class into
+ * Python.
+ */
+#include <boost/python.hpp>
+#include <boost/mpi/timer.hpp>
+
+using namespace boost::python;
+using namespace boost::mpi;
+
+namespace boost { namespace mpi { namespace python {
+
+extern const char* timer_docstring;
+extern const char* timer_default_constructor_docstring;
+extern const char* timer_restart_docstring;
+extern const char* timer_elapsed_docstring;
+extern const char* timer_elapsed_min_docstring;
+extern const char* timer_elapsed_max_docstring;
+extern const char* timer_time_is_global_docstring;
+
+void export_timer()
+{
+ using boost::python::arg;
+ using boost::python::object;
+
+ class_<timer>("Timer", timer_docstring)
+ .def(init<>())
+ .def("restart", &timer::restart, timer_restart_docstring)
+ .add_property("elapsed", &timer::elapsed, timer_elapsed_docstring)
+ .add_property("elapsed_min", &timer::elapsed_min,
+ timer_elapsed_min_docstring)
+ .add_property("elapsed_max", &timer::elapsed_max,
+ timer_elapsed_max_docstring)
+ .add_property("time_is_global", &timer::time_is_global,
+ timer_time_is_global_docstring)
+ ;
+}
+
+} } } // end namespace boost::mpi::python