Merge pull request #1882 from edgargabriel/pr/coverty-fixes
fcoll/static and io/ompio: fix coverty warnings
Этот коммит содержится в:
Коммит
2170eee5b7
@ -275,14 +275,14 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
|
||||
|
||||
iovec_count_per_process = (int *) malloc (fh->f_procs_per_group * sizeof(int));
|
||||
iovec_count_per_process = (int *) calloc (fh->f_procs_per_group, sizeof(int));
|
||||
if (NULL == iovec_count_per_process){
|
||||
opal_output (1, "OUT OF MEMORY\n");
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
displs = (int *) malloc (fh->f_procs_per_group * sizeof(int));
|
||||
displs = (int *) calloc (fh->f_procs_per_group, sizeof(int));
|
||||
if (NULL == displs){
|
||||
opal_output (1, "OUT OF MEMORY\n");
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
|
@ -278,14 +278,14 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
|
||||
}
|
||||
}
|
||||
|
||||
iovec_count_per_process = (int *) malloc (fh->f_procs_per_group * sizeof(int));
|
||||
iovec_count_per_process = (int *) calloc (fh->f_procs_per_group, sizeof(int));
|
||||
if (NULL == iovec_count_per_process){
|
||||
opal_output (1, "OUT OF MEMORY\n");
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
displs = (int *) malloc (fh->f_procs_per_group * sizeof(int));
|
||||
displs = (int *) calloc (fh->f_procs_per_group, sizeof(int));
|
||||
if (NULL == displs){
|
||||
opal_output (1, "OUT OF MEMORY\n");
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
@ -1050,6 +1050,11 @@ exit:
|
||||
sorted = NULL;
|
||||
}
|
||||
|
||||
if (NULL != displs) {
|
||||
free(displs);
|
||||
displs = NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1864,7 +1864,7 @@ int mca_io_ompio_merge_groups(mca_io_ompio_file_t *fh,
|
||||
{
|
||||
int i = 0;
|
||||
int *sizes_old_group;
|
||||
|
||||
int ret = OMPI_SUCCESS;
|
||||
int *displs;
|
||||
|
||||
|
||||
@ -1886,17 +1886,22 @@ int mca_io_ompio_merge_groups(mca_io_ompio_file_t *fh,
|
||||
|
||||
//merge_aggrs[0] is considered the new aggregator
|
||||
//New aggregator collects group sizes of the groups to be merged
|
||||
fcoll_base_coll_allgather_array (&fh->f_init_procs_per_group,
|
||||
1,
|
||||
MPI_INT,
|
||||
sizes_old_group,
|
||||
1,
|
||||
MPI_INT,
|
||||
0,
|
||||
merge_aggrs,
|
||||
num_merge_aggrs,
|
||||
fh->f_comm);
|
||||
ret = fcoll_base_coll_allgather_array (&fh->f_init_procs_per_group,
|
||||
1,
|
||||
MPI_INT,
|
||||
sizes_old_group,
|
||||
1,
|
||||
MPI_INT,
|
||||
0,
|
||||
merge_aggrs,
|
||||
num_merge_aggrs,
|
||||
fh->f_comm);
|
||||
|
||||
if ( OMPI_SUCCESS != ret ) {
|
||||
free (displs);
|
||||
free (sizes_old_group);
|
||||
return ret;
|
||||
}
|
||||
fh->f_procs_per_group = 0;
|
||||
|
||||
|
||||
@ -1920,23 +1925,22 @@ int mca_io_ompio_merge_groups(mca_io_ompio_file_t *fh,
|
||||
//New aggregator also collects the grouping distribution
|
||||
//This is the actual merge
|
||||
//use allgatherv array
|
||||
fcoll_base_coll_allgatherv_array (fh->f_init_procs_in_group,
|
||||
fh->f_init_procs_per_group,
|
||||
MPI_INT,
|
||||
fh->f_procs_in_group,
|
||||
sizes_old_group,
|
||||
displs,
|
||||
MPI_INT,
|
||||
0,
|
||||
merge_aggrs,
|
||||
num_merge_aggrs,
|
||||
fh->f_comm);
|
||||
ret = fcoll_base_coll_allgatherv_array (fh->f_init_procs_in_group,
|
||||
fh->f_init_procs_per_group,
|
||||
MPI_INT,
|
||||
fh->f_procs_in_group,
|
||||
sizes_old_group,
|
||||
displs,
|
||||
MPI_INT,
|
||||
0,
|
||||
merge_aggrs,
|
||||
num_merge_aggrs,
|
||||
fh->f_comm);
|
||||
|
||||
|
||||
free(displs);
|
||||
free (displs);
|
||||
free (sizes_old_group);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user