Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

memusage.h File Reference

Go to the source code of this file.

Classes

class  memusageinit

Functions

unsigned long memusage (const char **source=0)
double memusage_kB ()
double memusage_MB ()

Variables

memusageinit memusageinitobject


Function Documentation

unsigned long memusage const char **  source = 0  ) 
 

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 142 of file memusage.C.

References memusage_mallinfo(), memusage_mstats(), memusage_proc_self_stat(), and memusage_ps().

Referenced by main::main(), memusage_kB(), and memusage_MB().

00142                                             {
00143 
00144   unsigned long memtotal = 0;
00145   const char* s = "ERROR";
00146 
00147   if ( ! CmiMemoryIs(CMI_MEMORY_IS_OS) ) {
00148     memtotal = CmiMemoryUsage();  s = "CmiMemoryUsage";
00149   }
00150 
00151 #if defined(WIN32) && !defined(__CYGWIN__) && CHARM_VERSION > 60102
00152   if ( ! memtotal ) {
00153     memtotal = CmiMemoryUsage();  s = "GetProcessMemoryInfo";
00154   }
00155 #endif
00156 
00157   if ( ! memtotal ) {
00158     memtotal = memusage_proc_self_stat();  s = "/proc/self/stat";
00159   }
00160 
00161 #if CMK_BLUEGENEP
00162   if( ! memtotal) { memtotal = memusage_bgp(); s="mallinfo on BG/P"; }
00163 #endif
00164 
00165   if ( ! memtotal ) { memtotal = memusage_mstats(); s = "mstats"; }
00166 
00167   if ( ! memtotal ) { memtotal = memusage_mallinfo(); s = "mallinfo"; }
00168 
00169   if ( ! memtotal ) { memtotal = memusageinit::memusage_sbrk(); s = "sbrk"; }
00170 
00171   if ( ! memtotal ) { memtotal = memusage_ps(); s = "ps"; }
00172 
00173   if ( ! memtotal ) { memtotal = CmiMemoryUsage();  s = "CmiMemoryUsage"; }
00174 
00175   if ( ! memtotal ) s = "nothing";
00176 
00177   if ( source ) *source = s;
00178 
00179   return memtotal;
00180 
00181 }

double memusage_kB  )  [inline]
 

Definition at line 12 of file memusage.h.

References memusage().

00012 { return memusage() / 1024.; }

double memusage_MB  )  [inline]
 

Definition at line 13 of file memusage.h.

References memusage().

Referenced by CollectionMaster::disposeForces(), CollectionMaster::disposePositions(), CollectionMaster::disposeVelocities(), BackEnd::exit(), main::main(), Controller::printEnergies(), Rebalancer::printLoads(), Controller::printTiming(), Node::run(), CollectionMaster::startNextRoundOutputForce(), CollectionMaster::startNextRoundOutputPos(), CollectionMaster::startNextRoundOutputVel(), and Node::startup().

00013 { return memusage() / 1048576.; }


Variable Documentation

memusageinit memusageinitobject [static]
 

Definition at line 25 of file memusage.h.


Generated on Sun Feb 12 04:07:58 2012 for NAMD by  doxygen 1.3.9.1