[pyfr] 09/32: Record the wall clock time in the stats file.
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Apr 21 08:21:50 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository pyfr.
commit ee65ba4f99d3a7183ba8f9007a06e2bfef9fb663
Author: Freddie Witherden <freddie at witherden.org>
Date: Thu Feb 4 11:24:43 2016 +0000
Record the wall clock time in the stats file.
---
pyfr/integrators/controllers.py | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/pyfr/integrators/controllers.py b/pyfr/integrators/controllers.py
index 286e3f1..cd55af8 100644
--- a/pyfr/integrators/controllers.py
+++ b/pyfr/integrators/controllers.py
@@ -2,6 +2,7 @@
import math
import re
+import time
from pyfr.integrators.base import BaseIntegrator
from pyfr.mpiutil import get_comm_rank_root, get_mpi
@@ -37,6 +38,9 @@ class BaseController(BaseIntegrator):
# Event handlers for advance_to
self.completed_step_handlers = proxylist([])
+ # Record the starting wall clock time
+ self._wstart = time.time()
+
# Load any plugins specified in the config file
for s in self.cfg.sections():
m = re.match('soln-plugin-(.+?)(?:-(.+))?$', s)
@@ -52,6 +56,12 @@ class BaseController(BaseIntegrator):
# Delete the memory-intensive elements map from the system
del self.system.ele_map
+ def collect_stats(self, stats):
+ super().collect_stats(stats)
+
+ wtime = time.time() - self._wstart
+ stats.set('solver-time-integrator', 'wall-time', wtime)
+
def _accept_step(self, dt, idxcurr, err=None):
self.tcurr += dt
self.nacptsteps += 1
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pyfr.git
More information about the debian-science-commits
mailing list