@@ -64,16 +64,20 @@ extern "C" {
6464typedef struct pmix_fabric_s {
6565 /* user-supplied name for this fabric */
6666 char * name ;
67- /* revision - tracks how many times the
68- * fabric info has been updated. Used to detect
69- * that a change has occurred since the last
70- * time the data was accessed. Restricted to
71- * PMIx-internal use */
72- uint64_t revision ;
73- /* PMIx server-defined object for internal use */
67+ /* communication cost array - the number of vertices
68+ * (nverts) equals the number of interfaces in the
69+ * fabric. This equates to the number of columns & rows
70+ * in the commcost array as the matrix is symmetric */
71+ uint16_t * * commcost ;
72+ uint32_t nverts ;
73+ /* object pointer for use by the PMIx server library */
7474 void * module ;
7575} pmix_fabric_t ;
7676
77+ /* convenience macros to support pmix_fabric_t */
78+ #define PMIX_FABRIC_CONSTRUCT (x ) \
79+ memset(x, 0, sizeof(pmix_fabric_t))
80+
7781/* Register for access to fabric-related information, including
7882 * communication cost matrix. This call must be made prior to
7983 * requesting information from a fabric.
@@ -83,9 +87,9 @@ typedef struct pmix_fabric_s {
8387 * utilize this field
8488 *
8589 * directives - an optional array of values indicating desired
86- * behaviors and/or fabric to be accessed via
87- * the returned struct. If NULL, then the highest
88- * priority available fabric will return the struct
90+ * behaviors and/or fabric to be accessed. If NULL,
91+ * then the highest priority available fabric will
92+ * be used
8993 *
9094 * ndirs - number of elements in the directives array
9195 *
@@ -106,62 +110,9 @@ PMIX_EXPORT pmix_status_t PMIx_server_register_fabric(pmix_fabric_t *fabric,
106110 */
107111PMIX_EXPORT pmix_status_t PMIx_server_deregister_fabric (pmix_fabric_t * fabric );
108112
109- /* Get the number of vertices in the provided fabric.
110- * To avoid blocking the caller, this function will
111- * always return immediately, returning a PMIX_ERR_RESOURCE_BUSY
112- * status if the matrix is in the process of being updated.
113- *
114- * fabric - pointer to the pmix_fabric_t struct provided
115- * to the registration function
116- *
117- * nverts - pointer to the location where the number of
118- * vertices is to be returned
119- *
120- * Return values include:
121- *
122- * PMIX_SUCCESS - indicates return of a valid value
123- * PMIX_ERR_RESOURCE_BUSY - matrix is being updated
124- * PMIX_ERR_FABRIC_UPDATED - fabric info has been updated since
125- * last call involving this pmix_fabric_t
126- */
127- PMIX_EXPORT pmix_status_t PMIx_server_get_num_vertices (pmix_fabric_t * fabric ,
128- uint32_t * nverts );
129-
130- /* Obtain communication cost for messages transmitted from indicated
131- * source to destination across the provided fabric - i.e.,
132- * the value of the (src,dest) entry of that fabric's communication
133- * cost matrix. To avoid blocking the caller, this function will
134- * always return immediately, returning a PMIX_ERR_RESOURCE_BUSY
135- * status if the matrix is in the process of being updated.
136- *
137- * fabric - pointer to the pmix_fabric_t struct provided to
138- * the registration function
139- *
140- * src - the index of the originating vertex for the communication
141- *
142- * dest - the index of the destination vertex for the communication
143- *
144- * cost - pointer to the location where the cost is to be returned
145- *
146- * Return values include:
147- *
148- * PMIX_SUCCESS - indicates return of a valid value
149- * PMIX_ERR_BAD_PARAM - src and/or dest is out of bounds
150- * PMIX_ERR_RESOURCE_BUSY - matrix is being updated
151- * PMIX_ERR_FABRIC_UPDATED - fabric info has been updated since
152- * last call involving this pmix_fabric_t
153- */
154- PMIX_EXPORT pmix_status_t PMIx_server_get_comm_cost (pmix_fabric_t * fabric ,
155- uint32_t src , uint32_t dest ,
156- uint16_t * cost );
157-
158- /* Given a communication cost matrix index, return the corresponding
159- * vertex info in the provided fabric and the name of the node upon
113+ /* Given a communication cost matrix index for a specified fabric,
114+ * return the corresponding vertex info and the name of the node upon
160115 * which it resides.
161- * If the PMIX_ERR_RESOURCE_BUSY or PMIX_ERR_FABRIC_UPDATED status is
162- * returned, then the caller should update their cost information
163- * before re-issuing this request to ensure accurate correlation
164- * between cost and LID
165116 *
166117 * fabric - pointer to the pmix_fabric_t struct provided to
167118 * the registration function
@@ -179,20 +130,14 @@ PMIX_EXPORT pmix_status_t PMIx_server_get_comm_cost(pmix_fabric_t *fabric,
179130 *
180131 * PMIX_SUCCESS - indicates return of a valid value
181132 * PMIX_ERR_BAD_PARAM - provided index is out of bounds
182- * PMIX_ERR_RESOURCE_BUSY - matrix is being updated
183- * PMIX_ERR_FABRIC_UPDATED - fabric info has been updated since
184- * last call involving this pmix_fabric_t
185133 */
186134PMIX_EXPORT pmix_status_t PMIx_server_get_vertex_info (pmix_fabric_t * fabric ,
187135 uint32_t i , pmix_value_t * vertex ,
188136 char * * nodename );
189137
190- /* Given vertex info, return the corresponding communication cost matrix
191- * index and the name of the node upon which it resides.
192- * If the PMIX_ERR_RESOURCE_BUSY or PMIX_ERR_FABRIC_UPDATED status is
193- * returned, then the caller should update their cost information
194- * before re-issuing this request to ensure accurate correlation
195- * between cost and LID
138+ /* Given vertex info and the name of the device upon which that
139+ * vertex resides, return the corresponding communication cost matrix
140+ * index
196141 *
197142 * fabric - pointer to the pmix_fabric_t struct provided to
198143 * the registration function
@@ -201,10 +146,6 @@ PMIX_EXPORT pmix_status_t PMIx_server_get_vertex_info(pmix_fabric_t *fabric,
201146 *
202147 * i - pointer to the location where the index is to be returned
203148 *
204- * nodename - pointer to the location where the string nodename
205- * is to be returned. The caller is responsible for
206- * releasing the string when done
207- *
208149 * Return values include:
209150 *
210151 * PMIX_SUCCESS - indicates return of a valid value
@@ -214,8 +155,7 @@ PMIX_EXPORT pmix_status_t PMIx_server_get_vertex_info(pmix_fabric_t *fabric,
214155 * last call involving this pmix_fabric_t
215156 */
216157PMIX_EXPORT pmix_status_t PMIx_server_get_index (pmix_fabric_t * fabric ,
217- pmix_value_t * vertex , uint32_t * i ,
218- char * * nodename );
158+ pmix_value_t * vertex , uint32_t * i );
219159
220160#if defined(c_plusplus ) || defined(__cplusplus )
221161 }
0 commit comments