Finalize access to the library

saf_final is a function defined in init.c.

Synopsis:

void saf_final(void)

Description: A call to saf_final terminates the client’s interaction with the SAF library. Any open databases and supplemental files are closed and all memory allocated by the library is freed. Calling this function when the library is already in a finalized state has no effect. This function should not be called before the library has been initialized.

This call is mainly just a wrapper for a call to _saf_final so that we can distinguish between a situation in which saf_final is called by exit and one in which the client made the call explicitly.

Parallel Notes: This function must be called collectively across all processes in the library’s communicator, which was set in the saf_init call. Furthermore, the client should not call MPI_Finalize prior to calling saf_final. SAF does try to detect this condition and report its occurrence before aborting. However, on some platforms, this is simply not possible and the client might silently hang with no indication as to the cause.

See Also: