5.2.62hdfql_mpi_get_size
Syntax
int hdfql_mpi_get_size(void)
Description
Get the number (i.e. size) of processes associated with the default MPI communicator (MPI_COMM_WORLD) or with a user-defined MPI communicator (that may have been set through the function hdfql_mpi_use_communicator). Of note, the function is essentially a wrapper for the MPI function “MPI_Comm_size” (please refer to https://www.mpich.org/static/docs/v3.4/www3/MPI_Comm_size.html or https://www.open-mpi.org/doc/v3.1/man3/MPI_Comm_size.3.php for additional information in case the MPI library used is MPICH or Open MPI, respectively).
Parameter(s)
None
Return
int – depending on the success in getting the number (i.e. size) of processes associated with the default MPI communicator (MPI_COMM_WORLD) or with a user-defined MPI communicator, it can be equal to or greater than one (i.e. the number of processes), HDFQL_ERROR_NOT_SUPPORTED (in case MPI itself was not initialized properly or when using an HDFql non MPI-based distribution), or HDFQL_ERROR_UNKNOWN.
Example(s)
// display number (i.e. size) of MPI processes (if the program (that employs HDFql) is launched as, e.g., "mpiexec -n 5 ./my_program", the message "Number (i.e. size) of MPI processes is 5" will be displayed five times)
printf("Number (i.e. size) of MPI processes is %d\n", hdfql_mpi_get_size());