13.01.2013 Views

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 ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

19 f p r i n t f ( ’ waiting f o r the parent <strong>to</strong> merge MPI intercommunica<strong>to</strong>rs . . . ’ ) ;<br />

20 [ i n f o NEWORLD] = MPI Intercomm merge ( parent , 1 ) ;<br />

21 f p r i n t f ( ’OK! \ n ’ ) ;<br />

22<br />

23 MPI Errhandler set (NEWORLD, ’RETURN’ ) ;<br />

24<br />

25 nvm( 1 ,NEWORLD) ;<br />

26 f e v a l ( f c t ,NEWORLD) ;<br />

27 nvm ( 2 ) ;<br />

28<br />

29 MPI Finalize ;<br />

30 LAM Finish ;<br />

Purpose<br />

LAM_Finish<br />

LAM_Finish cleans MPITB MEX files from memory.<br />

Synopsis<br />

function LAM_Finish<br />

Description<br />

LAM_Finish cleans MPITB MEX files from memory.<br />

Most probably used in the following sequence:<br />

MPI_Init<br />

...<br />

&lt;MPITB code&gt;<br />

...<br />

MPI_Finalize;<br />

LAM_Clean; % required <strong>to</strong> avoid<br />

MPI_Init; % matlab crash due <strong>to</strong> MPI re-init<br />

See MPI_Init help page for more details<br />

Source Code<br />

1 f u n c t i o n LAM Finish<br />

15<br />

16 [M, MEX] = inmem ; % c l e a r a l l MPI ∗ MEX f i l e s<br />

17 M = MEX( strmatch ( ’MPI ’ ,MEX) ) ;<br />

18 c l e a r (M{ : } ) % allow f o r MPI Init again<br />

Purpose<br />

LAM_Start<br />

LAM_Start invokes lamboot (if required) and MPI_Init (if required).<br />

Synopsis<br />

function LAM_Start(nslaves, rpi, hosts)<br />

Description<br />

59

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!