getnrmt#

Purpose#

Computes number of rows to read per iteration for a program that reads data from a disk file in a loop.

Format#

nr = getnrmt(nsets, ncols, row, rowfac, maxv)#
Parameters:
  • nsets (scalar) – estimate of the maximum number of duplicate copies of the data matrix read by readr to be kept in memory during each iteration of the loop.

  • ncols (scalar) – columns in the data file.

  • row (scalar) – if row is greater than 0, nr will be set to row.

  • rowfac (scalar) – nr will be reduced in size by this factor. If insufficient memory error is encountered, change this to a number less than one (e.g. 0.9).

  • maxv (scalar) – the largest number of elements allowed in any one matrix.

Returns:

nr (scalar) – number of rows readr() should read per iteration of the read loop.

Example#

// Compute optimal rows per read iteration
// 3 copies, 10 columns, no fixed row count,
// full size factor, max 80000 elements
nr = getnrmt(3, 10, 0, 1.0, 80000);
print "Rows per iteration:" nr;

Source#

gaussmt.src

See also

Functions getnr(), readr()