← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3642: Add ENABLE_PROFILING option

 

------------------------------------------------------------
revno: 3642
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Wed 2015-04-29 19:12:57 +0200
message:
  Add ENABLE_PROFILING option
modified:
  CMakeLists.txt
  doc/sphinx/prog.rst
  py/timing.py


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2015-04-27 16:02:27 +0000
+++ CMakeLists.txt	2015-04-29 17:12:57 +0000
@@ -18,6 +18,7 @@
 #  ENABLE_SPH: enable SPH-option, Smoothed Particle Hydrodynamics (OFF by default, experimental)
 #  ENABLE_LIQMIGRATION: enable LIQMIGRATION-option, see [Mani2013] for details (OFF by default)
 #  ENABLE_MASK_ARBITRARY: enable MASK_ARBITRARY option (OFF by default)
+#  ENABLE_PROFILING: enable profiling, e.g. shows some more metrics, which can define bottlenecks of the code (OFF by default)
 #  runtimePREFIX: used for packaging, when install directory is not the same is runtime directory (/usr/local by default)
 #  CHUNKSIZE: set >1, if you want several sources to be compiled at once. Increases compilation speed and RAM-consumption during it (1 by default).
 #  VECTORIZE: enables vectorization and alignment in Eigen3 library, experimental (OFF by default)
@@ -125,6 +126,7 @@
 OPTION(ENABLE_LBMFLOW "Enable LBM engine (very experimental)" ON)
 OPTION(ENABLE_LIQMIGRATION "Enable liquid control (very experimental), see [Mani2013] for details" OFF)
 OPTION(ENABLE_MASK_ARBITRARY "Enable arbitrary precision of bitmask variables (only Body::groupMask yet implemented) (experimental). Use -DMASK_ARBITRARY_SIZE=int to set number of used bits (256 by default)" OFF)
+OPTION(ENABLE_PROFILING "Enable profiling, e.g. shows some more metrics, which can define bottlenecks of the code (OFF by default)" OFF)
 
 #===========================================================
 # Use Eigen3 by default
@@ -368,6 +370,15 @@
 
 #===========================================================
 
+IF(ENABLE_PROFILING)
+  SET(CONFIGURED_FEATS "${CONFIGURED_FEATS} PROFILING")
+  ADD_DEFINITIONS("-DUSE_TIMING_DELTAS")
+ELSE(ENABLE_PROFILING)
+  SET(DISABLED_FEATS "${DISABLED_FEATS} PROFILING")
+ENDIF(ENABLE_PROFILING)
+
+#===========================================================
+
 IF (NOT INSTALL_PREFIX)
  SET(CMAKE_INSTALL_PREFIX "/usr/local")
  MESSAGE("Yade will be installed to default path ${CMAKE_INSTALL_PREFIX}, if you want to override it use -DINSTALL_PREFIX option.")

=== modified file 'doc/sphinx/prog.rst'
--- doc/sphinx/prog.rst	2015-04-24 15:54:07 +0000
+++ doc/sphinx/prog.rst	2015-04-29 17:12:57 +0000
@@ -1158,7 +1158,7 @@
 		   YADE_CLASS_BASE_DOC_ATTRS_CTOR(Law2_ScGeom_CpmPhys_Cpm,LawFunctor,"docstring",
 		      /* attrs */,
 		      /* constructor */
-		      timingDeltas=shared_ptr<TimingDeltas>(new TimingDeltas); // timingDeltas object is automatically initialized when using -DCMAKE_CXX_FLAGS="-DUSE_TIMING_DELTAS" cmake option
+		      timingDeltas=shared_ptr<TimingDeltas>(new TimingDeltas); // timingDeltas object is automatically initialized when using -DENABLE_PROFILING=1 cmake option
 		   );
 		   // ...
 		};
@@ -1186,7 +1186,7 @@
 		   timingDeltas->checkpoint("rest");
 		}
 
-#. Alternatively, you can compile Yade using -DCMAKE_CXX_FLAGS="-DUSE_TIMING_DELTAS" cmake option and use predefined macros TIMING_DELTAS_START and TIMING_DELTAS_CHECKPOINT. Without -DUSE_TIMING_DELTAS options, those macros are empty and do nothing.
+#. Alternatively, you can compile Yade using -DENABLE_PROFILING=1 cmake option and use predefined macros TIMING_DELTAS_START and TIMING_DELTAS_CHECKPOINT. Without -DENABLE_PROFILING options, those macros are empty and do nothing.
 	.. code-block:: c++
 
 		void Law2_ScGeom_CpmPhys_Cpm::go(shared_ptr<IGeom>& _geom,

=== modified file 'py/timing.py'
--- py/timing.py	2013-04-24 16:19:28 +0000
+++ py/timing.py	2015-04-29 17:12:57 +0000
@@ -86,7 +86,7 @@
 		TOTAL                                                             10733564us              100.00%
 
 
-	sample output (compiled with -DCMAKE_CXX_FLAGS="-DUSE_TIMING_DELTAS" option):
+	sample output (compiled with -DENABLE_PROFILING=1 option):
 
 	.. code-block:: none