fix buffer management for nb-barrier.
This commit was SVN r18081.
Этот коммит содержится в:
родитель
5e6dc24e62
Коммит
1b54e8b76e
@ -28,6 +28,7 @@ sources = \
|
|||||||
coll_sm2_barrier.c \
|
coll_sm2_barrier.c \
|
||||||
coll_sm2_service.c
|
coll_sm2_service.c
|
||||||
|
|
||||||
|
|
||||||
# Make the output library in this directory, and name it either
|
# Make the output library in this directory, and name it either
|
||||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||||
# (for static builds).
|
# (for static builds).
|
||||||
|
@ -21,8 +21,6 @@
|
|||||||
extern uint64_t timers[7];
|
extern uint64_t timers[7];
|
||||||
end debug */
|
end debug */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shared memory blocking allreduce.
|
* Shared memory blocking allreduce.
|
||||||
*/
|
*/
|
||||||
|
@ -468,7 +468,6 @@ static int init_sm2_barrier(struct ompi_communicator_t *comm,
|
|||||||
module->sm2_size_management_region_per_proc*
|
module->sm2_size_management_region_per_proc*
|
||||||
module->sm_buffer_mgmt_barrier_tree.tree_size;
|
module->sm_buffer_mgmt_barrier_tree.tree_size;
|
||||||
|
|
||||||
|
|
||||||
/* set the pointer to the request that needs to be completed first */
|
/* set the pointer to the request that needs to be completed first */
|
||||||
module->current_request_index=0;
|
module->current_request_index=0;
|
||||||
|
|
||||||
@ -967,6 +966,7 @@ sm_work_buffer_t *alloc_sm2_shared_buffer(mca_coll_sm2_module_t *module)
|
|||||||
/* set request to inactive */
|
/* set request to inactive */
|
||||||
module->barrier_request[module->current_request_index].
|
module->barrier_request[module->current_request_index].
|
||||||
sm2_barrier_phase=NB_BARRIER_INACTIVE;
|
sm2_barrier_phase=NB_BARRIER_INACTIVE;
|
||||||
|
module->barrier_request[module->current_request_index].sm_index^=1;
|
||||||
/* move pointer to next request that needs to be completed */
|
/* move pointer to next request that needs to be completed */
|
||||||
module->current_request_index++;
|
module->current_request_index++;
|
||||||
/* wrap around */
|
/* wrap around */
|
||||||
@ -1018,6 +1018,9 @@ sm_work_buffer_t *alloc_sm2_shared_buffer(mca_coll_sm2_module_t *module)
|
|||||||
/* set request to inactive */
|
/* set request to inactive */
|
||||||
request->sm2_barrier_phase=NB_BARRIER_INACTIVE;
|
request->sm2_barrier_phase=NB_BARRIER_INACTIVE;
|
||||||
|
|
||||||
|
/* set barrier struct to be used next time */
|
||||||
|
request->sm_index^=1;
|
||||||
|
|
||||||
/* move pointer to next request that needs to be completed */
|
/* move pointer to next request that needs to be completed */
|
||||||
module->current_request_index++;
|
module->current_request_index++;
|
||||||
|
|
||||||
@ -1072,6 +1075,7 @@ int free_sm2_shared_buffer(mca_coll_sm2_module_t *module)
|
|||||||
/* set request to inactive */
|
/* set request to inactive */
|
||||||
module->barrier_request[module->current_request_index].
|
module->barrier_request[module->current_request_index].
|
||||||
sm2_barrier_phase=NB_BARRIER_INACTIVE;
|
sm2_barrier_phase=NB_BARRIER_INACTIVE;
|
||||||
|
module->barrier_request[module->current_request_index].sm_index^=1;
|
||||||
/* move pointer to next request that needs to be completed */
|
/* move pointer to next request that needs to be completed */
|
||||||
module->current_request_index++;
|
module->current_request_index++;
|
||||||
/* wrap around */
|
/* wrap around */
|
||||||
@ -1112,6 +1116,7 @@ int free_sm2_shared_buffer(mca_coll_sm2_module_t *module)
|
|||||||
if( NB_BARRIER_DONE == request->sm2_barrier_phase ) {
|
if( NB_BARRIER_DONE == request->sm2_barrier_phase ) {
|
||||||
/* set request to inactive */
|
/* set request to inactive */
|
||||||
request->sm2_barrier_phase=NB_BARRIER_INACTIVE;
|
request->sm2_barrier_phase=NB_BARRIER_INACTIVE;
|
||||||
|
request->sm_index^=1;
|
||||||
/* move pointer to next request that needs to be completed */
|
/* move pointer to next request that needs to be completed */
|
||||||
module->current_request_index++;
|
module->current_request_index++;
|
||||||
/* wrap around */
|
/* wrap around */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user