add buffer allocation and deallocation calls to the allreduce routine, so
I can start debugging the memory management code. The allreduce fucntion does nothing at this stage. This commit was SVN r17466.
Этот коммит содержится в:
родитель
be2579467a
Коммит
9b0687e6df
@ -282,6 +282,15 @@ BEGIN_C_DECLS
|
||||
mca_coll_sm2_nb_request_process_private_mem_t *request,
|
||||
struct mca_coll_base_module_1_1_0_t *module);
|
||||
|
||||
/* allocate working buffer */
|
||||
char *alloc_sm2_shared_buffer(mca_coll_sm2_module_t *module);
|
||||
|
||||
/* free working buffer - it is assumed that buffers are released in
|
||||
* the order they are allocated. We can assume this because each
|
||||
* communiator will have only one outstanding collective at a given
|
||||
* time, and we ensure that operations are completed in order. */
|
||||
int free_sm2_shared_buffer(mca_coll_sm2_module_t *module);
|
||||
|
||||
/**
|
||||
* Macro to setup flag usage
|
||||
*/
|
||||
|
@ -25,13 +25,18 @@ int mca_coll_sm2_allreduce_intra(void *sbuf, void *rbuf, int count,
|
||||
struct mca_coll_base_module_1_1_0_t *module)
|
||||
{
|
||||
/* local variables */
|
||||
int ret;
|
||||
int rc;
|
||||
char *sm_buffer;
|
||||
mca_coll_sm2_module_t *sm_module;
|
||||
|
||||
sm_module=(mca_coll_sm2_module_t *) module;
|
||||
|
||||
/* get a pointer to the shared-memory working buffer */
|
||||
sm_buffer=alloc_sm2_shared_buffer(sm_module);
|
||||
if( NULL == sm_buffer) {
|
||||
rc=OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto Error;
|
||||
}
|
||||
|
||||
if( 0 != (op->o_flags & OMPI_OP_FLAGS_COMMUTE)) {
|
||||
/* Commutative Operation */
|
||||
@ -39,7 +44,14 @@ int mca_coll_sm2_allreduce_intra(void *sbuf, void *rbuf, int count,
|
||||
/* Non-Commutative Operation */
|
||||
}
|
||||
|
||||
/* "free" the shared-memory working buffer */
|
||||
rc=alloc_sm2_shared_buffer(sm_module);
|
||||
if( OMPI_SUCCESS != rc ) {
|
||||
goto Error;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
|
||||
|
||||
Error:
|
||||
return rc;
|
||||
}
|
||||
|
@ -130,6 +130,9 @@ static int sm2_open(void)
|
||||
/* set component priority */
|
||||
cs->sm2_priority=
|
||||
mca_coll_sm2_param_register_int("sm_priority",0);
|
||||
/* debug */
|
||||
fprintf(stderr," DDDD cs->sm2_priority %d \n",cs->sm2_priority);
|
||||
/* end debub */
|
||||
|
||||
/* set control region size (bytes), per proc */
|
||||
cs->sm2_ctl_size_per_proc=
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user