Skip to content

Commit

Permalink
Fix displaying detected physical memory size if command line option -…
Browse files Browse the repository at this point in the history
…M is used.
  • Loading branch information
herr-biber committed Nov 10, 2013
1 parent eb59f88 commit 94501e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pmbw.cc
Expand Up @@ -746,6 +746,8 @@ int main(int argc, char* argv[])
size_t physical_mem = sysconf(_SC_PHYS_PAGES) * (size_t)sysconf(_SC_PAGESIZE);
g_physical_cpus = sysconf(_SC_NPROCESSORS_ONLN);

ERR("Detected " << physical_mem / 1024/1024 << " MiB physical RAM and " << g_physical_cpus << " CPUs. " << std::endl);

// limit allocated memory via command line
if (gopt_memlimit && gopt_memlimit < physical_mem)
physical_mem = gopt_memlimit;
Expand All @@ -756,8 +758,7 @@ int main(int argc, char* argv[])
// due to roundup in loop to next cache-line size, add one extra cache-line per thread
g_memsize += g_physical_cpus * 256;

ERR("Detected " << physical_mem / 1024/1024 << " MiB physical RAM and " << g_physical_cpus << " CPUs. " << std::endl
<< "Allocating " << g_memsize / 1024/1024 << " MiB for testing.");
ERR("Allocating " << g_memsize / 1024/1024 << " MiB for testing.");

// allocate memory area
//g_memarea = (char*)malloc(g_memsize);
Expand Down

0 comments on commit 94501e0

Please sign in to comment.