本文整理汇总了C++中opal_list_get_end函数的典型用法代码示例。如果您正苦于以下问题:C++ opal_list_get_end函数的具体用法?C++ opal_list_get_end怎么用?C++ opal_list_get_end使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了opal_list_get_end函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: opal_hash_table_get_value_uint64
int opal_hash_table_get_value_uint64(opal_hash_table_t* ht, uint64_t key,
void **ptr)
{
opal_list_t* list = ht->ht_table + (key & ht->ht_mask);
opal_uint64_hash_node_t *node;
#if OPAL_ENABLE_DEBUG
if(ht->ht_table_size == 0) {
opal_output(0, "opal_hash_table_get_value_uint64:"
"opal_hash_table_init() has not been called");
return OPAL_ERROR;
}
#endif
for(node = (opal_uint64_hash_node_t*)opal_list_get_first(list);
node != (opal_uint64_hash_node_t*)opal_list_get_end(list);
node = (opal_uint64_hash_node_t*)opal_list_get_next(node)) {
if (node->hn_key == key) {
*ptr = node->hn_value;
return OPAL_SUCCESS;
}
}
return OPAL_ERR_NOT_FOUND;
}
开发者ID:315234,项目名称:OpenFOAM-2.2.x-OSX,代码行数:23,代码来源:opal_hash_table.c
示例2: mca_btl_openib_proc_reg_btl
int mca_btl_openib_proc_reg_btl(mca_btl_openib_proc_t* ib_proc,
mca_btl_openib_module_t* openib_btl)
{
mca_btl_openib_proc_btlptr_t* elem;
for(elem = (mca_btl_openib_proc_btlptr_t*)opal_list_get_first(&ib_proc->openib_btls);
elem != (mca_btl_openib_proc_btlptr_t*)opal_list_get_end(&ib_proc->openib_btls);
elem = (mca_btl_openib_proc_btlptr_t*)opal_list_get_next(elem)) {
if(elem->openib_btl == openib_btl) {
/* this is normal return meaning that this BTL has already touched this ib_proc */
return OPAL_ERR_RESOURCE_BUSY;
}
}
elem = OBJ_NEW(mca_btl_openib_proc_btlptr_t);
if( NULL == elem ){
return OPAL_ERR_OUT_OF_RESOURCE;
}
elem->openib_btl = openib_btl;
opal_list_append(&ib_proc->openib_btls, &elem->super);
return OPAL_SUCCESS;
}
开发者ID:00datman,项目名称:ompi,代码行数:23,代码来源:btl_openib_proc.c
示例3: mca_btl_udapl_proc_lookup_ompi
/*
* Look for an existing uDAPL process instances based on the associated
* ompi_proc_t instance.
*/
static mca_btl_udapl_proc_t* mca_btl_udapl_proc_lookup_ompi(ompi_proc_t* ompi_proc)
{
mca_btl_udapl_proc_t* udapl_proc;
OPAL_THREAD_LOCK(&mca_btl_udapl_component.udapl_lock);
for(udapl_proc = (mca_btl_udapl_proc_t*)
opal_list_get_first(&mca_btl_udapl_component.udapl_procs);
udapl_proc != (mca_btl_udapl_proc_t*)
opal_list_get_end(&mca_btl_udapl_component.udapl_procs);
udapl_proc = (mca_btl_udapl_proc_t*)opal_list_get_next(udapl_proc)) {
if(udapl_proc->proc_ompi == ompi_proc) {
OPAL_THREAD_UNLOCK(&mca_btl_udapl_component.udapl_lock);
return udapl_proc;
}
}
OPAL_THREAD_UNLOCK(&mca_btl_udapl_component.udapl_lock);
return NULL;
}
开发者ID:bringhurst,项目名称:ompi,代码行数:27,代码来源:btl_udapl_proc.c
示例4: mca_btl_template_proc_lookup_ompi
/*
* Look for an existing TEMPLATE process instances based on the associated
* ompi_proc_t instance.
*/
static mca_btl_template_proc_t* mca_btl_template_proc_lookup_ompi(ompi_proc_t* ompi_proc)
{
mca_btl_template_proc_t* template_proc;
OPAL_THREAD_LOCK(&mca_btl_template_component.template_lock);
for(template_proc = (mca_btl_template_proc_t*)
opal_list_get_first(&mca_btl_template_component.template_procs);
template_proc != (mca_btl_template_proc_t*)
opal_list_get_end(&mca_btl_template_component.template_procs);
template_proc = (mca_btl_template_proc_t*)opal_list_get_next(template_proc)) {
if(template_proc->proc_ompi == ompi_proc) {
OPAL_THREAD_UNLOCK(&mca_btl_template_component.template_lock);
return template_proc;
}
}
OPAL_THREAD_UNLOCK(&mca_btl_template_component.template_lock);
return NULL;
}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:27,代码来源:btl_template_proc.c
示例5: opal_graph_get_graph_vertices
/**
* This graph API returns an array of pointers of all the
* vertices in the graph.
*
*
* @param graph
* @param vertices_list an array of pointers of all the
* vertices in the graph vertices.
*
* @return int returning the graph order (the
* number of vertices in the returned array)
*/
int opal_graph_get_graph_vertices(opal_graph_t *graph, opal_pointer_array_t *vertices_list)
{
opal_adjacency_list_t *aj_list;
opal_list_item_t *item;
int i;
/**
* If the graph order is 0, return NULL.
*/
if (0 == graph->number_of_vertices) {
return 0;
}
/* Run on all the vertices of the graph */
for (item = opal_list_get_first(graph->adjacency_list), i = 0;
item != opal_list_get_end(graph->adjacency_list);
item = opal_list_get_next(item), i++) {
aj_list = (opal_adjacency_list_t *) item;
/* Add the vertex to the vertices array */
opal_pointer_array_add(vertices_list,(void *)aj_list->vertex);
}
/* return the vertices list */
return graph->number_of_vertices;
}
开发者ID:00datman,项目名称:ompi,代码行数:35,代码来源:opal_graph.c
示例6: opal_list_get_end
/**
* This graph API finds a vertex in the graph according the
* vertex data.
* @param graph the graph we searching in.
* @param vertex_data the vertex data we are searching according
* to.
*
* @return opal_graph_vertex_t* The vertex founded or NULL.
*/
opal_graph_vertex_t *opal_graph_find_vertex(opal_graph_t *graph, void *vertex_data)
{
opal_adjacency_list_t *aj_list;
opal_list_item_t *item;
/**
* Run on all the vertices of the graph
*/
for (item = opal_list_get_first(graph->adjacency_list);
item != opal_list_get_end(graph->adjacency_list);
item = opal_list_get_next(item)) {
aj_list = (opal_adjacency_list_t *) item;
if (NULL != aj_list->vertex->compare_vertex) {
/* if the vertex data of a vertex is equal to the vertex data */
if (0 == aj_list->vertex->compare_vertex(aj_list->vertex->vertex_data, vertex_data)) {
/* return the found vertex */
return aj_list->vertex;
}
}
}
/* if a vertex is not found, return NULL */
return NULL;
}
开发者ID:00datman,项目名称:ompi,代码行数:32,代码来源:opal_graph.c
示例7: orte_grpcomm_base_setup_collective
orte_grpcomm_collective_t* orte_grpcomm_base_setup_collective(orte_grpcomm_coll_id_t id)
{
opal_list_item_t *item;
orte_grpcomm_collective_t *cptr, *coll;
coll = NULL;
for (item = opal_list_get_first(&orte_grpcomm_base.active_colls);
item != opal_list_get_end(&orte_grpcomm_base.active_colls);
item = opal_list_get_next(item)) {
cptr = (orte_grpcomm_collective_t*)item;
if (id == cptr->id) {
coll = cptr;
break;
}
}
if (NULL == coll) {
coll = OBJ_NEW(orte_grpcomm_collective_t);
coll->id = id;
opal_list_append(&orte_grpcomm_base.active_colls, &coll->super);
}
return coll;
}
开发者ID:IanYXXL,项目名称:A1,代码行数:23,代码来源:grpcomm_base_frame.c
示例8: any_live_children
/*****************
* Local Functions
*****************/
static bool any_live_children(orte_jobid_t job)
{
opal_list_item_t *item;
orte_odls_child_t *child;
/* the thread is locked elsewhere - don't try to do it again here */
for (item = opal_list_get_first(&orte_local_children);
item != opal_list_get_end(&orte_local_children);
item = opal_list_get_next(item)) {
child = (orte_odls_child_t*)item;
/* is this child part of the specified job? */
if ((job == child->name->jobid || ORTE_JOBID_WILDCARD == job) &&
child->alive) {
return true;
}
}
/* if we get here, then nobody is left alive from that job */
return false;
}
开发者ID:bringhurst,项目名称:ompi,代码行数:26,代码来源:errmgr_default_orted.c
示例9: ompi_proc_find_and_add
static ompi_proc_t *
ompi_proc_find_and_add(const ompi_process_name_t * name, bool* isnew)
{
ompi_proc_t *proc, *rproc = NULL;
ompi_rte_cmp_bitmask_t mask;
/* return the proc-struct which matches this jobid+process id */
mask = OMPI_RTE_CMP_JOBID | OMPI_RTE_CMP_VPID;
OPAL_THREAD_LOCK(&ompi_proc_lock);
for(proc = (ompi_proc_t*)opal_list_get_first(&ompi_proc_list);
proc != (ompi_proc_t*)opal_list_get_end(&ompi_proc_list);
proc = (ompi_proc_t*)opal_list_get_next(proc)) {
if (OPAL_EQUAL == ompi_rte_compare_name_fields(mask, &proc->proc_name, name)) {
rproc = proc;
*isnew = false;
break;
}
}
/* if we didn't find this proc in the list, create a new
* proc_t and append it to the list
*/
if (NULL == rproc) {
*isnew = true;
rproc = OBJ_NEW(ompi_proc_t);
if (NULL != rproc) {
opal_list_append(&ompi_proc_list, (opal_list_item_t*)rproc);
rproc->proc_name = *name;
}
/* caller had better fill in the rest of the proc, or there's
going to be pain later... */
}
OPAL_THREAD_UNLOCK(&ompi_proc_lock);
return rproc;
}
开发者ID:IanYXXL,项目名称:A1,代码行数:37,代码来源:proc.c
示例10: oshmem_proc_finalize
int oshmem_proc_finalize(void)
{
opal_list_item_t *item;
/* Destroy all groups */
oshmem_proc_group_finalize();
/* remove all items from list and destroy them. Since we cannot know
* the reference count of the procs for certain, it is possible that
* a single OBJ_RELEASE won't drive the count to zero, and hence will
* not release the memory. Accordingly, we cycle through the list here,
* calling release on each item.
*
* This will cycle until it forces the reference count of each item
* to zero, thus causing the destructor to run - which will remove
* the item from the list!
*
* We cannot do this under the thread lock as the destructor will
* call it when removing the item from the list. However, this function
* is ONLY called from MPI_Finalize, and all threads are prohibited from
* calling an MPI function once ANY thread has called MPI_Finalize. Of
* course, multiple threads are allowed to call MPI_Finalize, so this
* function may get called multiple times by various threads. We believe
* it is thread safe to do so...though it may not -appear- to be so
* without walking through the entire list/destructor sequence.
*/
while (opal_list_get_end(&oshmem_proc_list)
!= (item = opal_list_get_first(&oshmem_proc_list))) {
OBJ_RELEASE(item);
}
OBJ_RELEASE( oshmem_shmem_local_convertor);
/* now destruct the list and thread lock */
OBJ_DESTRUCT(&oshmem_proc_list);
OBJ_DESTRUCT(&oshmem_proc_lock);
return OSHMEM_SUCCESS;
}
开发者ID:XuanWang1982,项目名称:ompi,代码行数:37,代码来源:proc.c
示例11: opal_graph_add_edge
/**
* This graph API adds an edge (connection between two
* vertices) to a graph. The most common use
* for this API is while building a graph.
*
* @param graph The graph that this edge will be added to.
* @param edge The edge that we want to add.
*
* @return int Success or error. this API can return an error if
* one of the vertices is not in the graph.
*/
int opal_graph_add_edge(opal_graph_t *graph, opal_graph_edge_t *edge)
{
opal_adjacency_list_t *aj_list, *start_aj_list= NULL;
opal_list_item_t *item;
bool start_found = false, end_found = false;
/**
* find the vertices that this edge should connect.
*/
for (item = opal_list_get_first(graph->adjacency_list);
item != opal_list_get_end(graph->adjacency_list);
item = opal_list_get_next(item)) {
aj_list = (opal_adjacency_list_t *) item;
if (aj_list->vertex == edge->start) {
start_found = true;
start_aj_list = aj_list;
}
if (aj_list->vertex == edge->end) {
end_found = true;
}
}
/**
* if one of the vertices either the start or the end is not
* found - return an error.
*/
if (false == start_found && false == end_found) {
return OPAL_ERROR;
}
/* point the edge to the adjacency list of the start vertex (for easy search) */
edge->in_adj_list=start_aj_list;
/* append the edge to the adjacency list of the start vertex */
opal_list_append(start_aj_list->edges, (opal_list_item_t*)edge);
/* increase the graph size */
graph->number_of_edges++;
return OPAL_SUCCESS;
}
开发者ID:00datman,项目名称:ompi,代码行数:48,代码来源:opal_graph.c
示例12: mca_oob_tcp_recv_cancel
int mca_oob_tcp_recv_cancel(
orte_process_name_t* name,
int tag)
{
int matched = 0;
opal_list_item_t *item, *next;
/* wait for any previously matched messages to be processed */
OPAL_THREAD_LOCK(&mca_oob_tcp_component.tcp_match_lock);
#if OMPI_ENABLE_PROGRESS_THREADS
if(opal_event_progress_thread() == false) {
while(mca_oob_tcp_component.tcp_match_count) {
opal_condition_wait(
&mca_oob_tcp_component.tcp_match_cond,
&mca_oob_tcp_component.tcp_match_lock);
}
}
#endif
/* remove any matching posted receives */
for(item = opal_list_get_first(&mca_oob_tcp_component.tcp_msg_post);
item != opal_list_get_end(&mca_oob_tcp_component.tcp_msg_post);
item = next) {
mca_oob_tcp_msg_t* msg = (mca_oob_tcp_msg_t*)item;
next = opal_list_get_next(item);
if (OPAL_EQUAL == opal_dss.compare(name, &msg->msg_peer, ORTE_NAME)) {
if (msg->msg_hdr.msg_tag == tag) {
opal_list_remove_item(&mca_oob_tcp_component.tcp_msg_post, &msg->super.super);
MCA_OOB_TCP_MSG_RETURN(msg);
matched++;
}
}
}
OPAL_THREAD_UNLOCK(&mca_oob_tcp_component.tcp_match_lock);
return (matched > 0) ? ORTE_SUCCESS : ORTE_ERR_NOT_FOUND;
}
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:37,代码来源:oob_tcp_recv.c
示例13: orte_iof_base_endpoint_match
orte_iof_base_endpoint_t* orte_iof_base_endpoint_match(
const orte_process_name_t* target_name,
orte_ns_cmp_bitmask_t target_mask,
int target_tag)
{
opal_list_item_t* item;
OPAL_THREAD_LOCK(&orte_iof_base.iof_lock);
for(item = opal_list_get_first(&orte_iof_base.iof_endpoints);
item != opal_list_get_end(&orte_iof_base.iof_endpoints);
item = opal_list_get_next(item)) {
orte_iof_base_endpoint_t* endpoint = (orte_iof_base_endpoint_t*)item;
if(orte_ns.compare_fields(target_mask,target_name,&endpoint->ep_origin) == 0) {
if(endpoint->ep_tag == target_tag ||
endpoint->ep_tag == ORTE_IOF_ANY ||
target_tag == ORTE_IOF_ANY) {
OBJ_RETAIN(endpoint);
OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock);
return endpoint;
}
}
}
OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock);
return NULL;
}
开发者ID:saurabhmaurya06,项目名称:Text-Summarization,代码行数:24,代码来源:iof_base_endpoint.c
示例14: mca_rcache_vma_clean
int mca_rcache_vma_clean(struct mca_rcache_base_module_t* rcache)
{
mca_rcache_vma_module_t *vma_rcache = (mca_rcache_vma_module_t*)rcache;
mca_rcache_vma_t *vma;
opal_list_item_t *i;
do {
OPAL_THREAD_LOCK(&rcache->lock);
i = opal_list_get_first(&vma_rcache->vma_delete_list);
if(opal_list_get_end(&vma_rcache->vma_delete_list) == i) {
vma = NULL;
OPAL_THREAD_UNLOCK(&rcache->lock);
} else {
vma = (mca_rcache_vma_t *)i;
opal_list_remove_item(&vma_rcache->vma_delete_list, &vma->super);
/* Need to drop the rcache lock before destroying the vma */
OPAL_THREAD_UNLOCK(&rcache->lock);
mca_rcache_vma_destroy(vma);
}
} while (NULL != vma);
return OMPI_SUCCESS;
}
开发者ID:jsquyres,项目名称:ompi-idynamic,代码行数:24,代码来源:rcache_vma.c
示例15: opal_hash_table_remove_value_uint64
int opal_hash_table_remove_value_uint64(opal_hash_table_t* ht, uint64_t key)
{
opal_list_t* list = ht->ht_table + (key & ht->ht_mask);
opal_uint64_hash_node_t *node;
#if OPAL_ENABLE_DEBUG
if(ht->ht_table_size == 0) {
opal_output(0, "opal_hash_table_remove_value_uint64:"
"opal_hash_table_init() has not been called");
return OPAL_ERR_BAD_PARAM;
}
#endif
for(node = (opal_uint64_hash_node_t*)opal_list_get_first(list);
node != (opal_uint64_hash_node_t*)opal_list_get_end(list);
node = (opal_uint64_hash_node_t*)opal_list_get_next(node)) {
if (node->hn_key == key) {
opal_list_remove_item(list, (opal_list_item_t*)node);
opal_list_append(&ht->ht_nodes, (opal_list_item_t*)node);
ht->ht_size--;
return OPAL_SUCCESS;
}
}
return OPAL_ERR_NOT_FOUND;
}
开发者ID:315234,项目名称:OpenFOAM-2.2.x-OSX,代码行数:24,代码来源:opal_hash_table.c
示例16: mca_io_base_register_datarep
int
mca_io_base_register_datarep(char *datarep,
MPI_Datarep_conversion_function* read_fn,
MPI_Datarep_conversion_function* write_fn,
MPI_Datarep_extent_function* extent_fn,
void* state)
{
opal_list_item_t *p;
const mca_base_component_t *component;
const mca_io_base_component_1_0_0_t *v100;
int tmp, ret = OMPI_SUCCESS;
/* Find the maximum additional number of bytes required by all io
components for requests and make that the request size */
for (p = opal_list_get_first(&mca_io_base_components_available);
p != opal_list_get_end(&mca_io_base_components_available);
p = opal_list_get_next(p)) {
component = ((mca_base_component_priority_list_item_t *)
p)->super.cli_component;
/* Only know how to handle v1.0.0 components for now */
if (component->mca_type_major_version == 1 &&
component->mca_type_minor_version == 0 &&
component->mca_type_release_version == 0) {
v100 = (mca_io_base_component_1_0_0_t *) component;
/* return first non-good error-code */
tmp = v100->io_register_datarep(datarep, read_fn, write_fn,
extent_fn, state);
ret = (ret == OMPI_SUCCESS) ? tmp : ret;
}
}
return ret;
}
开发者ID:aosm,项目名称:openmpi,代码行数:36,代码来源:io_base_register_datarep.c
示例17: route_lost
static int route_lost(const orte_process_name_t *route)
{
opal_list_item_t *item;
orte_routed_tree_t *child;
orte_routed_jobfam_t *jfam;
uint16_t jfamily;
int i;
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
"%s route to %s lost",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(route)));
/* if the route is to a different job family and we are the HNP, look it up */
if ((ORTE_JOB_FAMILY(route->jobid) != ORTE_JOB_FAMILY(ORTE_PROC_MY_NAME->jobid)) &&
ORTE_PROC_IS_HNP) {
jfamily = ORTE_JOB_FAMILY(route->jobid);
for (i=0; i < orte_routed_jobfams.size; i++) {
if (NULL == (jfam = (orte_routed_jobfam_t*)opal_pointer_array_get_item(&orte_routed_jobfams, i))) {
continue;
}
if (jfam->job_family == jfamily) {
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
"%s routed_radix: route to %s lost",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_JOB_FAMILY_PRINT(route->jobid)));
opal_pointer_array_set_item(&orte_routed_jobfams, i, NULL);
OBJ_RELEASE(jfam);
break;
}
}
}
/* if we lose the connection to the lifeline and we are NOT already,
* in finalize, tell the OOB to abort.
* NOTE: we cannot call abort from here as the OOB needs to first
* release a thread-lock - otherwise, we will hang!!
*/
if (!orte_finalizing &&
NULL != lifeline &&
OPAL_EQUAL == orte_util_compare_name_fields(ORTE_NS_CMP_ALL, route, lifeline)) {
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
"%s routed:radix: Connection to lifeline %s lost",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(lifeline)));
return ORTE_ERR_FATAL;
}
/* if we are the HNP or daemon, and the route is a daemon,
* see if it is one of our children - if so, remove it
*/
if ((ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) &&
route->jobid == ORTE_PROC_MY_NAME->jobid) {
for (item = opal_list_get_first(&my_children);
item != opal_list_get_end(&my_children);
item = opal_list_get_next(item)) {
child = (orte_routed_tree_t*)item;
if (child->vpid == route->vpid) {
opal_list_remove_item(&my_children, item);
OBJ_RELEASE(item);
return ORTE_SUCCESS;
}
}
}
/* we don't care about this one, so return success */
return ORTE_SUCCESS;
}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:68,代码来源:routed_radix.c
示例18: get_route
//.........这里部分代码省略.........
goto found;
}
/* if I am the HNP or a tool, then I stored a route to
* this job family, so look it up
*/
jfamily = ORTE_JOB_FAMILY(target->jobid);
for (i=0; i < orte_routed_jobfams.size; i++) {
if (NULL == (jfam = (orte_routed_jobfam_t*)opal_pointer_array_get_item(&orte_routed_jobfams, i))) {
continue;
}
if (jfam->job_family == jfamily) {
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
"%s routed_binomial: route to %s found",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_JOB_FAMILY_PRINT(target->jobid)));
ret = &jfam->route;
goto found;
}
}
/* not found - so we have no route */
ret = ORTE_NAME_INVALID;
goto found;
}
/* THIS CAME FROM OUR OWN JOB FAMILY... */
/* if this is going to the HNP, then send it direct if we don't know
* how to get there - otherwise, send it via the tree
*/
if (OPAL_EQUAL == orte_util_compare_name_fields(ORTE_NS_CMP_ALL, ORTE_PROC_MY_HNP, target)) {
if (!hnp_direct || orte_static_ports) {
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
"%s routing to the HNP through my parent %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(ORTE_PROC_MY_PARENT)));
ret = ORTE_PROC_MY_PARENT;
goto found;
} else {
OPAL_OUTPUT_VERBOSE((2, orte_routed_base_framework.framework_output,
"%s routing direct to the HNP",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME)));
ret = ORTE_PROC_MY_HNP;
goto found;
}
}
daemon.jobid = ORTE_PROC_MY_NAME->jobid;
/* find out what daemon hosts this proc */
if (ORTE_VPID_INVALID == (daemon.vpid = orte_get_proc_daemon_vpid(target))) {
ORTE_ERROR_LOG(ORTE_ERR_NOT_FOUND);
ret = ORTE_NAME_INVALID;
goto found;
}
/* if the daemon is me, then send direct to the target! */
if (ORTE_PROC_MY_NAME->vpid == daemon.vpid) {
ret = target;
goto found;
} else if (orte_process_info.num_procs < mca_routed_radix_component.max_connections) {
/* if the job is small enough, send direct to the target's daemon */
ret = &daemon;
goto found;
} else {
/* search routing tree for next step to that daemon */
for (item = opal_list_get_first(&my_children);
item != opal_list_get_end(&my_children);
item = opal_list_get_next(item)) {
child = (orte_routed_tree_t*)item;
if (child->vpid == daemon.vpid) {
/* the child is hosting the proc - just send it there */
ret = &daemon;
goto found;
}
/* otherwise, see if the daemon we need is below the child */
if (opal_bitmap_is_set_bit(&child->relatives, daemon.vpid)) {
/* yep - we need to step through this child */
daemon.vpid = child->vpid;
ret = &daemon;
goto found;
}
}
}
/* if we get here, then the target daemon is not beneath
* any of our children, so we have to step up through our parent
*/
daemon.vpid = ORTE_PROC_MY_PARENT->vpid;
ret = &daemon;
found:
OPAL_OUTPUT_VERBOSE((1, orte_routed_base_framework.framework_output,
"%s routed_radix_get(%s) --> %s",
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
ORTE_NAME_PRINT(target),
ORTE_NAME_PRINT(ret)));
return *ret;
}
开发者ID:Dissolubilis,项目名称:ompi-svn-mirror,代码行数:101,代码来源:routed_radix.c
示例19: mca_btl_base_select
/**
* Function for weeding out btl components that don't want to run.
*
* Call the init function on all available components to find out if
* they want to run. Select all components that don't fail. Failing
* components will be closed and unloaded. The selected modules will
* be returned to the caller in a opal_list_t.
*/
int mca_btl_base_select(bool enable_progress_threads,
bool enable_mpi_threads)
{
int i, num_btls;
opal_list_item_t *item;
mca_base_component_list_item_t *cli;
mca_btl_base_component_t *component;
mca_btl_base_module_t **modules;
mca_btl_base_selected_module_t *sm;
char** include = opal_argv_split(mca_btl_base_include, ',');
char** exclude = opal_argv_split(mca_btl_base_exclude, ',');
/* Traverse the list of opened modules; call their init
functions. */
item = opal_list_get_first(&mca_btl_base_components_opened);
while(item != opal_list_get_end(&mca_btl_base_components_opened)) {
opal_list_item_t *next = opal_list_get_next(item);
cli = (mca_base_component_list_item_t *) item;
component = (mca_btl_base_component_t *) cli->cli_component;
/* if there is an include list - item must be in the list to be included */
if ( NULL != include ) {
char** argv = include;
bool found = false;
while(argv && *argv) {
if(strcmp(component->btl_version.mca_component_name,*argv) == 0) {
found = true;
break;
}
argv++;
}
if(found == false) {
item = next;
continue;
}
/* otherwise - check the exclude list to see if this item has been specifically excluded */
} else if ( NULL != exclude ) {
char** argv = exclude;
bool found = false;
while(argv && *argv) {
if(strcmp(component->btl_version.mca_component_name,*argv) == 0) {
found = true;
break;
}
argv++;
}
if(found == true) {
item = next;
continue;
}
}
opal_output_verbose(10, mca_btl_base_output,
"select: initializing %s component %s",
component->btl_version.mca_type_name,
component->btl_version.mca_component_name);
if (NULL == component->btl_init) {
opal_output_verbose(10, mca_btl_base_output,
"select: no init function; ignoring component %s",
component->btl_version.mca_component_name);
} else {
modules = component->btl_init(&num_btls, enable_progress_threads,
enable_mpi_threads);
/* If the component didn't initialize, remove it from the opened
list and remove it from the component repository */
if (NULL == modules) {
opal_output_verbose(10, mca_btl_base_output,
"select: init of component %s returned failure",
component->btl_version.mca_component_name);
opal_output_verbose(10, mca_btl_base_output,
"select: module %s unloaded",
component->btl_version.mca_component_name);
mca_base_component_repository_release((mca_base_component_t *) component);
opal_list_remove_item(&mca_btl_base_components_opened, item);
}
/* Otherwise, it initialized properly. Save it. */
else {
opal_output_verbose(10, mca_btl_base_output,
"select: init of component %s returned success",
component->btl_version.mca_component_name);
for (i = 0; i < num_btls; ++i) {
sm = OBJ_NEW(mca_btl_base_selected_module_t);
//.........这里部分代码省略.........
开发者ID:hpc,项目名称:cce-mpi-openmpi-1.4.3,代码行数:101,代码来源:btl_base_select.c
示例20: fetch_multiple
static int fetch_multiple(const opal_identifier_t *uid,
opal_scope_t scope,
const char *key,
opal_list_t *kvs)
{
proc_data_t *proc_data;
opal_value_t *kv, *kvnew;
int rc;
char *srchkey, *ptr;
size_t len = 0;
opal_identifier_t id;
/* to protect alignment, copy the data across */
memcpy(&id, uid, sizeof(opal_identifier_t));
OPAL_OUTPUT_VERBOSE((5, opal_db_base_framework.framework_output,
"db:hash:fetch_multiple: searching for key %s on proc %" PRIu64 "",
(NULL == key) ? "NULL" : key, id));
/* lookup the proc data object for this proc */
if (NULL == (proc_data = lookup_opal_proc(&hash_data, id))) {
/* look elsewhere */
return OPAL_ERR_TAKE_NEXT_OPTION;
}
/* if the key is NULL, then return all the values */
if (NULL == key) {
for (kv = (opal_value_t*) opal_list_get_first(&proc_data->data);
kv != (opal_value_t*) opal_list_get_end(&proc_data->data);
kv = (opal_value_t*) opal_list_get_next(kv)) {
/* check for a matching scope */
if (!(scope & kv->scope)) {
continue;
}
if (OPAL_SUCCESS != (rc = opal_dss.copy((void**)&kvnew, kv, OPAL_VALUE))) {
OPAL_ERROR_LOG(rc);
return rc;
}
opal_list_append(kvs, &kvnew->super);
}
return OPAL_SUCCESS;
}
/* see if the key includes a wildcard */
srchkey = strdup(key);
if (NULL != (ptr = strchr(srchkey, '*'))) {
*ptr = '\0';
len = strlen(srchkey);
}
/* otherwise, find all matching keys and return them */
for (kv = (opal_value_t*) opal_list_get_first(&proc_data->data);
kv != (opal_value_t*) opal_list_get_end(&proc_data->data);
kv = (opal_value_t*) opal_list_get_next(kv)) {
/* check for a matching scope */
if (!(scope & kv->scope)) {
continue;
}
if ((0 < len && 0 == strncmp(srchkey, kv->key, len)) ||
(0 == len && 0 == strcmp(key, kv->key))) {
if (OPAL_SUCCESS != (rc = opal_dss.copy((void**)&kvnew, kv, OPAL_VALUE))) {
OPAL_ERROR_LOG(rc);
return rc;
}
opal_list_append(kvs, &kvnew->super);
}
}
free(srchkey);
return OPAL_SUCCESS;
}
开发者ID:IanYXXL,项目名称:A1,代码行数:70,代码来源:db_hash.c
注:本文中的opal_list_get_end函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论