* Make it easier to get just the number of peer processes by allowing NULL
to be passed for the first argument of ompi_rte_get_peers(). Also cleaned up the documentation for that function. This commit was SVN r2801.
Этот коммит содержится в:
родитель
64db75b43e
Коммит
68407587ba
@ -142,11 +142,22 @@ ompi_rte_get_self(void)
|
||||
int
|
||||
ompi_rte_get_peers(ompi_process_name_t **peers, size_t *npeers)
|
||||
{
|
||||
ompi_process_name_t *useless;
|
||||
ompi_process_name_t **peers_p;
|
||||
|
||||
if (NULL == mca_pcmclient.pcmclient_get_peers) {
|
||||
return OMPI_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
return mca_pcmclient.pcmclient_get_peers(peers, npeers);
|
||||
if (NULL == peers) {
|
||||
/* the returned value is a pointer to a static buffer, so no
|
||||
free is neeeded. This is therefore completely safe. Yay */
|
||||
peers_p = &useless;
|
||||
} else {
|
||||
peers_p = peers;
|
||||
}
|
||||
|
||||
return mca_pcmclient.pcmclient_get_peers(peers_p, npeers);
|
||||
}
|
||||
|
||||
|
||||
|
@ -212,8 +212,22 @@ extern "C" {
|
||||
/**
|
||||
* Get names of peer processes which have been launched
|
||||
*
|
||||
* @param Nothing
|
||||
* @return An array of peer names, including me
|
||||
* @param peers (OUT) Pointer to a pointer of
|
||||
* ompi_process_name_t. \c *peers will be set
|
||||
* to point to a statically allocated buffer
|
||||
* containing the array of peer processes
|
||||
* started with the current process. If \c
|
||||
* peers is NULL, then only \c npeers is
|
||||
* updated.
|
||||
* @param npeers (OUT) pointer to an integer that will be updated
|
||||
* with the total number of peers started with
|
||||
* the current process. Also the length of \c
|
||||
* *peers array if \c peers is not \c NULL
|
||||
*
|
||||
* @return OMPI_SUCCESS on success
|
||||
* OMPI_ERR_NOT_IMPLEMENTED if the underlying module is
|
||||
* not properly loaded.
|
||||
*
|
||||
*/
|
||||
int ompi_rte_get_peers(ompi_process_name_t **peers, size_t *npeers);
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user