[cig-commits] r19552 - short/3D/PyLith/branches/v1.6-stable/pylith/utils
brad at geodynamics.org
brad at geodynamics.org
Wed Feb 1 09:01:03 PST 2012
Author: brad
Date: 2012-02-01 09:01:03 -0800 (Wed, 01 Feb 2012)
New Revision: 19552
Modified:
short/3D/PyLith/branches/v1.6-stable/pylith/utils/profiling.py
Log:
Added process rank to resource usage string.
Modified: short/3D/PyLith/branches/v1.6-stable/pylith/utils/profiling.py
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/pylith/utils/profiling.py 2012-02-01 15:46:19 UTC (rev 19551)
+++ short/3D/PyLith/branches/v1.6-stable/pylith/utils/profiling.py 2012-02-01 17:01:03 UTC (rev 19552)
@@ -16,7 +16,7 @@
# ----------------------------------------------------------------------
#
-## @file pylith/utils/profile.py
+## @file pylith/utils/profiling.py
# ----------------------------------------------------------------------
def resourceUsage():
@@ -42,7 +42,11 @@
"""
Get CPU time and memory usage as a string.
"""
- return "CPU time: %s, Memory usage: %.2f MB" % resourceUsage()
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ (cputime, memory) = resourceUsage()
+ return "[%d] CPU time: %s, Memory usage: %.2f MB" % \
+ (comm.rank, cputime, memory)
# End of file
More information about the CIG-COMMITS
mailing list