Bureaucrats, cc_docs_admin, cc_staff, rsnt_translations
2,837
edits
No edit summary |
No edit summary |
||
Line 98: | Line 98: | ||
Similarly, we must call a function <code>MPI_Finalize</code> to do any clean-up that might be required before our program exits. The prototype for this function appears below: | Similarly, we must call a function <code>MPI_Finalize</code> to do any clean-up that might be required before our program exits. The prototype for this function appears below: | ||
<tabs> | |||
<tab name="C"> | |||
<source lang="c"> | |||
int MPI_Finalize(void); | int MPI_Finalize(void); | ||
</source> | </source> | ||
</tab> | |||
<tab name="Fortran"> | |||
<source lang="fortran"> | |||
MPI_FINALIZE(IERR) | MPI_FINALIZE(IERR) | ||
INTEGER :: IERR | INTEGER :: IERR | ||
</source> | |||
</tab> | |||
</tabs> | |||
As a rule of thumb, it is a good idea to call <code>MPI_Init</code> as the first statement of our program, and <code>MPI_Finalize</code> as its last statement. | As a rule of thumb, it is a good idea to call <code>MPI_Init</code> as the first statement of our program, and <code>MPI_Finalize</code> as its last statement. |