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

static 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 156 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().

00156                                             {
00157 
00158   unsigned long memtotal = 0;
00159   const char* s = "ERROR";
00160 
00161   if ( ! CmiMemoryIs(CMI_MEMORY_IS_OS) ) {
00162     memtotal = CmiMemoryUsage();  s = "CmiMemoryUsage";
00163   }
00164 
00165 #if CMK_BLUEGENEQ
00166   if( ! memtotal) { memtotal = memusage_bgq(); s="Kernel_GetMemorySize on BG/Q"; }
00167 #endif
00168 
00169 #if CMK_BLUEGENEP
00170   if( ! memtotal) { memtotal = memusage_bgp(); s="mallinfo on BG/P"; }
00171 #endif
00172 
00173 #if defined(WIN32) && !defined(__CYGWIN__)
00174   if ( ! memtotal ) {
00175     memtotal = CmiMemoryUsage();  s = "GetProcessMemoryInfo";
00176   }
00177 #endif
00178 
00179   if ( ! memtotal ) {
00180     memtotal = memusage_proc_self_stat();  s = "/proc/self/stat";
00181   }
00182 
00183   if ( ! memtotal ) { memtotal = memusage_mstats(); s = "mstats"; }
00184 
00185   if ( ! memtotal ) { memtotal = memusage_mallinfo(); s = "mallinfo"; }
00186 
00187   if ( ! memtotal ) { memtotal = memusageinit::memusage_sbrk(); s = "sbrk"; }
00188 
00189   if ( ! memtotal ) { memtotal = memusage_ps(); s = "ps"; }
00190 
00191   if ( ! memtotal ) { memtotal = CmiMemoryUsage();  s = "CmiMemoryUsage"; }
00192 
00193   if ( ! memtotal ) s = "nothing";
00194 
00195   if ( source ) *source = s;
00196 
00197   return memtotal;
00198 
00199 }

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 Fri Sep 22 01:17:16 2017 for NAMD by  doxygen 1.4.7