1
1
openmpi/orte/mca/oob/base/oob_base_xcast.c

91 строка
2.9 KiB
C
Исходник Обычный вид История

/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include <string.h>
#include "include/constants.h"
Fix a subtle bug in the registry callback system that was manifesting itself in the singleton case and (randomly) in the multiprocess case. Update the unit-test-status matrix to include priority. Add several new registry diagnostics that helped track down the above bug. M test/mca/gpr/gpr_triggers.c M test/Unit-Test-Status.xls M test/Unit-Test-Status.pdf M src/mpi/runtime/ompi_mpi_init.c M src/mca/oob/base/oob_base_xcast.c M src/mca/ns/base/ns_base_nds_env.c M src/mca/gpr/replica/api_layer/gpr_replica_dump_api.c M src/mca/gpr/replica/api_layer/gpr_replica_api.h M src/mca/gpr/replica/communications/gpr_replica_comm.h M src/mca/gpr/replica/communications/gpr_replica_remote_msg.c M src/mca/gpr/replica/communications/gpr_replica_cmd_processor.c M src/mca/gpr/replica/communications/gpr_replica_dump_cm.c M src/mca/gpr/replica/gpr_replica_component.c M src/mca/gpr/replica/gpr_replica.h M src/mca/gpr/replica/functional_layer/gpr_replica_dump_fn.c M src/mca/gpr/replica/functional_layer/gpr_replica_fn.h M src/mca/gpr/replica/functional_layer/gpr_replica_trig_ops_fn.c M src/mca/gpr/replica/functional_layer/gpr_replica_messaging_fn.c M src/mca/gpr/replica/functional_layer/gpr_replica_segment_fn.c M src/mca/gpr/proxy/gpr_proxy_dump.c M src/mca/gpr/proxy/gpr_proxy.h M src/mca/gpr/proxy/gpr_proxy_component.c M src/mca/gpr/gpr_types.h M src/mca/gpr/base/base.h M src/mca/gpr/base/unpack_api_response/gpr_base_dump_notify.c M src/mca/gpr/base/pack_api_cmd/gpr_base_pack_dump.c M src/mca/gpr/gpr.h This commit was SVN r5080.
2005-03-28 22:37:54 +00:00
#include "util/output.h"
#include "util/proc_info.h"
#include "mca/oob/oob.h"
#include "mca/oob/base/base.h"
#include "mca/ns/ns.h"
#include "mca/gpr/gpr.h"
#include "mca/errmgr/errmgr.h"
#include "mca/soh/base/base.h"
#include "runtime/runtime.h"
/**
* A "broadcast-like" function over the specified set of peers.
* @param root The process acting as the root of the broadcast.
* @param peers The list of processes receiving the broadcast (excluding root).
* @param buffer The data to broadcast - only significant at root.
* @param cbfunc Callback function on receipt of data - not significant at root.
*
* Note that the callback function is provided so that the data can be
* received and interpreted by the application prior to the broadcast
* continuing to forward data along the distribution tree.
*/
int mca_oob_xcast(
orte_process_name_t* root,
orte_process_name_t* peers,
size_t num_peers,
orte_buffer_t* buffer,
mca_oob_callback_packed_fn_t cbfunc)
{
size_t i;
int rc;
int tag = MCA_OOB_TAG_XCAST;
int cmpval;
int status;
orte_proc_state_t state;
/* check to see if I am the root process name */
cmpval = orte_ns.compare(ORTE_NS_CMP_ALL, root, orte_process_info.my_name);
if(NULL != root && 0 == cmpval) {
for(i=0; i<num_peers; i++) {
/* check status of peer to ensure they are alive */
if (ORTE_SUCCESS != (rc = orte_soh.get_proc_soh(&state, &status, peers+i))) {
ORTE_ERROR_LOG(rc);
return rc;
}
if (state != ORTE_PROC_STATE_TERMINATED) {
rc = mca_oob_send_packed(peers+i, buffer, tag, 0);
if (rc < 0) {
ORTE_ERROR_LOG(rc);
return rc;
}
}
}
} else {
orte_buffer_t rbuf;
OBJ_CONSTRUCT(&rbuf, orte_buffer_t);
rc = mca_oob_recv_packed(MCA_OOB_NAME_ANY, &rbuf, tag);
if(rc < 0) {
OBJ_DESTRUCT(&rbuf);
return rc;
}
if(cbfunc != NULL)
cbfunc(rc, root, &rbuf, tag, NULL);
OBJ_DESTRUCT(&rbuf);
}
return OMPI_SUCCESS;
}