From ce8f8f08297d474ef1abf785ff2e7a9382835562 Mon Sep 17 00:00:00 2001 From: Vishwanath Venkatesan Date: Wed, 17 Jul 2013 19:16:53 +0000 Subject: [PATCH] Changing the MPI Datatype from MPI_LONG to OMPI_OFFSET_DATATYPE for send/recv offsets This commit was SVN r28822. --- .../two_phase/fcoll_two_phase_file_read_all.c | 8 ++++---- .../two_phase/fcoll_two_phase_file_write_all.c | 14 +++++++------- .../fcoll/two_phase/fcoll_two_phase_support_fns.c | 10 +++------- 3 files changed, 14 insertions(+), 18 deletions(-) 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 5184820e73..afbdd10e58 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 @@ -318,10 +318,10 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh, ret = fh->f_comm->c_coll.coll_allgather(&start_offset, 1, - MPI_LONG, + OMPI_OFFSET_DATATYPE, start_offsets, 1, - MPI_LONG, + OMPI_OFFSET_DATATYPE, fh->f_comm, fh->f_comm->c_coll.coll_allgather_module); @@ -331,10 +331,10 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh, ret = fh->f_comm->c_coll.coll_allgather(&end_offset, 1, - MPI_LONG, + OMPI_OFFSET_DATATYPE, end_offsets, 1, - MPI_LONG, + OMPI_OFFSET_DATATYPE, fh->f_comm, fh->f_comm->c_coll.coll_allgather_module); 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 d0dc96fc6a..231cef3274 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 @@ -334,8 +334,8 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, #endif - start_offset = (OMPI_MPI_OFFSET_TYPE)(intptr_t)iov[0].iov_base; - end_offset = (OMPI_MPI_OFFSET_TYPE)(intptr_t)iov[local_count-1].iov_base + + start_offset = (OMPI_MPI_OFFSET_TYPE)(uintptr_t)iov[0].iov_base; + end_offset = (OMPI_MPI_OFFSET_TYPE)(uintptr_t)iov[local_count-1].iov_base + (OMPI_MPI_OFFSET_TYPE)iov[local_count-1].iov_len - 1; #if DEBUG_ON @@ -365,10 +365,10 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, ret = fh->f_comm->c_coll.coll_allgather(&start_offset, 1, - MPI_LONG, + OMPI_OFFSET_DATATYPE, start_offsets, 1, - MPI_LONG, + OMPI_OFFSET_DATATYPE, fh->f_comm, fh->f_comm->c_coll.coll_allgather_module); @@ -379,10 +379,10 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, ret = fh->f_comm->c_coll.coll_allgather(&end_offset, 1, - MPI_LONG, + OMPI_OFFSET_DATATYPE, end_offsets, 1, - MPI_LONG, + OMPI_OFFSET_DATATYPE, fh->f_comm, fh->f_comm->c_coll.coll_allgather_module); @@ -781,7 +781,7 @@ static int two_phase_exch_and_write(mca_io_ompio_file_t *fh, printf("rank : %d enters writing\n", fh->f_rank); printf("size : %ld, off : %ld\n",size, off); for (ii=0, jj=0;jjf_rank, ii,((int *)write_buf[jj])); + printf("%d : write_buf[%d]: %d\n", fh->f_rank, ii,((int *)write_buf[jj])); } #endif len = size * byte_size; diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_support_fns.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_support_fns.c index e596c4c513..88176bb01b 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_support_fns.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_support_fns.c @@ -45,8 +45,6 @@ int mca_fcoll_two_phase_domain_partition (mca_io_ompio_file_t *fh, if (fd_size < min_fd_size) fd_size = min_fd_size; -/* printf("fd_size :%lld, min_fd_size : %d\n", fd_size, min_fd_size);*/ - *fd_st_ptr = (OMPI_MPI_OFFSET_TYPE *) malloc(nprocs_for_coll*sizeof(OMPI_MPI_OFFSET_TYPE)); @@ -67,12 +65,10 @@ int mca_fcoll_two_phase_domain_partition (mca_io_ompio_file_t *fh, if (striping_unit > 0){ - - /* Lock Boundary based domain partitioning */ + /* Lock Boundary based domain partitioning */ int rem_front, rem_back; OMPI_MPI_OFFSET_TYPE end_off; - printf("striping unit based partitioning!\n "); fd_start[0] = min_st_offset; end_off = fd_start[0] + fd_size; rem_front = end_off % striping_unit; @@ -247,7 +243,7 @@ int mca_fcoll_two_phase_calc_others_requests(mca_io_ompio_file_t *fh, if (others_req[i].count){ ret = MCA_PML_CALL(irecv(others_req[i].offsets, others_req[i].count, - MPI_LONG, + OMPI_OFFSET_DATATYPE, i, i+fh->f_rank, fh->f_comm, @@ -278,7 +274,7 @@ int mca_fcoll_two_phase_calc_others_requests(mca_io_ompio_file_t *fh, if (my_req[i].count) { ret = MCA_PML_CALL(isend(my_req[i].offsets, my_req[i].count, - MPI_LONG, + OMPI_OFFSET_DATATYPE, i, i+fh->f_rank, MCA_PML_BASE_SEND_STANDARD,