Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ompi/mca/common/ompio/common_ompio_file_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
* Copyright (c) 2008-2019 University of Houston. All rights reserved.
* Copyright (c) 2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand All @@ -34,6 +36,7 @@
#include "ompi/mca/io/ompio/io_ompio_request.h"
#include "math.h"
#include <unistd.h>
#include <math.h>

/* Read and write routines are split into two interfaces.
** The
Expand Down Expand Up @@ -99,8 +102,8 @@ int mca_common_ompio_file_read (mca_io_ompio_file_t *fh,
else {
bytes_per_cycle = mca_io_ompio_cycle_buffer_size;
}
cycles = ceil((float)max_data/bytes_per_cycle);

cycles = ceil((double)max_data/bytes_per_cycle);
#if 0
printf ("Bytes per Cycle: %d Cycles: %d max_data:%d \n",bytes_per_cycle, cycles, max_data);
#endif
Expand Down
7 changes: 4 additions & 3 deletions ompi/mca/common/ompio/common_ompio_file_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
* Copyright (c) 2015-2017 Research Organization for Information Science
* Copyright (c) 2008-2019 University of Houston. All rights reserved.
* Copyright (c) 2015-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* $COPYRIGHT$
*
Expand All @@ -34,6 +34,7 @@
#include "ompi/mca/io/ompio/io_ompio_request.h"
#include "math.h"
#include <unistd.h>
#include <math.h>

int mca_common_ompio_file_write (mca_io_ompio_file_t *fh,
const void *buf,
Expand Down Expand Up @@ -76,7 +77,7 @@ int mca_common_ompio_file_write (mca_io_ompio_file_t *fh,
else {
bytes_per_cycle = mca_io_ompio_cycle_buffer_size;
}
cycles = ceil((float)max_data/bytes_per_cycle);
cycles = ceil((double)max_data/bytes_per_cycle);

#if 0
printf ("Bytes per Cycle: %d Cycles: %d\n", bytes_per_cycle, cycles);
Expand Down
11 changes: 7 additions & 4 deletions ompi/mca/io/ompio/io_ompio_aggregators.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,12 @@ int mca_io_ompio_split_initial_groups(mca_io_ompio_file_t *fh,
int size_smallest_group = 0;
int num_groups = 0;
int ret = OMPI_SUCCESS;

OMPI_MPI_OFFSET_TYPE max_cci = 0;
OMPI_MPI_OFFSET_TYPE min_cci = 0;

size_new_group = ceil ((float)mca_io_ompio_bytes_per_agg * fh->f_init_procs_per_group/ bytes_per_group);
// integer round up
size_new_group = (int)(mca_io_ompio_bytes_per_agg / bytes_per_group + (mca_io_ompio_bytes_per_agg % bytes_per_group ? 1u : 0u));
size_old_group = fh->f_init_procs_per_group;

ret = mca_io_ompio_split_a_group(fh,
Expand Down Expand Up @@ -790,7 +791,7 @@ int mca_io_ompio_split_initial_groups(mca_io_ompio_file_t *fh,
if((max_cci < OMPIO_CONTG_THRESHOLD) &&
(size_new_group < size_old_group)){

size_new_group = floor( (float) (size_new_group + size_old_group ) / 2 );
size_new_group = (size_new_group + size_old_group ) / 2;
ret = mca_io_ompio_split_a_group(fh,
start_offsets_lens,
end_offsets,
Expand Down Expand Up @@ -818,7 +819,9 @@ int mca_io_ompio_split_initial_groups(mca_io_ompio_file_t *fh,
(size_new_group < size_old_group)){ //can be a better condition
//monitor the previous iteration
//break if it has not changed.
size_new_group = ceil( (float) (size_new_group + size_old_group ) / 2 );
size_new_group = size_new_group + size_old_group;
// integer round up
size_new_group = size_new_group / 2 + (size_new_group % 2 ? 1 : 0);
ret = mca_io_ompio_split_a_group(fh,
start_offsets_lens,
end_offsets,
Expand Down