1
1

* 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.
Этот коммит содержится в:
Brian Barrett 2004-09-22 16:05:33 +00:00
родитель 64db75b43e
Коммит 68407587ba
2 изменённых файлов: 28 добавлений и 3 удалений

Просмотреть файл

@ -142,11 +142,22 @@ ompi_rte_get_self(void)
int int
ompi_rte_get_peers(ompi_process_name_t **peers, size_t *npeers) 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) { if (NULL == mca_pcmclient.pcmclient_get_peers) {
return OMPI_ERR_NOT_IMPLEMENTED; 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 * Get names of peer processes which have been launched
* *
* @param Nothing * @param peers (OUT) Pointer to a pointer of
* @return An array of peer names, including me * 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); int ompi_rte_get_peers(ompi_process_name_t **peers, size_t *npeers);