Set the MPI communicator for the library

saf_setProps_LibComm is a function defined in libprops.c.

Synopsis:

int saf_setProps_LibComm(SAF_LibProps *properties, MPI_Comm communicator)

Formal Arguments:

  • properties: The library property list which will be modified by this function (See *Properties*).
  • communicator: The new MPI communicator.

Description: This function sets the MPI communicator in the specified library property list to communicator (the default is MPI_COMM_WORLD). After this property list is used to initialize the library by calling saf_init, it will become the communicator for all collective calls. However, a database can override this communicator in the saf_open_database call.

Preconditions:

  • properties must be a valid library properties handle. (low-cost)

Return Value: The constant SAF__SUCCESS is returned when this function is successful. Otherwise this function either returns an error number or throws an exception, depending on the value of the library’s error handling property.

Parallel Notes: This function can be called independently. It is not defined in a non-parallel version of the library.

Issues: Should this function even be defined if the library is not compiled for parallel. My reasoning is that it would only be called if the client is compiled for parallel and therefore it only makes sense to link the application if the SAF-API is also compiled for parallel. Getting a link error is probably better than a runtime error for two reasons: the error comes earlier (what if the application did a day of number crunching before trying I/O), and we can guarantee that it’s an error (what if the client failed to check return values).

Known Bugs: This function sometimes returns an error instead of throwing an exception when the library error mode is SAF__ERRMODE_THROW.

See Also: