Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
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
12 changes: 6 additions & 6 deletions ompi/mca/fcoll/static/fcoll_static_file_read_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights reserved.
*
* $COPYRIGHT$
Expand Down Expand Up @@ -482,15 +482,15 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh,
}
}

if (local_cycles > index) {
if ((index == local_cycles-1) && (max_data % bytes_per_cycle)) {
bytes_to_read_in_cycle = max_data % bytes_per_cycle;
if (index < local_cycles ) {
if ((index == local_cycles-1) && (max_data % (bytes_per_cycle/fh->f_procs_per_group))) {
bytes_to_read_in_cycle = max_data - position;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix looks good to me. Just a small suggestion,
Use total_bytes_read instead of position? I am verifying the patch now locally

Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran the write_all test with static fcoll. This test passed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @vvenkates27. Regarding the variable name, I think there is a slight disparity between the write_all and read_all functions, in read_all there is no total_bytes_read, but the same content is stored in the - position - variable. Probably historic reasons for that.

}
else if (max_data <= bytes_per_cycle) {
else if (max_data <= bytes_per_cycle/fh->f_procs_per_group) {
bytes_to_read_in_cycle = max_data;
}
else {
bytes_to_read_in_cycle = bytes_per_cycle;
bytes_to_read_in_cycle = bytes_per_cycle/fh->f_procs_per_group;
}
}
else {
Expand Down
16 changes: 7 additions & 9 deletions ompi/mca/fcoll/static/fcoll_static_file_write_all.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2015 University of Houston. All rights reserved.
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
Expand Down Expand Up @@ -469,15 +469,15 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
}

}
if (local_cycles > index) {
if ((index == local_cycles-1) && (max_data % bytes_per_cycle)) {
bytes_to_write_in_cycle = max_data % bytes_per_cycle;
if ( index < local_cycles ) {
if ((index == local_cycles-1) && (max_data % (bytes_per_cycle/fh->f_procs_per_group)) ) {
bytes_to_write_in_cycle = max_data - total_bytes_written;
}
else if (max_data <= bytes_per_cycle) {
else if (max_data <= bytes_per_cycle/fh->f_procs_per_group) {
bytes_to_write_in_cycle = max_data;
}
else {
bytes_to_write_in_cycle = bytes_per_cycle;
bytes_to_write_in_cycle = bytes_per_cycle/ fh->f_procs_per_group;
}
}
else {
Expand Down Expand Up @@ -527,8 +527,6 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
*/
if (my_aggregator == fh->f_rank) {
for (i=0;i<fh->f_procs_per_group; i++){
/* printf("bytes_per_process[%d]: %d\n", i, bytes_per_process[i]);
*/

#if DEBUG_ON
printf ("%d : bytes_per_process : %d\n",
Expand Down Expand Up @@ -835,7 +833,7 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh,
MCA_PML_BASE_SEND_STANDARD,
fh->f_comm,
&send_req));

if ( OMPI_SUCCESS != ret ){
fprintf(stderr,"isend error!\n");
goto exit;
Expand Down