From 53753622d43a9c8cb2e59e89533d53f6909ed5d4 Mon Sep 17 00:00:00 2001 From: Vishwanath Venkatesan Date: Wed, 17 Apr 2013 21:06:36 +0000 Subject: [PATCH] Changing some of the MPI_ functions to ompi_ equivalents. This commit was SVN r28342. --- .../dynamic/fcoll_dynamic_file_write_all.c | 9 +++++---- .../two_phase/fcoll_two_phase_file_read_all.c | 16 ++++++++-------- .../fcoll_two_phase_file_write_all.c | 19 ++++++++++--------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c b/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c index cdc4b838ff..a766fe27ad 100644 --- a/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c +++ b/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c @@ -89,13 +89,14 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, /* array that contains the sorted indices of the global_iov */ int *sorted = NULL, *sorted_file_offsets=NULL; int *displs = NULL; - size_t max_data = 0; + size_t max_data = 0, datatype_size = 0; int **blocklen_per_process=NULL; MPI_Aint **displs_per_process=NULL, *memory_displacements=NULL; ompi_datatype_t **recvtype = NULL; MPI_Aint *total_bytes_per_process = NULL; MPI_Request *send_req=NULL, *recv_req=NULL; - int datatype_size, recv_req_count=0; + int recv_req_count=0; + #if TIME_BREAKDOWN double write_time = 0.0, start_write_time = 0.0, end_write_time = 0.0; @@ -745,8 +746,8 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, &recvtype[i]); ompi_datatype_commit(&recvtype[i]); - MPI_Type_size (recvtype[i], - &datatype_size); + ompi_datatype_type_size (recvtype[i], + &datatype_size); if (datatype_size){ diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c index e5605cfbc5..1277662247 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c @@ -616,7 +616,7 @@ static int two_phase_read_and_exch(mca_io_ompio_file_t *fh, off = st_loc; for_curr_iter = for_next_iter = 0; - MPI_Type_extent(datatype, &buftype_extent); + ompi_datatype_type_extent(datatype, &buftype_extent); for (m=0; mf_comm, requests+nprocs_recv+j)); - MPI_Type_free(&send_type); + free(&send_type); if (partial_send[i]) others_req[i].lens[k] = tmp; j++; } diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c index 9756734e60..356122fa2c 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c @@ -575,7 +575,8 @@ static int two_phase_exch_and_write(mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE st_loc=-1, end_loc=-1, off, done; OMPI_MPI_OFFSET_TYPE size=0, req_off, len; MPI_Aint buftype_extent; - int byte_size, hole; + int hole; + size_t byte_size; #if DEBUG_ON int ii,jj; @@ -584,7 +585,7 @@ static int two_phase_exch_and_write(mca_io_ompio_file_t *fh, char *write_buf=NULL; - MPI_Type_size(MPI_BYTE, &byte_size); + ompi_datatype_type_size(MPI_BYTE, &byte_size); for (i = 0; i < fh->f_size; i++){ if (others_req[i].count) { @@ -688,7 +689,7 @@ static int two_phase_exch_and_write(mca_io_ompio_file_t *fh, done = 0; off = st_loc; - MPI_Type_extent(datatype, &buftype_extent); + ompi_datatype_type_extent(datatype, &buftype_extent); for (m=0;m f_size; i++) count[i] = recv_size[i] = 0; @@ -965,11 +966,11 @@ static int two_phase_exchage_data(mca_io_ompio_file_t *fh, tmp_len[i] = others_req[i].lens[k]; others_req[i].lens[k] = partial_recv[i]; } - MPI_Type_hindexed(count[i], - &(others_req[i].lens[start_pos[i]]), - &(others_req[i].mem_ptrs[start_pos[i]]), - MPI_BYTE, recv_types+j); - MPI_Type_commit(recv_types+j); + ompi_datatype_create_hindexed(count[i], + &(others_req[i].lens[start_pos[i]]), + &(others_req[i].mem_ptrs[start_pos[i]]), + MPI_BYTE, recv_types+j); + ompi_datatype_commit(recv_types+j); j++; } } @@ -1143,7 +1144,7 @@ static int two_phase_exchage_data(mca_io_ompio_file_t *fh, } } - for (i=0; i