Probably stuff after crash gone do we have two output arguments? >> >> >> >> %% mm mode (multi-matlab) %% mo mode (multi-octave) >> >> np ans = 4 >> i=1:4*p i = ddense object: 1-by-4p >> 1:4 ans = 1 2 3 4 >> !vi foo.m Terminal entry not found in terminfo ''MATLAB Command Window'' not known. Available builtin terminals are: builtin_ansi builtin_xterm builtin_iris-ansi builtin_dumb defaulting to 'ansi' "foo.m" [New File]~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~-- INSERT --function z=foo(i)if i==1, z=10*ielse9fif elsei-- INSERT -- i==2-- INSERT -- z=100*i-- INSERT --elseif i==3-- INSERT -- z=1000*i-- INSERT --elseif i==4-- INSERT -- z=10000*i-- INSERT --end:wq "foo.m" [New] 13L, 113C written >> type foo function z=foo(i) if i==1, z=10*i elseif i==2 z=100*i elseif i==3 z=1000*i elseif i==4 z=10000*i end >> z=mm('foo',i) z = ddense object: 1-by-4p >> z(:,:) ans = 10 200 3000 40000 >> help mmpath Epilogue script >> type mmpath function mmpath(varargin) if nargin == 0 error('There has to be at least 1 input') end for i = 1:nargin if isa(varargin{i},'char') == 0 error('mmpath only takes string inputs') end end [ec,es] = ppclient('ppengpath',varargin{1:nargin}); % Epilogue script epilogue >> pwd ans = /home/edelman >> ls ans = 020603 foo17.mat matfifo2913 pquad.m test.dat 030204 foo5a.mat matlab_crash_dump.2447 prefix.m test.m Desktop g.m matlabp.log save test2.m a.out h.m maxdiff.m sdp test3.m absil.m hello mimd.m seedist.m test5.m bruce.m hello.c mmdemo.m silly.m testmpi.cc demo hw1.html mmrandeig.m silly1.mat testomp.cc demo.m invdot.m myquadl.m silly2.mat timings example.m jacobi notmaxdiff.m sma volker.m example2.m java.log.25585 octave-core small.m examples matfifo2677 ournorm.m spacktest.m f.m matfifo2678 pathcount.m sparse foo.m matfifo2912 per t.txt >> type mmpath function mmpath(varargin) if nargin == 0 error('There has to be at least 1 input') end for i = 1:nargin if isa(varargin{i},'char') == 0 error('mmpath only takes string inputs') end end [ec,es] = ppclient('ppengpath',varargin{1:nargin}); % Epilogue script epilogue >> help path PATH Get/set search path. PATH, by itself, prettyprints MATLAB's current search path. The initial search path list is set by PATHDEF, and is perhaps individualized by STARTUP. P = PATH returns a string containing the path in P. PATH(P) changes the path to P. PATH(PATH) refreshes MATLAB's view of the directories on the path, ensuring that any changes to non-toolbox directories are visible. PATH(P1,P2) changes the path to the concatenation of the two path strings P1 and P2. Thus PATH(PATH,P) appends a new directory to the current path and PATH(P,PATH) prepends a new path. If P1 or P2 are already on the path, they are not added. For example, the following statements add another directory to MATLAB's search path on various operating systems: Unix: path(path,'/home/myfriend/goodstuff') Windows: path(path,'c:\tools\goodstuff') See also WHAT, CD, DIR, ADDPATH, RMPATH, GENPATH, REHASH. >> cd /home/edelman >> >> z(:,:) ans = 10 200 3000 40000 >> type foo function z=foo(i) if i==1, z=10*i elseif i==2 z=100*i elseif i==3 z=1000*i elseif i==4 z=10000*i end >> i i = ddense object: 1-by-4p >> z=mo('foo',i) z = ddense object: 1-by-4p >> z(:,:) ans = 10 200 3000 40000 >> !vi foo.m Terminal entry not found in terminfo ''MATLAB Command Window'' not known. Available builtin terminals are: builtin_ansi builtin_xterm builtin_iris-ansi builtin_dumb defaulting to 'ansi' "foo.m" 13L, 113Cfunction z=foo(i) if i==1, z=10*i elseif i==2 z=100*i elseif i==3 z=1000*i elseif i==4 z=10000*i end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ -- INSERT --C-- INSERT ---- INSERT --C-- INSERT --~~if i==1 function z=foo(i) if i==1, z=10*i elseif i==2 z=100*i elseif i==3 z=1000*i elseif i==4 z=10000*i end ~ ~ ~ ~ ~ ~ ~ ~ ~ ~:q! >> !emacs foo.m emacs: Terminal type 'MATLAB Command Window' is not defined. If that is not the actual type of terminal you have, use the Bourne shell command `TERM=... export TERM' (C-shell: `setenv TERM ...') to specify the correct type. It may be necessary to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well. >> >> zm=mm('foo',i) zm = ddense object: 1-by-4p >> zm(:,:) ans = -0.8391 0.4872 -0.9757 0.3226 >> zo=mo('foo',i) zo = ddense object: 1-by-4p >> z=[zm(:);zo(:)] z = 1.0e+04 * -0.0001 0.0000 -0.0001 0.0000 0.0010 0.0200 0.3000 4.0000 >> ppgcone(2); z=[zm(:)zo(:)] Warning: Future versions of MATLAB will require that whitespace, a comma, or a semicolon separate elements of a matrix. Please type "help matrix_element_separators" at the MATLAB prompt for more information. z = 1.0e+04 * -0.0001 0.0010 0.0000 0.0200 -0.0001 0.3000 0.0000 4.0000 >> z z = 1.0e+04 * -0.0001 0.0010 0.0000 0.0200 -0.0001 0.3000 0.0000 4.0000 >> z(:,1)-z(:,2) ans = 1.0e+04 * -0.0011 -0.0200 -0.3001 -4.0000 >> (z(:,1)-z(:,2))./z(:,1) ans = 1.0e+05 * 0.0001 -0.0041 0.0308 -1.2400 >> z z = 1.0e+04 * -0.0001 0.0010 0.0000 0.0200 -0.0001 0.3000 0.0000 4.0000 >> zm zm = ddense object: 1-by-4p >> zm(:,:) ans = -0.8391 0.4872 -0.9757 0.3226 >> zo(:,:) ans = 10 200 3000 40000 >> zo=mo('foo',i) zo = ddense object: 1-by-4p >> zo(:,:) ans = 10 200 3000 40000 >> zo=mo('foo2',i) zo = ddense object: 1-by-4p >> zo(:,:) ans = -0.8391 0.4872 -0.9757 0.3226 >> zm=mm('foo2',i) zm = ddense object: 1-by-4p >> ans(:) ans = -0.8391 0.4872 -0.9757 0.3226 >> z=[zm(:)zo(:)] Warning: Future versions of MATLAB will require that whitespace, a comma, or a semicolon separate elements of a matrix. Please type "help matrix_element_separators" at the MATLAB prompt for more information. z = -0.8391 -0.8391 0.4872 0.4872 -0.9757 -0.9757 0.3226 0.3226 >> (z(:,2)-z(:,1))./z(:,1) ans = 1.0e-14 * -0.0529 0.0114 -0.0455 0.1032 >> i i = ddense object: 1-by-4p >> zm=mm('foo',i) zm = ddense object: 1-by-4p >> ans(:) ans = 1.0e-14 * -0.0529 0.0114 -0.0455 0.1032 >> !vi foo.m Terminal entry not found in terminfo ''MATLAB Command Window'' not known. Available builtin terminals are: builtin_ansi builtin_xterm builtin_iris-ansi builtin_dumb defaulting to 'ansi' :wq "foo.m" 15L, 142Cfunction z=foo(i) %if i==1, %z=(10*i) %elseif i==2 %z=(100*i) %elseif i==3 %z=(1000*i) %elseif i==4 %z=(10000*i) %end z=(10^i)*i ~ ~ ~ ~ ~ ~ ~ ~:wq "foo.m" 15L, 142C written >> zm=mm('foo',i) zm = ddense object: 1-by-4p >> ppgcone(3); ppgcone(4); !vi foo.m Terminal entry not found in terminfo ''MATLAB Command Window'' not known. Available builtin terminals are: builtin_ansi builtin_xterm builtin_iris-ansi builtin_dumb defaulting to 'ansi' ^[OA "foo.m" 15L, 142Cfunction z=foo(i) %if i==1, %z=(10*i) %elseif i==2 %z=(100*i) %elseif i==3 %z=(1000*i) %elseif i==4 %z=(10000*i) %end z=(10^i)*i ~ ~ ~ ~ ~ ~ ~ ~-- INSERT --A-- INSERT --:q!:q! >> ppgcone(5); ppgcone(6); zm=mm('foo',i) zm = ddense object: 1-by-4p >> ppgcone(8); zm(:) ans = 10 200 3000 40000 >> zm zm = ddense object: 1-by-4p >> ans ans = 10 200 3000 40000 >> zm=zm*2; >> ans ans = 10 200 3000 40000 >> zm(:,:) ans = 20 400 6000 80000 >> >> zm zm = ddense object: 1-by-4p >> zm(:,:) ans = 20 400 6000 80000 >> zm(:,[2 3])=zm(:,[3 2]) zm = ddense object: 1-by-4p >> zm(:,:) ans = 20 6000 400 80000 >> >> zm zm = ddense object: 1-by-4p >> ppgcone(9); ppgcone(10); z=randn(4*p,2) z = ddense object: 4p-by-2 >> ppgcone(11); ppgcone(13); type foo2 function z=foo(i) if i==1, z=cos(10*i) elseif i==2 z=cos(100*i) elseif i==3 z=cos(1000*i) elseif i==4 z=cos(10000*i) end >> !vi foo.m Terminal entry not found in terminfo ''MATLAB Command Window'' not known. Available builtin terminals are: builtin_ansi builtin_xterm builtin_iris-ansi builtin_dumb defaulting to 'ansi' "foo.m" 15L, 142Cfunction z=foo(i) %if i==1, %z=(10*i) %elseif i==2 %z=(100*i) %elseif i==3 %z=(1000*i) %elseif i==4 %z=(10000*i) %end z=(10^i)*i ~ ~ ~ ~ ~ ~ ~ ~  function z=fo  fun:q! >> >> whose Your variables are: Name Size Bytes Class ans 1x4 32 double array i 1x4p 32 ddense array z 4px2 64 ddense array zm 1x4p 32 ddense array zo 1x4p 32 ddense array Grand total is 24 elements using 192 bytes MATLAB has a total of 4 elements using 32 bytes MATLAB*P server has a total of 20 elements using 160 bytes >> z z = ddense object: 4p-by-2 >> y=mm('foo',data,i) ??? Undefined function or variable 'data'. >> y=mm('foo',z,i) y = ddense object: 4p-by-2 >> y(:,:) ans = 1.0e+03 * 0.0039 0.0032 0.0270 0.0273 -1.7746 0.0047 4.1299 6.5475 >> z(:,:) ans = 0.3855 0.3221 0.2703 0.2730 -1.7746 0.0047 0.4130 0.6547 >> whose Your variables are: Name Size Bytes Class ans 4x2 64 double array i 1x4p 32 ddense array y 4px2 64 ddense array z 4px2 64 ddense array zm 1x4p 32 ddense array zo 1x4p 32 ddense array Grand total is 36 elements using 288 bytes MATLAB has a total of 8 elements using 64 bytes MATLAB*P server has a total of 28 elements using 224 bytes >> z z = ddense object: 4p-by-2 >> z(:,:) ans = 0.3855 0.3221 0.2703 0.2730 -1.7746 0.0047 0.4130 0.6547 >> y(:,:) ans = 1.0e+03 * 0.0039 0.0032 0.0270 0.0273 -1.7746 0.0047 4.1299 6.5475 >> format bank >> y(:,:) ans = 3.86 3.22 27.03 27.30 -1774.64 4.68 4129.91 6547.46 >> z(:,:) ans = 0.39 0.32 0.27 0.27 -1.77 0.00 0.41 0.65 >> >> ppspy(z) ans = Your Matrix is smaller than 1024x1024 elements. We will for efficency reasons use the regular spy >> z z = ddense object: 4p-by-2 >> y=mm('foo',z,i,3) y = ddense object: 4p-by-2 >> y(:,:) ans = 0 0 0 0 -1.77 0.00 0 0 >> a=randn(17,17*p) a = ddense object: 17-by-17p >> ppgcone(15); y=mm('foo',a,i,3) ??? [Rank 0]: Error creating fifo Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); >> i i = ddense object: 1-by-4p >> a=randn(17,16*p) a = ddense object: 17-by-16p >> y=mm('foo',a,i,3) y = ddense object: 17-by-16p >> y(:,:) ans = Columns 1 through 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 6 through 10 0 0 0 0.63 -0.38 0 0 0 2.29 0.36 0 0 0 0.79 0.78 0 0 0 -0.19 -0.40 0 0 0 -1.67 -1.51 0 0 0 1.28 -0.90 0 0 0 -0.63 -0.10 0 0 0 -0.78 -0.09 0 0 0 -1.36 -0.49 0 0 0 1.42 1.26 0 0 0 0.38 -0.49 0 0 0 0.76 0.08 0 0 0 -0.11 -0.57 0 0 0 0.25 0.28 0 0 0 0.49 0.10 0 0 0 0.56 0.29 0 0 0 1.86 -1.06 Columns 11 through 15 1.04 -0.35 0 0 0 0.82 -0.84 0 0 0 -1.41 -1.88 0 0 0 -0.31 -0.23 0 0 0 0.71 -1.79 0 0 0 -0.63 -0.92 0 0 0 -0.88 -0.08 0 0 0 1.22 -1.52 0 0 0 -1.03 -0.69 0 0 0 -1.22 -0.26 0 0 0 -0.08 0.58 0 0 0 1.21 -1.85 0 0 0 0.80 0.18 0 0 0 -0.23 -0.70 0 0 0 0.70 0.27 0 0 0 2.36 -1.02 0 0 0 0.48 0.26 0 0 0 Column 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 >> yy=y(:,:); >> yy(1:5,:) ans = Columns 1 through 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Columns 6 through 10 0 0 0 0.63 -0.38 0 0 0 2.29 0.36 0 0 0 0.79 0.78 0 0 0 -0.19 -0.40 0 0 0 -1.67 -1.51 Columns 11 through 15 1.04 -0.35 0 0 0 0.82 -0.84 0 0 0 -1.41 -1.88 0 0 0 -0.31 -0.23 0 0 0 0.71 -1.79 0 0 0 Column 16 0 0 0 0 0 >> >> a=randn(2,20*p) a = ddense object: 2-by-20p >> y=mm('foo',a,i,3) y = ddense object: 2-by-20p >> y(:,:) ans = Columns 1 through 5 0 0 0 0 0 0 0 0 0 0 Columns 6 through 10 0 0 0 0 0 0 0 0 0 0 Columns 11 through 15 1.18 1.50 0.83 -0.44 -0.76 0.45 -0.34 1.20 -1.41 0.74 Columns 16 through 20 0 0 0 0 0 0 0 0 0 0 >> a=randn(2,21*p) a = ddense object: 2-by-21p >> y=mm('foo',a,i,3) ??? [Rank 0]: Error creating fifoŠÝ@( Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); >> a=randn(2,22*p); y=mm('foo',a,i,3) ??? [Rank 0]: Error creating fifoŠÝ@( Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); ppgcone(17); ppgcone(19); >> ppgcone(20); ppgcone(21); a=randn(2,23*p); y=mm('foo',a,i,3) ??? [Rank 0]: Error creating fifoŠÝ@( Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); >> a=randn(2,24*p); y=mm('foo',a,i,3) y = ddense object: 2-by-24p >> a=randn(2,64*p); y=mm('foo',a,i,3) y = ddense object: 2-by-64p >> a=randn(2,65*p); y=mm('foo',a,i,3) ??? [Rank 0]: Error creating fifoŠÝ@( Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); >> a=randn(2,1025*p); y=mm('foo',a,i,3) ??? [Rank 0]: Error creating fifoŠÝ@( Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); >> a=randn(2,1028*p); y=mm('foo',a,i,3) y = ddense object: 2-by-1028p >> help mm varargout = mm(f, arg1, arg2, ...) INPUT: f (string) - function/script name arg (*) - arguments to f OUTPUT: varargout (PPMatrixID) - distributed matrix containing the results 'Multi-MATLAB' mode mm performs embarrassingly parallel operations on its input(s) (if any). mm opens up one MATLAB for each running process, and calls the function f with the arguments given in arg1, ... If any of the input arguments is a distributed matrix, the 'local piece' of the matrix will be passed into MATLAB and used as the argument. For example, if the matrix B B = [1 2; 3 4] is distributed column-wise among 2 processors, then each processor will have one column of the matrix: [1;2] for proc 0 and [3;4] for proc 1. If B is used as an input to mm, then B will be replaced by [1;2] on proc 0 and by [3;4] on proc 1. NOTE: Block cyclic distributed matrix is not supported as input to mm The return values from the function f form a new distributed dense matrix. The distribution of result follows the first distributed matrix in the input arguments. If there is no distributed matrix in the input arguments, result is a row-distributed matrix. NOTE: The size of the return values from the MATLAB on each node must be the same NOTE: The return values must be either all real or all complex Example: Calling clock on each node A = mm('clock') A = ddense object: 2-by-6 A(:,:) ans = 1.0e+03 * 2.0030 0.0090 0.0250 0.0070 0.0110 0.0031 2.0030 0.0090 0.0250 0.0070 0.0110 0.0031 A is row-distributed. Calling FFT on a distributed matrix A = randn(1000,1000*p); B = mm('fft',A); See examples: myquadl.m testfft.m testfft2.m >> y=mm('foo',a,i,3) y = ddense object: 2-by-1028p >> >> >> >> >> a=rand(3,3) a = 0.95 0.49 0.46 0.23 0.89 0.02 0.61 0.76 0.82 >> a(5,7)=1 a = Columns 1 through 5 0.95 0.49 0.46 0 0 0.23 0.89 0.02 0 0 0.61 0.76 0.82 0 0 0 0 0 0 0 0 0 0 0 0 Columns 6 through 7 0 0 0 0 0 0 0 0 0 1.00 >> a=rand(3,3) a = 0.44 0.92 0.41 0.62 0.74 0.94 0.79 0.18 0.92 >> a(5,7) ??? Index exceeds matrix dimensions. >> a=rand(3,3*p) a = ddense object: 3-by-3p >> ppgcone(22); ppgcone(23); z=mm('foo',a,i) ??? [Rank 0]: Error creating fifo Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); ppgcone(27); ppgcone(29); >> ppgcone(30); ppgcone(31); a=rand(4,4*p) a = ddense object: 4-by-4p >> ppgcone(32); ppgcone(33); z=mm('foo',a,i) ??? [Rank 0]: Error creating fifo Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); ppgcone(37); ppgcone(38); >> a=rand(4,17*p) a = ddense object: 4-by-17p >> a=matlab2pp(reshape(1:68,4,17)) a = ddense object: 4p-by-17p >> a(:,:) ans = Columns 1 through 5 1.00 5.00 9.00 13.00 17.00 2.00 6.00 10.00 14.00 18.00 3.00 7.00 11.00 15.00 19.00 4.00 8.00 12.00 16.00 20.00 Columns 6 through 10 21.00 25.00 29.00 33.00 37.00 22.00 26.00 30.00 34.00 38.00 23.00 27.00 31.00 35.00 39.00 24.00 28.00 32.00 36.00 40.00 Columns 11 through 15 41.00 45.00 49.00 53.00 57.00 42.00 46.00 50.00 54.00 58.00 43.00 47.00 51.00 55.00 59.00 44.00 48.00 52.00 56.00 60.00 Columns 16 through 17 61.00 65.00 62.00 66.00 63.00 67.00 64.00 68.00 >> z=mm('foo',a,i) ??? [Rank 0]: Cyclic distribution is not supported as an input Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); >> help matlab2pp B = matlab2pp(A) INPUT: A (dense/sparse matrix) - MATLAB matrix to be transferred d (optional) - distribution OUTPUT: B (PPMatrixID) - distributed matrix Transfer the MATLAB matrix A to the backend server and store the resulting MatrixID in B. A can be dense or sparse. If d is not specified - The distribution of the server matrix B depends on the size of A. If A is a row vector of length > 1, then B is column distributed. If A is a col vector of length > 1, then B is row distributed. In all other cases, B has block cyclic distribution. If A is sparse, B is the default sparse distribution (ROW) If d is specified - d == 1 -> row distribution d == 2 -> column distribution d == 3 -> cyclic distribution >> a=matlab2pp(reshape(1:68,4,17),3) a = ddense object: 4p-by-17p >> a=matlab2pp(reshape(1:68,4,17),2) a = ddense object: 4-by-17p >> a(:,:) ans = Columns 1 through 5 1.00 5.00 9.00 13.00 17.00 2.00 6.00 10.00 14.00 18.00 3.00 7.00 11.00 15.00 19.00 4.00 8.00 12.00 16.00 20.00 Columns 6 through 10 21.00 25.00 29.00 33.00 37.00 22.00 26.00 30.00 34.00 38.00 23.00 27.00 31.00 35.00 39.00 24.00 28.00 32.00 36.00 40.00 Columns 11 through 15 41.00 45.00 49.00 53.00 57.00 42.00 46.00 50.00 54.00 58.00 43.00 47.00 51.00 55.00 59.00 44.00 48.00 52.00 56.00 60.00 Columns 16 through 17 61.00 65.00 62.00 66.00 63.00 67.00 64.00 68.00 >> z=mm('foo',a,i) ??? [Rank 0]: Error creating fifo Error in ==> /share/matlabp/matlab/ppclient.mexglx Error in ==> /share/matlabp/matlab/mm.m On line 133 ==> [ecode,estr,realout{1:2*numresult}]=ppclient('ppengine',fname,numresult,realin{1:y}); >> z=mm('foo',a,i) z = ddense object: 1-by-4p >> ppgcone(40); ppgcone(42); z(:) ans = 1.00 21.00 41.00 61.00 >> ppgcone(44); ppgcone(45); a(:) ans = 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00 15.00 16.00 17.00 18.00 19.00 20.00 21.00 22.00 23.00 24.00 25.00 26.00 27.00 28.00 29.00 30.00 31.00 32.00 33.00 34.00 35.00 36.00 37.00 38.00 39.00 40.00 41.00 42.00 43.00 44.00 45.00 46.00 47.00 48.00 49.00 50.00 51.00 52.00 53.00 54.00 55.00 56.00 57.00 58.00 59.00 60.00 61.00 62.00 63.00 64.00 65.00 66.00 67.00 68.00 >> ppgcone(46); a(:,:) ans = Columns 1 through 5 1.00 5.00 9.00 13.00 17.00 2.00 6.00 10.00 14.00 18.00 3.00 7.00 11.00 15.00 19.00 4.00 8.00 12.00 16.00 20.00 Columns 6 through 10 21.00 25.00 29.00 33.00 37.00 22.00 26.00 30.00 34.00 38.00 23.00 27.00 31.00 35.00 39.00 24.00 28.00 32.00 36.00 40.00 Columns 11 through 15 41.00 45.00 49.00 53.00 57.00 42.00 46.00 50.00 54.00 58.00 43.00 47.00 51.00 55.00 59.00 44.00 48.00 52.00 56.00 60.00 Columns 16 through 17 61.00 65.00 62.00 66.00 63.00 67.00 64.00 68.00 >> a(:,:) ans = Columns 1 through 5 1.00 5.00 9.00 13.00 17.00 2.00 6.00 10.00 14.00 18.00 3.00 7.00 11.00 15.00 19.00 4.00 8.00 12.00 16.00 20.00 Columns 6 through 10 21.00 25.00 29.00 33.00 37.00 22.00 26.00 30.00 34.00 38.00 23.00 27.00 31.00 35.00 39.00 24.00 28.00 32.00 36.00 40.00 Columns 11 through 15 41.00 45.00 49.00 53.00 57.00 42.00 46.00 50.00 54.00 58.00 43.00 47.00 51.00 55.00 59.00 44.00 48.00 52.00 56.00 60.00 Columns 16 through 17 61.00 65.00 62.00 66.00 63.00 67.00 64.00 68.00 >> z(:) ans = 1.00 21.00 41.00 61.00 >> 1 ans = 1.00 >> >> help persistent PERSISTENT Define persistent variable. PERSISTENT X Y Z defines X, Y, and Z as variables that are local to the function in which they are declared yet their values are retained in memory between calls to the function. Persistent variables are similar to global variables because MATLAB creates permanent storage for both. They differ from global variables in that persistent variables are known only to the function in which they are declared. This prevents persistent variables from being changed by other functions or from the MATLAB command line. Persistent variables are cleared when the M-file is cleared from memory or when the M-file is changed. To keep an M-file in memory until MATLAB quits, use MLOCK. If the persistent variable does not exist the first time you issue the PERSISTENT statement, it will be initialized to the empty matrix. It is an error to declare a variable persistent if a variable with the same name exists in the current workspace. See also GLOBAL, CLEAR, MLOCK, MUNLOCK, MISLOCKED. >> >> a=1:5 a = 1.00 2.00 3.00 4.00 5.00 >> a(1:end) ans = 1.00 2.00 3.00 4.00 5.00 >> end Warning: Unmatched "end". >> a(1:backend) ??? Undefined function or variable 'backend'. >> help pp2matlab B = pp2matlab(A) INPUT: A (PPMatrixID) - distributed matrix OUTPUT: B (dense/sparse MATLAB matrix) - local copy of A pp2matlab transfer the distributed matrix A from the server to the MATLAB client. If A is a distributed dense matrix, then B is a dense MATLAB matrix. If B is a distributed sparse matrix, then B is a sparse matrix. See matlab2pp >> help colon : Colon. J:K is the same as [J, J+1, ..., K]. J:K is empty if J > K. J:D:K is the same as [J, J+D, ..., J+m*D] where m = fix((K-J)/D). J:D:K is empty if D > 0 and J > K or if D < 0 and J < K. COLON(J,K) is the same as J:K and COLON(J,D,K) is the same as J:D:K. The colon notation can be used to pick out selected rows, columns and elements of vectors, matrices, and arrays. A(:) is all the elements of A, regarded as a single column. On the left side of an assignment statement, A(:) fills A, preserving its shape from before. A(:,J) is the J-th column of A. A(J:K) is [A(J),A(J+1),...,A(K)]. A(:,J:K) is [A(:,J),A(:,J+1),...,A(:,K)] and so on. The colon notation can be used with a cell array to produce a comma- separated list. C{:} is the same as C{1},C{2},...,C{end}. The comma separated list syntax is valid inside () for function calls, [] for concatenation and function return arguments, and inside {} to produce a cell array. Expressions such as S(:).name produce the comma separated list S(1).name,S(2).name,...,S(end).name for the structure S. For the use of the colon in the FOR statement, See FOR. For the use of the colon in a comma separated list, See VARARGIN. Overloaded methods help dlayout/colon.m help sym/colon.m help dlayout/colon.m >> help dlayout/colon Extract out the arguments we want to have j:d:k always >> type dlayout/colon function y=colon(varargin) % Extract out the arguments % we want to have j:d:k always if length(varargin) == 2 j=double(varargin{1}); d=1; k=double(varargin{2}); elseif length(varargin) == 3 j=double(varargin{1}); d=double(varargin{2}); k=double(varargin{3}); end % get rid if the bad cases if j > k & d > 0 y=1:0; return end if j < k & d < 0 y=1:0; return end % First compute the length of the resulting row vector len=fix((k-j)/d)+1; % Create it y=zeros(1,len*p); % Now fill it in with the correct values %for i=1:length % y(1,i)=j+(i-1)*d; %end [ecode,estring]=ppclient('ppbase_setrange',y,j,d,k); % Epilogue script epilogue >> >> >> >> >> >> >> >> a=randn(4,16*p); >> e=mm('eig',a); >> e(:,:) ans = -0.62 -2.22 -1.36 -2.25 -0.62 1.88 1.21 0.17 1.29 1.88 1.21 0.17 1.29 0.13 0.78 -0.47 >> e=mm('eig',a); >> !vi foo.m Terminal entry not found in terminfo ''MATLAB Command Window'' not known. Available builtin terminals are: builtin_ansi builtin_xterm builtin_iris-ansi builtin_dumb defaulting to 'ansi' "foo.m" 5L, 40Cfunction z=foo(data,i) z=data(1,1); ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ :q! >> e=mm('eig',a); >> e(:,:) ans = -0.62 -2.22 -1.36 -2.25 -0.62 1.88 1.21 0.17 1.29 1.88 1.21 0.17 1.29 0.13 0.78 -0.47 >> e=mm('foo',a); >> e(:,:) ans = Columns 1 through 5 -0.62 0.60 -2.22 0 -1.36 -0.62 -