help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Why running out of memory here?


From: Jeff
Subject: Why running out of memory here?
Date: Sat, 3 May 2014 12:36:22 -0400

Could someone explain why the following code works fine, but if I uncomment any one of the fflush(stdout()) lines, then it tells me "error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt". The files being read are 100,000 by 64 floating points numbers each.

%% Compare cvode solutions after rearranging RHS function.
clear;
p=5;
N=2^p;

srcNew   = '/raid/fpuData/';      % OCTAVE
srcOld   = '/raid/fpuData/bak/';  % OCTAVE
tgt   = '/raid/fpuData/';  % OCTAVE
ftype = '_forward.U.csv';                 % OCTAVE
tmplt='N=%04d_Beta=%05.2f_tol=1e-08_t=00000';       % OCTAVE  % 1-dimension


betas = 4; 12:-1:4;
for beta = betas

  fn=sprintf(tmplt, N, beta);       % 1-dimension

  tic;
  fprintf('Loading %s...\n', [srcNew fn ftype]);
  %fflush(stdout());
  uNew = csvread([srcNew fn ftype]); toc;

  fprintf('Loading %s...\n', [srcOld fn ftype]); 
  %fflush(stdout());
  uOld = csvread([srcOld fn ftype]); toc;

  deltaU = abs(uNew - uOld)/uOld;

  fn = sprintf('N=%04d_Beta=%02.0f_delta.csv', N, beta)
  fprintf('Saving %s...\n', [tgt fn]); 
  %fflush(stdout());
  csvwrite([tgt fn], deltaU); toc;
end


reply via email to

[Prev in Thread] Current Thread [Next in Thread]