1
1
This commit was SVN r17664.
Этот коммит содержится в:
Rich Graham 2008-02-29 03:55:12 +00:00
родитель 1632d8b299
Коммит c253a7bda1

Просмотреть файл

@ -198,200 +198,101 @@ int mca_coll_sm2_allreduce_intra_fanin_fanout(void *sbuf, void *rbuf, int count,
* stage help reduce memory contention. * stage help reduce memory contention.
*/ */
if( ROOT_NODE == my_fanout_read_tree->my_node_type ) { if( ROOT_NODE == my_fanout_read_tree->my_node_type ) {
if( 0 == my_fanout_read_tree->n_parents ) { /* I am the root - so copy signal children, and then
/* I am the root - so copy signal children, and then * start reading
* start reading */
*/ MB();
MB(); my_ctl_pointer->flag=-tag;
my_ctl_pointer->flag=-tag;
/* copy data to user supplied buffer */
/* copy data to user supplied buffer */ rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe, (char *)((char *)rbuf+dt_extent*count_processed),
(char *)((char *)rbuf+dt_extent*count_processed), (char *)my_data_pointer);
(char *)my_data_pointer); if( 0 != rc ) {
if( 0 != rc ) { return OMPI_ERROR;
return OMPI_ERROR;
}
} else {
parent_base_temp_pointer=(char *)
((char *)sm_buffer+my_fanout_parent*
sm_module->segement_size_per_process);
parent_data_pointer=(volatile char *)
((char *)parent_base_temp_pointer+ctl_size);
parent_ctl_pointer=(volatile
mca_coll_sm2_nb_request_process_shared_mem_t *)
parent_base_temp_pointer;
child_ctl_pointer=
(volatile mca_coll_sm2_nb_request_process_shared_mem_t *)
parent_data_pointer;
/*
* wait on Parent to signal that data is ready
*/
while(!
( (parent_ctl_pointer->flag == -tag) &
(parent_ctl_pointer->index== stripe_number) ) ) {
/* Note: Actually need to make progress here */
;
}
/* copy the data to my shared buffer, for access by children */
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
(char *)my_data_pointer,(char *)parent_data_pointer);
if( 0 != rc ) {
return OMPI_ERROR;
}
/* set memory barriet to make sure data is in main memory before
* the completion flgas are set.
*/
MB();
/* signal children that they may read the result data */
my_ctl_pointer->flag=-tag;
/* copy data to user supplied buffer */
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
(char *)rbuf+dt_extent*count_processed,
(char *)my_data_pointer);
if( 0 != rc ) {
return OMPI_ERROR;
}
} }
} else if( LEAF_NODE == my_fanout_read_tree->my_node_type ) { } else if( LEAF_NODE == my_fanout_read_tree->my_node_type ) {
if( 0 == my_fanout_read_tree->n_parents ) {
/* I am the root - so copy signal children, and then
* start reading
*/
MB();
my_ctl_pointer->flag=-tag;
/* copy data to user supplied buffer */ parent_base_temp_pointer=(char *)
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe, ((char *)sm_buffer+my_fanout_parent*
(char *)((char *)rbuf+dt_extent*count_processed), sm_module->segement_size_per_process);
(char *)my_data_pointer);
if( 0 != rc ) { parent_data_pointer=(volatile char *)
return OMPI_ERROR; ((char *)parent_base_temp_pointer+ctl_size);
} parent_ctl_pointer=(volatile
mca_coll_sm2_nb_request_process_shared_mem_t *)
} else { parent_base_temp_pointer;
parent_base_temp_pointer=(char *)
((char *)sm_buffer+my_fanout_parent* child_ctl_pointer=
sm_module->segement_size_per_process); (volatile mca_coll_sm2_nb_request_process_shared_mem_t *)
parent_data_pointer;
parent_data_pointer=(volatile char *) /*
((char *)parent_base_temp_pointer+ctl_size); * wait on Parent to signal that data is ready
parent_ctl_pointer=(volatile */
mca_coll_sm2_nb_request_process_shared_mem_t *) while(!
parent_base_temp_pointer; ( (parent_ctl_pointer->flag == -tag) &
(parent_ctl_pointer->index== stripe_number) ) ) {
child_ctl_pointer= /* Note: Actually need to make progress here */
(volatile mca_coll_sm2_nb_request_process_shared_mem_t *) ;
parent_data_pointer;
/*
* wait on Parent to signal that data is ready
*/
while(!
( (parent_ctl_pointer->flag == -tag) &
(parent_ctl_pointer->index== stripe_number) ) ) {
/* Note: Actually need to make progress here */
;
}
/* copy the data to my shared buffer, for access by children */
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
(char *)my_data_pointer,(char *)parent_data_pointer);
if( 0 != rc ) {
return OMPI_ERROR;
}
/* set memory barriet to make sure data is in main memory before
* the completion flgas are set.
*/
MB();
/* signal children that they may read the result data */
my_ctl_pointer->flag=-tag;
/* copy data to user supplied buffer */
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
(char *)rbuf+dt_extent*count_processed,
(char *)my_data_pointer);
if( 0 != rc ) {
return OMPI_ERROR;
}
} }
/* copy data to user supplied buffer */
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
(char *)rbuf+dt_extent*count_processed,
(char *)parent_data_pointer);
if( 0 != rc ) {
return OMPI_ERROR;
}
} else { } else {
/* interior nodes */ /* interior nodes */
if( 0 == my_fanout_read_tree->n_parents ) { parent_base_temp_pointer=(char *)
/* I am the root - so copy signal children, and then ((char *)sm_buffer+my_fanout_parent*
* start reading sm_module->segement_size_per_process);
*/
MB(); parent_data_pointer=(volatile char *)
my_ctl_pointer->flag=-tag; ((char *)parent_base_temp_pointer+ctl_size);
parent_ctl_pointer=(volatile
/* copy data to user supplied buffer */ mca_coll_sm2_nb_request_process_shared_mem_t *)
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe, parent_base_temp_pointer;
(char *)((char *)rbuf+dt_extent*count_processed),
(char *)my_data_pointer); child_ctl_pointer=
if( 0 != rc ) { (volatile mca_coll_sm2_nb_request_process_shared_mem_t *)
return OMPI_ERROR; parent_data_pointer;
}
} else {
parent_base_temp_pointer=(char *)
((char *)sm_buffer+my_fanout_parent*
sm_module->segement_size_per_process);
parent_data_pointer=(volatile char *) /*
((char *)parent_base_temp_pointer+ctl_size); * wait on Parent to signal that data is ready
parent_ctl_pointer=(volatile */
mca_coll_sm2_nb_request_process_shared_mem_t *) while(!
parent_base_temp_pointer; ( (parent_ctl_pointer->flag == -tag) &
(parent_ctl_pointer->index== stripe_number) ) ) {
child_ctl_pointer= /* Note: Actually need to make progress here */
(volatile mca_coll_sm2_nb_request_process_shared_mem_t *) ;
parent_data_pointer; }
/* /* copy the data to my shared buffer, for access by children */
* wait on Parent to signal that data is ready rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
*/ (char *)my_data_pointer,(char *)parent_data_pointer);
while(! if( 0 != rc ) {
( (parent_ctl_pointer->flag == -tag) & return OMPI_ERROR;
(parent_ctl_pointer->index== stripe_number) ) ) { }
/* Note: Actually need to make progress here */
; /* set memory barriet to make sure data is in main memory before
} * the completion flgas are set.
*/
/* copy the data to my shared buffer, for access by children */ MB();
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
(char *)my_data_pointer,(char *)parent_data_pointer); /* signal children that they may read the result data */
if( 0 != rc ) { my_ctl_pointer->flag=-tag;
return OMPI_ERROR;
} /* copy data to user supplied buffer */
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
/* set memory barriet to make sure data is in main memory before (char *)rbuf+dt_extent*count_processed,
* the completion flgas are set. (char *)my_data_pointer);
*/ if( 0 != rc ) {
MB(); return OMPI_ERROR;
/* signal children that they may read the result data */
my_ctl_pointer->flag=-tag;
/* copy data to user supplied buffer */
rc=ompi_ddt_copy_content_same_ddt(dtype, count_this_stripe,
(char *)rbuf+dt_extent*count_processed,
(char *)my_data_pointer);
if( 0 != rc ) {
return OMPI_ERROR;
}
} }
} }