coll/ml: cleanup tabs, indentation, and trailing whitespace in
bcol_basesmuma_bcast.c This commit was SVN r31192.
Этот коммит содержится в:
родитель
d241f95af1
Коммит
128cfe0a39
@ -37,19 +37,19 @@
|
||||
/* end debug */
|
||||
int bcol_basesmuma_bcast_init(mca_bcol_base_module_t *super)
|
||||
{
|
||||
mca_bcol_base_coll_fn_comm_attributes_t comm_attribs;
|
||||
mca_bcol_base_coll_fn_invoke_attributes_t inv_attribs;
|
||||
mca_bcol_base_coll_fn_comm_attributes_t comm_attribs;
|
||||
mca_bcol_base_coll_fn_invoke_attributes_t inv_attribs;
|
||||
|
||||
comm_attribs.bcoll_type = BCOL_BCAST;
|
||||
comm_attribs.comm_size_min = 0;
|
||||
comm_attribs.comm_size_max = 1048576;
|
||||
comm_attribs.data_src = DATA_SRC_KNOWN;
|
||||
comm_attribs.waiting_semantics = NON_BLOCKING;
|
||||
comm_attribs.bcoll_type = BCOL_BCAST;
|
||||
comm_attribs.comm_size_min = 0;
|
||||
comm_attribs.comm_size_max = 1048576;
|
||||
comm_attribs.data_src = DATA_SRC_KNOWN;
|
||||
comm_attribs.waiting_semantics = NON_BLOCKING;
|
||||
|
||||
inv_attribs.bcol_msg_min = 0;
|
||||
inv_attribs.bcol_msg_max = 20000; /* range 1 */
|
||||
inv_attribs.datatype_bitmap = 0xffffffff;
|
||||
inv_attribs.op_types_bitmap = 0xffffffff;
|
||||
inv_attribs.bcol_msg_min = 0;
|
||||
inv_attribs.bcol_msg_max = 20000; /* range 1 */
|
||||
inv_attribs.datatype_bitmap = 0xffffffff;
|
||||
inv_attribs.op_types_bitmap = 0xffffffff;
|
||||
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_bcast_k_nomial_knownroot,
|
||||
@ -67,49 +67,47 @@ int bcol_basesmuma_bcast_init(mca_bcol_base_module_t *super)
|
||||
inv_attribs.bcol_msg_max = 20000; /* range 1 */
|
||||
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_bcast_k_nomial_anyroot,
|
||||
bcol_basesmuma_bcast_k_nomial_anyroot);
|
||||
bcol_basesmuma_bcast_k_nomial_anyroot,
|
||||
bcol_basesmuma_bcast_k_nomial_anyroot);
|
||||
|
||||
comm_attribs.data_src = DATA_SRC_UNKNOWN;
|
||||
inv_attribs.bcol_msg_min = 10000000;
|
||||
inv_attribs.bcol_msg_max = 10485760; /* range 4 */
|
||||
comm_attribs.data_src = DATA_SRC_UNKNOWN;
|
||||
inv_attribs.bcol_msg_min = 10000000;
|
||||
inv_attribs.bcol_msg_max = 10485760; /* range 4 */
|
||||
|
||||
#ifdef __PORTALS_AVAIL__
|
||||
|
||||
comm_attribs.waiting_semantics = BLOCKING;
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_bcast,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_bcast);
|
||||
comm_attribs.waiting_semantics = BLOCKING;
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_bcast,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_bcast);
|
||||
|
||||
|
||||
comm_attribs.waiting_semantics = NON_BLOCKING;
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_nb_bcast,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_nb_bcast);
|
||||
comm_attribs.waiting_semantics = NON_BLOCKING;
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_nb_bcast,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_nb_bcast);
|
||||
|
||||
comm_attribs.data_src = DATA_SRC_KNOWN;
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_nb_knownroot_bcast,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_nb_knownroot_bcast);
|
||||
comm_attribs.data_src = DATA_SRC_KNOWN;
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_nb_knownroot_bcast,
|
||||
bcol_basesmuma_lmsg_scatter_allgather_portals_nb_knownroot_bcast);
|
||||
|
||||
#else
|
||||
/*
|
||||
if (super->use_hdl) {
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_hdl_zerocopy_bcast,
|
||||
bcol_basesmuma_hdl_zerocopy_bcast);
|
||||
} else { */
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
NULL,
|
||||
NULL);
|
||||
/*
|
||||
bcol_basesmuma_binary_scatter_allgather_segment,
|
||||
bcol_basesmuma_binary_scatter_allgather_segment);
|
||||
*/
|
||||
/* } */
|
||||
/*
|
||||
if (super->use_hdl) {
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs,
|
||||
bcol_basesmuma_hdl_zerocopy_bcast,
|
||||
bcol_basesmuma_hdl_zerocopy_bcast);
|
||||
} else { */
|
||||
mca_bcol_base_set_attributes(super, &comm_attribs, &inv_attribs, NULL, NULL);
|
||||
/*
|
||||
bcol_basesmuma_binary_scatter_allgather_segment,
|
||||
bcol_basesmuma_binary_scatter_allgather_segment);
|
||||
*/
|
||||
/* } */
|
||||
#endif
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/* includes shared memory optimization */
|
||||
@ -131,7 +129,7 @@ int bcol_basesmuma_bcast_init(mca_bcol_base_module_t *super)
|
||||
* @param module - basesmuma module.
|
||||
*/
|
||||
int bcol_basesmuma_bcast(bcol_function_args_t *input_args,
|
||||
mca_bcol_base_function_t *c_input_args)
|
||||
mca_bcol_base_function_t *c_input_args)
|
||||
{
|
||||
/* local variables */
|
||||
int group_size, process_shift, my_node_index;
|
||||
@ -139,7 +137,7 @@ int bcol_basesmuma_bcast(bcol_function_args_t *input_args,
|
||||
int rc = OMPI_SUCCESS;
|
||||
int my_fanout_parent;
|
||||
int leading_dim, buff_idx, idx;
|
||||
volatile int8_t ready_flag;
|
||||
volatile int8_t ready_flag;
|
||||
int count=input_args->count;
|
||||
struct ompi_datatype_t* dtype=input_args->dtype;
|
||||
int root=input_args->root;
|
||||
@ -217,17 +215,17 @@ int bcol_basesmuma_bcast(bcol_function_args_t *input_args,
|
||||
parent_ctl_pointer = data_buffs[my_fanout_parent].ctl_struct;
|
||||
|
||||
/* Wait until parent signals that data is ready */
|
||||
/* The order of conditions checked in this loop is important, as it can
|
||||
* result in a race condition.
|
||||
*/
|
||||
while (!IS_PEER_READY(parent_ctl_pointer, ready_flag, sequence_number, BCAST_FLAG, bcol_id)){
|
||||
opal_progress();
|
||||
}
|
||||
/* The order of conditions checked in this loop is important, as it can
|
||||
* result in a race condition.
|
||||
*/
|
||||
while (!IS_PEER_READY(parent_ctl_pointer, ready_flag, sequence_number, BCAST_FLAG, bcol_id)){
|
||||
opal_progress();
|
||||
}
|
||||
|
||||
/* Copy the rank to a shared buffer writable by the current rank */
|
||||
/* Copy the rank to a shared buffer writable by the current rank */
|
||||
memcpy(data_addr, (void *)parent_data_pointer, pack_len);
|
||||
|
||||
if( 0 != rc ) {
|
||||
if( 0 != rc ) {
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
@ -241,11 +239,11 @@ int bcol_basesmuma_bcast(bcol_function_args_t *input_args,
|
||||
|
||||
|
||||
/* Wait until parent signals that data is ready */
|
||||
/* The order of conditions checked in this loop is important, as it can
|
||||
* result in a race condition.
|
||||
*/
|
||||
while (!IS_PEER_READY(parent_ctl_pointer, ready_flag, sequence_number, BCAST_FLAG, bcol_id)){
|
||||
opal_progress();
|
||||
/* The order of conditions checked in this loop is important, as it can
|
||||
* result in a race condition.
|
||||
*/
|
||||
while (!IS_PEER_READY(parent_ctl_pointer, ready_flag, sequence_number, BCAST_FLAG, bcol_id)){
|
||||
opal_progress();
|
||||
}
|
||||
|
||||
/* Copy the rank to a shared buffer writable by the current rank */
|
||||
@ -268,7 +266,7 @@ int bcol_basesmuma_bcast(bcol_function_args_t *input_args,
|
||||
/*zero-copy large massage communication methods*/
|
||||
#if 0
|
||||
int bcol_basesmuma_hdl_zerocopy_bcast(bcol_function_args_t *input_args,
|
||||
mca_bcol_base_function_t *c_input_args)
|
||||
mca_bcol_base_function_t *c_input_args)
|
||||
{
|
||||
/* local variables */
|
||||
int group_size, process_shift, my_node_index;
|
||||
@ -276,7 +274,7 @@ int bcol_basesmuma_hdl_zerocopy_bcast(bcol_function_args_t *input_args,
|
||||
int rc = OMPI_SUCCESS;
|
||||
int my_fanout_parent;
|
||||
int leading_dim, buff_idx, idx;
|
||||
volatile int64_t ready_flag;
|
||||
volatile int64_t ready_flag;
|
||||
int count=input_args->count;
|
||||
struct ompi_datatype_t* dtype=input_args->dtype;
|
||||
int root=input_args->root;
|
||||
@ -334,7 +332,7 @@ int bcol_basesmuma_hdl_zerocopy_bcast(bcol_function_args_t *input_args,
|
||||
first_instance = 1;
|
||||
}
|
||||
|
||||
if( first_instance ) {
|
||||
if( first_instance ) {
|
||||
/* Signal arrival */
|
||||
my_ctl_pointer->flag = -1;
|
||||
my_ctl_pointer->index = 1;
|
||||
@ -415,7 +413,7 @@ int bcol_basesmuma_hdl_zerocopy_bcast(bcol_function_args_t *input_args,
|
||||
ret = hdl->hdl_wait(hdl, hdl->endpoint, hdl_desc);
|
||||
BASESMUMA_VERBOSE(1,("wait on rank %d is done!", my_rank));
|
||||
#endif
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
BASESMUMA_VERBOSE(1, ("recvi eror on rank %d ........", my_rank));
|
||||
goto exit_ERROR;
|
||||
}
|
||||
@ -424,7 +422,7 @@ int bcol_basesmuma_hdl_zerocopy_bcast(bcol_function_args_t *input_args,
|
||||
#if __TEST_TEST__
|
||||
while (!status) {
|
||||
hdl->hdl_test(&hdl_desc, &completed, &status);
|
||||
opal_progress();
|
||||
opal_progress();
|
||||
BASESMUMA_VERBOSE(1, ("test on rank %d ........", my_rank));
|
||||
}
|
||||
#endif
|
||||
@ -445,10 +443,10 @@ int bcol_basesmuma_hdl_zerocopy_bcast(bcol_function_args_t *input_args,
|
||||
hdl->endpoint->remote_ctrl = parent_ctl_pointer;
|
||||
|
||||
ret = hdl->hdl_recv(hdl, hdl->endpoint, hdl_desc);
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
goto exit_ERROR;
|
||||
}
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
if (OMPI_SUCCESS != ret) {
|
||||
BASESMUMA_VERBOSE(1, ("recvi eror on rank %d ........", my_rank));
|
||||
goto exit_ERROR;
|
||||
}
|
||||
@ -471,19 +469,19 @@ int bcol_basesmuma_hdl_zerocopy_bcast(bcol_function_args_t *input_args,
|
||||
goto Release;
|
||||
}
|
||||
|
||||
Release:
|
||||
Release:
|
||||
/* if I am the last instance of a basesmuma function in this collectie,
|
||||
* release the resrouces */
|
||||
if (IS_LAST_BCOL_FUNC(c_input_args)) {
|
||||
rc = bcol_basesmuma_free_buff(
|
||||
&(bcol_module->colls_with_user_data),
|
||||
sequence_number);
|
||||
&(bcol_module->colls_with_user_data),
|
||||
sequence_number);
|
||||
}
|
||||
|
||||
my_ctl_pointer->starting_flag_value += 1;
|
||||
|
||||
return BCOL_FN_COMPLETE;
|
||||
exit_ERROR:
|
||||
exit_ERROR:
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
#endif
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user