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.
215 f p r i n t f ( f i d , ’%s \n ’ ,h ’ ) ; % w r i t e s l a v e s ’ hostnames<br />
216 end<br />
217 f c l o s e ( f i d ) ;<br />
218 disp ( ’ LAM Init : booting LAM’ )<br />
219<br />
220 s t a t = system ( ’ lamboot −s −v bhost ’ ) ;<br />
221<br />
222 i f s t a t % again , t h i s shouldn ’ t happen<br />
223 f p r i n t f ( ’ pushing stubborn MATLAB ” system ” c a l l ( lamboot ) : ’ ) ;<br />
224 while s t a t<br />
225 f p r i n t f ( ’ . ’ ) ; s t a t = system ( ’ lamboot −s −v bhost ’ ) ;<br />
226 end<br />
227 f p r i n t f ( ’ \n ’ ) ;<br />
228 end<br />
229<br />
230 system ( ’rm −f bhost ’ ) ; % don ’ t need bhost anymore<br />
231 end % won ’ t wipe on e x i t / could lamhalt<br />
232<br />
233 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />
234 % RPI CHECK<br />
235 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />
236<br />
237 [ i n f I f l g I ] = M P I I n i t i a l i z e d ; % I n i t ?<br />
238 [ infF f l g F ] = MPI Finalized ; % F i n a l i z e ?<br />
239<br />
240 i f i n f I | | infF<br />
241 e r r o r ( ’ LAM Start : e r r o r c a l l i n g I n i t i a l i z e d / F i n a l i z e d ? ’ )<br />
242 end<br />
243<br />
244 i f f l g I && ˜ f l g F % Perfect , ready <strong>to</strong> s t a r t<br />
245 e l s e % something we could f i x ?<br />
246 i f f l g I | | f l g F % MPI used , w i l l break<br />
247 c l e a r MPI ∗ % u n l e s s we c l e a r MPITB<br />
248 disp ( ’ LAM Start : MPI a l r e a d y used− c l e a r i n g ’ ) % must s t a r t over<br />
249 end<br />
250<br />
251 MPI Init ;<br />
252 end<br />
253<br />
254 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />
255 % NSLAVES CHECK<br />
256 %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−<br />
257<br />
258 [ i n f o a t t r f l a g ] = MPI Attr get (MPI COMM WORLD, MPI UNIVERSE SIZE ) ;<br />
259 i f i n f o | ˜ f l a g<br />
260 e r r o r ( ’ LAM Init : a t t r i b u t e MPI UNIVERSE SIZE does not e x i s t ? ’ )<br />
261 end<br />
262 i f attr