Merge pull request #6973 from wckzhang/bp_get_vertex
opal/util: Add function to get vertex data from bipartite graph
Этот коммит содержится в:
Коммит
a7da93f88c
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All Rights
|
* Copyright (c) 2017-2019 Amazon.com, Inc. or its affiliates. All Rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -411,6 +411,21 @@ int opal_bp_graph_add_vertex(opal_bp_graph_t *g,
|
|||||||
return OPAL_SUCCESS;
|
return OPAL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int opal_bp_graph_get_vertex_data(opal_bp_graph_t *g,
|
||||||
|
int v_index,
|
||||||
|
void** v_data_out)
|
||||||
|
{
|
||||||
|
opal_bp_graph_vertex_t* v;
|
||||||
|
|
||||||
|
v = V_ID_TO_PTR(g, v_index);
|
||||||
|
if (NULL == v) {
|
||||||
|
return OPAL_ERR_BAD_PARAM;
|
||||||
|
}
|
||||||
|
*v_data_out = v->v_data;
|
||||||
|
|
||||||
|
return OPAL_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
int opal_bp_graph_order(const opal_bp_graph_t *g)
|
int opal_bp_graph_order(const opal_bp_graph_t *g)
|
||||||
{
|
{
|
||||||
return NUM_VERTICES(g);
|
return NUM_VERTICES(g);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
|
||||||
* Copyright (c) 2017 Amazon.com, Inc. or its affiliates. All Rights
|
* Copyright (c) 2017-2019 Amazon.com, Inc. or its affiliates. All Rights
|
||||||
* reserved.
|
* reserved.
|
||||||
* $COPYRIGHT$
|
* $COPYRIGHT$
|
||||||
*
|
*
|
||||||
@ -126,6 +126,20 @@ int opal_bp_graph_add_vertex(opal_bp_graph_t *g,
|
|||||||
void *v_data,
|
void *v_data,
|
||||||
int *index_out);
|
int *index_out);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a pointer to the vertex data given the graph and vertex index
|
||||||
|
* associated with the vertex.
|
||||||
|
*
|
||||||
|
* @param[in] g graph the vertex belongs to
|
||||||
|
* @param[in] v_index integer index of the vertex
|
||||||
|
* @param[out] v_data_out data associated with the new vertex, may be NULL.
|
||||||
|
*
|
||||||
|
* @returns OPAL_SUCCESS or an OMPI error code
|
||||||
|
*/
|
||||||
|
int opal_bp_graph_get_vertex_data(opal_bp_graph_t *g,
|
||||||
|
int v_index,
|
||||||
|
void** v_data_out);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* compute the order of a graph (number of vertices)
|
* compute the order of a graph (number of vertices)
|
||||||
*
|
*
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user