Hi all,
I was able to run form a 5000 nodes matrix in around 2 hours. But when i run for a 8000 nodes matrix it just ends in a second with no error. Is it memory issue or something else.
Appreciate you help.
Amit
Code:
proc fcmp;
array A[8000,8000] / nosymbols;
array Ident[8000,8000] / nosymbols;
array Z[8000,8000] / nosymbols;
array P[8000,8000] / nosymbols;
do i = 1 to 8000;
do j = 1 to 8000;
A[i, j] = RANUNI(12345);
if A[i, j] le .4 then A[i, j] = 0;
else A[i, j] = 1;
A[i, j] = 0.5*A[i, j];
Ident[i,j] = A[i,j];
end;
end;
call IDENTITY (Ident);
CALL SUBTRACTMATRIX (Ident, A, Z);
CALL INV (Z, P);
rc = write_array('result', p);
run;
log:
NOTE: PROCEDURE FCMP used (Total process time):
real time 0.24 seconds
cpu time 0.01 seconds
The matrix being inverted seems a bit large, and memory may indeed be an issue. Have you tried increasing the memory buffers?
Although it won't help with the memory, we can speed up the processing a bit by replacing your A[I,J] IF-THEN/ELSE assignment statements.
r=ranuni(12345);
a[i,j] = 0*(r<=.4)+.5*(r>.4);
The matrix being inverted seems a bit large, and memory may indeed be an issue. Have you tried increasing the memory buffers?
Although it won't help with the memory, we can speed up the processing a bit by replacing your A[I,J] IF-THEN/ELSE assignment statements.
r=ranuni(12345);
a[i,j] = 0*(r<=.4)+.5*(r>.4);
Hi Art,
Appreciate your help. I have previously taken you class on Macro programming. It was really helpful. Thank you for being a great teacher.
It is memory issue. How can i increase the memory buffer as you mentioned? How does one find how much the memory buffer is?
Also I have updated my code to remove the if then else.
Regards,
Amit
An earlier thread on memory usage and matricies can be found at: https://communities.sas.com/message/140513#140513
The system option for memory allocation is MEMSIZE. You may also get more detailed responses in the SAS/IML forum, which specializes in issues with matrix manipulation.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.