Using ompi_type_destroy to free ompi_datatype. This had to be updated in all the collective algorithms.
Hopefully this will fix all warnings. This commit was SVN r28385.
Этот коммит содержится в:
родитель
55decca2b7
Коммит
c902624b59
@ -824,6 +824,8 @@
|
||||
free (global_buf);
|
||||
global_buf = NULL;
|
||||
}
|
||||
for (i = 0; i < fh->f_procs_per_group; i++)
|
||||
ompi_datatype_destroy(sendtype+i);
|
||||
if (NULL != sendtype){
|
||||
free(sendtype);
|
||||
sendtype=NULL;
|
||||
|
@ -745,10 +745,9 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
|
||||
MPI_BYTE,
|
||||
&recvtype[i]);
|
||||
ompi_datatype_commit(&recvtype[i]);
|
||||
|
||||
ompi_datatype_type_size (recvtype[i],
|
||||
&datatype_size);
|
||||
|
||||
opal_datatype_type_size(&recvtype[i]->super,
|
||||
&datatype_size);
|
||||
|
||||
if (datatype_size){
|
||||
|
||||
@ -978,6 +977,8 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh,
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
for (i =0; i< fh->f_procs_per_group; i++)
|
||||
ompi_datatype_destroy(recvtype+i);
|
||||
if (NULL != recvtype){
|
||||
free(recvtype);
|
||||
recvtype=NULL;
|
||||
|
@ -849,6 +849,8 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
for (i = 0; i < fh->f_procs_per_group; i++)
|
||||
ompi_datatype_destroy(sendtype+i);
|
||||
if (NULL != sendtype){
|
||||
free(sendtype);
|
||||
sendtype=NULL;
|
||||
|
@ -887,6 +887,8 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
|
||||
free (fh->f_io_array);
|
||||
fh->f_io_array = NULL;
|
||||
}
|
||||
for (i = 0; i < fh->f_procs_per_group; i++)
|
||||
ompi_datatype_destroy(recvtype+i);
|
||||
if (NULL != recvtype){
|
||||
free(recvtype);
|
||||
recvtype=NULL;
|
||||
|
@ -518,13 +518,15 @@ static int two_phase_read_and_exch(mca_io_ompio_file_t *fh,
|
||||
int *partial_send=NULL, *start_pos=NULL, req_len=0, flag=0;
|
||||
int *recd_from_proc=NULL;
|
||||
MPI_Aint buftype_extent=0;
|
||||
int byte_size = 0;
|
||||
size_t byte_size = 0;
|
||||
OMPI_MPI_OFFSET_TYPE st_loc=-1, end_loc=-1, off=0, done=0, for_next_iter=0;
|
||||
OMPI_MPI_OFFSET_TYPE size=0, req_off=0, real_size=0, real_off=0, len=0;
|
||||
OMPI_MPI_OFFSET_TYPE for_curr_iter=0;
|
||||
char *read_buf=NULL, *tmp_buf=NULL;
|
||||
MPI_Datatype byte = MPI_BYTE;
|
||||
|
||||
MPI_Type_size(MPI_BYTE, &byte_size);
|
||||
opal_datatype_type_size(&byte->super,
|
||||
&byte_size);
|
||||
|
||||
for (i = 0; i < fh->f_size; i++){
|
||||
if (others_req[i].count) {
|
||||
@ -827,8 +829,7 @@ static int two_phase_exchange_data(mca_io_ompio_file_t *fh,
|
||||
int ret = OMPI_SUCCESS;
|
||||
char **recv_buf = NULL;
|
||||
MPI_Request *requests=NULL;
|
||||
// MPI_Datatype *send_type=NULL;
|
||||
ompi_datatype_t **send_type = NULL;
|
||||
MPI_Datatype send_type;
|
||||
|
||||
|
||||
|
||||
@ -846,7 +847,7 @@ static int two_phase_exchange_data(mca_io_ompio_file_t *fh,
|
||||
fh->f_comm->c_coll.coll_alltoall_module);
|
||||
|
||||
if ( OMPI_SUCCESS != ret ){
|
||||
return ret;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
||||
@ -891,10 +892,11 @@ static int two_phase_exchange_data(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
|
||||
recv_buf = (char **)malloc(fh->f_size * sizeof(char *));
|
||||
if (NULL == recv_buf){
|
||||
return OMPI_ERR_OUT_OF_RESOURCE;
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
for (i=0; i < fh->f_size; i++)
|
||||
@ -926,32 +928,23 @@ static int two_phase_exchange_data(mca_io_ompio_file_t *fh,
|
||||
others_req[i].lens[k] = partial_send[i];
|
||||
}
|
||||
|
||||
send_type = (ompi_datatype_t **) malloc (sizeof(ompi_datatype_t *));
|
||||
if (NULL == send_type){
|
||||
ret = OMPI_ERR_OUT_OF_RESOURCE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
ompi_datatype_create_hindexed(count[i],
|
||||
&(others_req[i].lens[start_pos[i]]),
|
||||
&(others_req[i].mem_ptrs[start_pos[i]]),
|
||||
MPI_BYTE,
|
||||
send_type);
|
||||
&send_type);
|
||||
|
||||
ompi_datatype_commit(send_type);
|
||||
ompi_datatype_commit(&send_type);
|
||||
|
||||
ret = MCA_PML_CALL(isend(MPI_BOTTOM,
|
||||
1,
|
||||
send_type[0],
|
||||
send_type,
|
||||
i,
|
||||
fh->f_rank+i+100*iter,
|
||||
MCA_PML_BASE_SEND_STANDARD,
|
||||
fh->f_comm,
|
||||
requests+nprocs_recv+j));
|
||||
if (NULL != send_type){
|
||||
free(send_type);
|
||||
send_type = NULL;
|
||||
}
|
||||
ompi_datatype_destroy(&send_type);
|
||||
|
||||
if (partial_send[i]) others_req[i].lens[k] = tmp;
|
||||
j++;
|
||||
|
@ -577,7 +577,7 @@ static int two_phase_exch_and_write(mca_io_ompio_file_t *fh,
|
||||
MPI_Aint buftype_extent;
|
||||
int hole;
|
||||
size_t byte_size;
|
||||
|
||||
MPI_Datatype byte = MPI_BYTE;
|
||||
#if DEBUG_ON
|
||||
int ii,jj;
|
||||
#endif
|
||||
@ -585,7 +585,8 @@ static int two_phase_exch_and_write(mca_io_ompio_file_t *fh,
|
||||
char *write_buf=NULL;
|
||||
|
||||
|
||||
ompi_datatype_type_size(MPI_BYTE, &byte_size);
|
||||
opal_datatype_type_size(&byte->super,
|
||||
&byte_size);
|
||||
|
||||
for (i = 0; i < fh->f_size; i++){
|
||||
if (others_req[i].count) {
|
||||
@ -1149,11 +1150,13 @@ static int two_phase_exchage_data(mca_io_ompio_file_t *fh,
|
||||
}
|
||||
}
|
||||
|
||||
//for (i=0; i<nprocs_recv; i++) MPI_Type_free(recv_types+i);
|
||||
|
||||
for (i=0; i<nprocs_recv; i++) ompi_datatype_destroy(recv_types+i);
|
||||
if (NULL != recv_types){
|
||||
free(recv_types);
|
||||
recv_types = NULL;
|
||||
}
|
||||
|
||||
ret = ompi_request_wait_all (nprocs_send+nprocs_recv,
|
||||
requests,
|
||||
MPI_STATUS_IGNORE);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user