1
1

minor change in bml_r2_add_procs: the memory for the bml_endpoints structure

has to be allocated outside of the routine. Thus, the update version of pml/ob1/oml_ob1.c

This commit was SVN r7739.
Этот коммит содержится в:
Edgar Gabriel 2005-10-12 20:59:25 +00:00
родитель 3e5ad3e681
Коммит 5d7fbd9d2e
2 изменённых файлов: 15 добавлений и 3 удалений

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

@ -171,9 +171,7 @@ int mca_bml_r2_add_procs(
new_procs = (struct ompi_proc_t **)
malloc(nprocs * sizeof(struct ompi_proc_t *));
bml_endpoints = (struct mca_bml_base_endpoint_t **)
malloc(nprocs * sizeof(struct mca_bml_base_endpoint_t*));
if (NULL == new_procs || NULL == bml_endpoints) {
if (NULL == new_procs ) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
memset(bml_endpoints, 0, nprocs * sizeof(struct mca_bml_base_endpoint_t*));
@ -190,6 +188,10 @@ int mca_bml_r2_add_procs(
new_procs[n_new_procs++] = proc;
}
}
if ( 0 == n_new_procs ) {
return OMPI_SUCCESS;
}
procs = new_procs;
nprocs = n_new_procs;

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

@ -120,6 +120,12 @@ int mca_pml_ob1_add_procs(ompi_proc_t** procs, size_t nprocs)
if(OMPI_SUCCESS != rc)
return rc;
bml_endpoints = (struct mca_bml_base_endpoint_t **) malloc ( nprocs *
sizeof(struct mca_bml_base_endpoint_t*));
if ( NULL == bml_endpoints ) {
return OMPI_ERR_OUT_OF_RESOURCE;
}
rc = mca_bml.bml_add_procs(
nprocs,
procs,
@ -143,6 +149,10 @@ int mca_pml_ob1_add_procs(ompi_proc_t** procs, size_t nprocs)
mca_pml_ob1.free_list_max,
mca_pml_ob1.free_list_inc,
NULL);
if ( NULL != bml_endpoints ) {
free ( bml_endpoints) ;
}
return rc;
}