12.3.3. Runtime Query Functions

PreviousUpNext
Up: The Sessions Model Next: Sessions Model Examples Previous: Processes Sets

MPI_SESSION_GET_NUM_PSETS(session, info, npset_names)
IN sessionsession (handle)
IN infoinfo object (handle)
OUT npset_namesnumber of available process sets (non-negative integer)
C binding
int MPI_Session_get_num_psets(MPI_Session session, MPI_Info info, int *npset_names)
Fortran 2008 binding
MPI_Session_get_num_psets(session, info, npset_names, ierror)

TYPE(MPI_Session), INTENT(IN) :: session
TYPE(MPI_Info), INTENT(IN) :: info
INTEGER, INTENT(OUT) :: npset_names
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_SESSION_GET_NUM_PSETS(SESSION, INFO, NPSET_NAMES, IERROR)

INTEGER SESSION, INFO, NPSET_NAMES, IERROR

This function is used to query the runtime for the number of available process sets in which the calling MPI process is a member. An MPI implementation is allowed to increase the number of available process sets during the execution of an MPI application when new process sets become available. However, MPI implementations are not allowed to change the index of a particular process set name, or to change the name of the process set at a particular index, or to delete a process set name once it has been added. When a process set becomes invalid, for example, when some processes become unreachable due to failures in the communication system, subsequent usage of the process set name should raise an error. For example, creating an MPI_Group from such a process set might succeed because it is a local operation, but creating an MPI_Comm from that group and attempting collective communication should raise an error.


Advice to implementors.

It is anticipated that an MPI implementation may be relying on an external runtime system to provide process sets. Such runtime systems may have the ability to dynamically create process sets during the course of application execution. Requiring the number of process sets returned by MPI_SESSION_GET_NUM_PSETS to be constant over the course of application execution would prevent an application from taking advantage of such capabilities. ( End of advice to implementors.)

MPI_SESSION_GET_NTH_PSET(session, info, n, pset_len, pset_name)
IN sessionsession (handle)
IN infoinfo object (handle)
IN nindex of the desired process set name (integer)
INOUT pset_lenlength of the pset_name argument (integer)
OUT pset_namename of the nth process set (string)
C binding
int MPI_Session_get_nth_pset(MPI_Session session, MPI_Info info, int n, int *pset_len, char *pset_name)
Fortran 2008 binding
MPI_Session_get_nth_pset(session, info, n, pset_len, pset_name, ierror)

TYPE(MPI_Session), INTENT(IN) :: session
TYPE(MPI_Info), INTENT(IN) :: info
INTEGER, INTENT(IN) :: n
INTEGER, INTENT(INOUT) :: pset_len
CHARACTER(LEN=*), INTENT(OUT) :: pset_name
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_SESSION_GET_NTH_PSET(SESSION, INFO, N, PSET_LEN, PSET_NAME, IERROR)

INTEGER SESSION, INFO, N, PSET_LEN, IERROR
CHARACTER*(*) PSET_NAME

This function returns the name of the nth process set in the supplied pset_name buffer. pset_len is the size of the buffer needed to store the nth process set name. If the pset_len passed into the function is less than the actual buffer size needed for the process set name, then the string value returned in pset_name is truncated. If pset_len is set to 0, pset_name is not changed. On return, the value of pset_len will be set to the required buffer size to hold the process set name. In C, pset_len includes the required space for the null terminator. In C, this function returns a null terminated string in all cases where the pset_len input value is greater than 0.

If two MPI processes get the same process set name, then the intersection of the two process sets shall either be the empty set or identical to the union of the two process sets.

After a successful call to MPI_SESSION_GET_NTH_PSET, subsequent calls to routines that query information about the same process set name and same session handle must return the same information. An MPI implementation is not allowed to alter any of the returned process set names.

Process set names have an implementation-defined maximum length of MPI_MAX_PSET_NAME_LEN characters. MPI_MAX_PSET_NAME_LEN shall have a value of at least 63.


Advice to users.

MPI_MAX_PSET_NAME_LEN might be very large, so it might not be wise to declare a string of that size. Users are encouraged to use MPI_SESSION_GET_NTH_PSET both for obtaining the length of a pset_name and the process set name. ( End of advice to users.)

MPI_SESSION_GET_INFO(session, info_used)
IN sessionsession (handle)
OUT info_usedsee explanation below (handle)
C binding
int MPI_Session_get_info(MPI_Session session, MPI_Info *info_used)
Fortran 2008 binding
MPI_Session_get_info(session, info_used, ierror)

TYPE(MPI_Session), INTENT(IN) :: session
TYPE(MPI_Info), INTENT(OUT) :: info_used
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_SESSION_GET_INFO(SESSION, INFO_USED, IERROR)

INTEGER SESSION, INFO_USED, IERROR

MPI_SESSION_GET_INFO returns a new info object containing the hints of the MPI Session associated with session. The current setting of all hints related to this MPI Session is returned in info_used. An MPI implementation is required to return all hints that are supported by the implementation and have default values specified; any user-supplied hints that were not ignored by the implementation; and any additional hints that were set by the implementation. If no such hints exist, a handle to a newly created info object is returned that contains no key/value pair. The user is responsible for freeing info_used via MPI_INFO_FREE.

MPI_SESSION_GET_PSET_INFO(session, pset_name, info)
IN sessionsession (handle)
IN pset_namename of process set (string)
OUT infoinfo object containing information about the given process set (handle)
C binding
int MPI_Session_get_pset_info(MPI_Session session, const char *pset_name, MPI_Info *info)
Fortran 2008 binding
MPI_Session_get_pset_info(session, pset_name, info, ierror)

TYPE(MPI_Session), INTENT(IN) :: session
CHARACTER(LEN=*), INTENT(IN) :: pset_name
TYPE(MPI_Info), INTENT(OUT) :: info
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
Fortran binding
MPI_SESSION_GET_PSET_INFO(SESSION, PSET_NAME, INFO, IERROR)

INTEGER SESSION, INFO, IERROR
CHARACTER*(*) PSET_NAME

This function is used to query properties of a specific process set. The returned info object can be queried with existing MPI info object query functions. One key/value pair must be defined, mpi_size. The value of the mpi_size key specifies the number of MPI processes in the process set. The user is responsible for freeing the returned MPI_Info object.


PreviousUpNext
Up: The Sessions Model Next: Sessions Model Examples Previous: Processes Sets


Return to MPI-4.1 Standard Index
Return to MPI Forum Home Page

(Unofficial) MPI-4.1 of November 2, 2023
HTML Generated on November 19, 2023