Learn R Programming

memuse (version 1.1)

howbig: howbig

Description

Determines the memory usage for a dense, in-core, numeric matrix of specified rows/columns.

Usage

howbig(nrow, ncol, unit=.UNIT, unit.prefix=.PREFIX, unit.names=.NAMES, 
         ..., type="double", intsize=4)
  howbig.par(nrow, ncol, cores=1, par="balanced", unit=.UNIT, 
			 unit.prefix=.PREFIX, unit.names=.NAMES, ..., type="double", 
			 intsize=4, ICTXT=0, bldim=c(4, 4))

Arguments

nrow, ncol
Number of (global) rows/columns of the matrix.
cores
The number of cores/processors
par
Type of data distribution. Choices are "dmat" or "balanced". The former is for pbdDMAT objects, the latter is the simple, locally load-balanced block partitioning.
unit
string; the unit of storage, such as "MiB" or "MB", depending on prefix. Case is ignored.
unit.prefix
string; the unit prefix, namely IEC or SI. Case is ignored.
unit.names
string; control for whether the unit names should be printed out or their abbreviation should be used. Options are "long" and "short", respectively. Case is ignored.
...
Additional arguments.
type
"double" or "int"; the storage type of the data matrix. If you don't know the type, it is probably stored as a double, so the default value will suffice.
intsize
The size (in bytes) of an integer. Default is 4, but this is platform dependent.
ICTXT
BLACS context number; only used with howbig.par() with par="dmat".
bldim
Blocking factor for block-cyclically decomposed (dmat) data.

Value

  • howbig() returns a memuse class object. howbig.par() returns a list of 2 elements, each of class memuse. One is the total memory usage, the other is the local memory usage.

Details

These functions provide the memory usage of an unallocated, dense, in-core, numeric matrix. As the names suggest, howbig() simply returns the size (as a memuse object), while howbig.par() is the parallel, distributed analogue. The latter returns the memory usage of a distributed, object

See Also

howmany

Examples

Run this code
# size of a 1000x1000 matrix
howbig(1000, 1000)

Run the code above in your browser using DataLab