sundialsTB, a Matlab Interface to SUNDIALS - Site Index Page ...
sundialsTB, a Matlab Interface to SUNDIALS - Site Index Page ...
sundialsTB, a Matlab Interface to SUNDIALS - Site Index Page ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
53 e r r o r ( ’ LAM Init : : cannot f i n d l i s t o f h o s t s ’ ) ;<br />
54 end<br />
55 end<br />
56 end<br />
57<br />
58 %% RPI<br />
59<br />
60 i f nargin >1<br />
61 % RPI passed as an argument<br />
62 i f ˜ i s c h a r ( r p i )<br />
63 e r r o r ( ’ LAM Init : 2nd arg i s not a s t r i n g ’ )<br />
64 e l s e<br />
65 % f u l l r p i name , i f s i n g l e l e t t e r used<br />
66 r p i=r p i s t r ( r p i ) ;<br />
67 i f isempty ( r p i )<br />
68 e r r o r ( ’ LAM Init : 2nd arg i s not a known RPI ’ )<br />
69 end<br />
70 end<br />
71 e l s e<br />
72 % We must get RPI from somewhere e l s e . . .<br />
73 i f ˜ isempty (RPI)<br />
74 r p i = r p i s t r (RPI ) ; % Variable RPI d e f i n e d above<br />
75 e l s e<br />
76 RPI = getenv ( ’ LAM MPI SSI rpi ’ ) ;<br />
77 i f ˜ isempty (RPI)<br />
78 r p i = r p i s t r (RPI ) ; % RPI d e f i n e d in environment<br />
79 e l s e<br />
80 e r r o r ( ’ LAM Init : : cannot f i n d RPI ’ ) ;<br />
81 end<br />
82 end<br />
83 end<br />
84<br />
85 % Number o f s l a v e s<br />
86<br />
87 i f nargin >0<br />
88 i f ˜ i s r e a l ( n s l a v e s ) | | f i x ( n s l a v e s )˜= n s l a v e s | | nslaves>=l e n g t h ( h o s t s )<br />
89 e r r o r ( ’ LAM Init : 1 s t arg i s not a v a l i d #s l a v e s ’ )<br />
90 end<br />
91 e l s e<br />
92 n s l a v e s = l e n g t h ( h o s t s ) −1;<br />
93 end<br />
94<br />
95 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />
96 % LAMHALT %<br />
97 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />
98 % r e a s o n s <strong>to</strong> lamhalt :<br />
99 % − not enough nodes ( n s l v +1) % NHL < NSLAVES+1<br />
100 % − l o c a l h o s t not in l i s t % weird − j u s t lamboot (NHL=0)<br />
101 % − l o c a l h o s t not l a s t in l i s t % weird − j u s t lamboot (NHL=0)<br />
102 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />
103<br />
104 % Lam Nodes Output<br />
105 [ stat , LNO] = system ( ’ lamnodes ’ ) ;<br />
106 i f ˜ s t a t % a l r e a d y lambooted<br />
61