From 55878674d77813ce6008e937bda5953641c7eabb Mon Sep 17 00:00:00 2001 From: Vishwanath Venkatesan Date: Wed, 5 Jun 2013 21:30:15 +0000 Subject: [PATCH] 1. Removing the allgather_array based on the flag UNIFORM FVIEW. This is not really and optimization. 2. Fixing some of the debug printf's these are outdated. This commit was SVN r28591. --- .../dynamic/fcoll_dynamic_file_write_all.c | 64 +++++++------------ .../static/fcoll_static_file_write_all.c | 49 +++++--------- 2 files changed, 40 insertions(+), 73 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 a9f9062e25..9b8d5f74bb 100644 --- a/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c +++ b/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c @@ -143,6 +143,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, goto exit; } } + if (-1 == mca_fcoll_dynamic_num_io_procs) { mca_fcoll_dynamic_num_io_procs = 1; } @@ -195,13 +196,10 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, #if DEBUG_ON for (i=0 ; if_rank); - printf("%d: OFFSET: %p LENGTH: %lld\n", - fh->f_rank, - iov[i].iov_base, - iov[i].iov_len); + printf("%d: OFFSET: %d LENGTH: %ld\n", + fh->f_rank, + local_iov_array[i].iov_base, + local_iov_array[i].iov_len); } #endif @@ -247,6 +245,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, } #if DEBUG_ON + printf("total_fview_count : %d\n", total_fview_count); if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) { for (i=0 ; if_procs_per_group ; i++) { printf ("%d: PROCESS: %d ELEMENTS: %d DISPLS: %d\n", @@ -270,37 +269,20 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, } } - if (fh->f_flags & OMPIO_UNIFORM_FVIEW) { - - ret = ompi_io_ompio_allgather_array (local_iov_array, - local_count, - fh->f_iov_type, - global_iov_array, - local_count, - fh->f_iov_type, - fh->f_aggregator_index, - fh->f_procs_in_group, - fh->f_procs_per_group, - fh->f_comm); - if (OMPI_SUCCESS != ret){ - goto exit; - } - } - else { - ret = ompi_io_ompio_allgatherv_array (local_iov_array, - local_count, - fh->f_iov_type, - global_iov_array, - fview_count, - displs, - fh->f_iov_type, - fh->f_aggregator_index, - fh->f_procs_in_group, - fh->f_procs_per_group, - fh->f_comm); - if (OMPI_SUCCESS != ret){ - goto exit; - } + + ret = ompi_io_ompio_allgatherv_array (local_iov_array, + local_count, + fh->f_iov_type, + global_iov_array, + fview_count, + displs, + fh->f_iov_type, + fh->f_aggregator_index, + fh->f_procs_in_group, + fh->f_procs_per_group, + fh->f_comm); + if (OMPI_SUCCESS != ret){ + goto exit; } /* sort it */ @@ -331,8 +313,8 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, for (tv=0 ; tvf_rank, - global_iov_array[sorted[tv]].offset, - global_iov_array[sorted[tv]].length); + global_iov_array[sorted[tv]].iov_base, + global_iov_array[sorted[tv]].iov_len); } } #endif @@ -702,7 +684,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, index+1,fh->f_rank); for (i=0;if_procs_per_group; i++){ for(j=0;j 0){ + if (blocklen_per_process[i][j] > 0){ printf("%d sends blocklen[%d]: %d, disp[%d]: %ld to %d\n", fh->f_procs_in_group[i],j, blocklen_per_process[i][j],j, diff --git a/ompi/mca/fcoll/static/fcoll_static_file_write_all.c b/ompi/mca/fcoll/static/fcoll_static_file_write_all.c index fcb576edf6..5c13c634ad 100644 --- a/ompi/mca/fcoll/static/fcoll_static_file_write_all.c +++ b/ompi/mca/fcoll/static/fcoll_static_file_write_all.c @@ -163,15 +163,15 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, goto exit; } - /* printf("max_data %ld\n", max_data); */ - local_iov_array = (local_io_array *)malloc (iov_size * sizeof(local_io_array)); - if ( NULL == local_iov_array){ + if (0 != iov_size){ + local_iov_array = (local_io_array *)malloc (iov_size * sizeof(local_io_array)); + if ( NULL == local_iov_array){ fprintf(stderr,"local_iov_array allocation error\n"); ret = OMPI_ERR_OUT_OF_RESOURCE; goto exit; + } } - for (j=0; j < iov_size; j++){ local_iov_array[j].offset = (OMPI_MPI_OFFSET_TYPE)(intptr_t) iov[j].iov_base; @@ -307,35 +307,20 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, } } - if (fh->f_flags & OMPIO_UNIFORM_FVIEW) { - ret = ompi_io_ompio_gather_array (local_iov_array, - iov_size, - io_array_type, - global_iov_array, - iov_size, - io_array_type, - fh->f_aggregator_index, - fh->f_procs_in_group, - fh->f_procs_per_group, - fh->f_comm); - } - else { - ret = ompi_io_ompio_gatherv_array (local_iov_array, - iov_size, - io_array_type, - global_iov_array, - iovec_count_per_process, - displs, - io_array_type, - fh->f_aggregator_index, - fh->f_procs_in_group, - fh->f_procs_per_group, - fh->f_comm); - } - + ret = ompi_io_ompio_gatherv_array (local_iov_array, + iov_size, + io_array_type, + global_iov_array, + iovec_count_per_process, + displs, + io_array_type, + fh->f_aggregator_index, + fh->f_procs_in_group, + fh->f_procs_per_group, + fh->f_comm); if (OMPI_SUCCESS != ret){ - fprintf(stderr,"global_iov_array gather error!\n"); - goto exit; + fprintf(stderr,"global_iov_array gather error!\n"); + goto exit; } if (fh->f_procs_in_group[fh->f_aggregator_index] == fh->f_rank) {