Package PyFoam :: Package Applications :: Module CommonReportUsage
[hide private]
[frames] | no frames]

Source Code for Module PyFoam.Applications.CommonReportUsage

 1  """ 
 2  Class that implements the common functionality for reporting the usage of a run 
 3  """ 
 4   
 5  from PyFoam.ThirdParty.six import print_ 
 6   
7 -class CommonReportUsage(object):
8 """ The class that reports the resource usage 9 """ 10
11 - def addOptions(self):
12 self.ensureGeneralOptions() 13 self.generalOpts.add_option("--report-usage", 14 action="store_true", 15 default=False, 16 dest="reportUsage", 17 help="After the execution the maximum memory usage is printed to the screen")
18
19 - def reportUsage(self,run):
20 if self.opts.reportUsage: 21 print_("\n Used Memory: ",run.run.usedMemory(),"MB")
22 23 # Should work with Python3 and Python2 24