Skip to content

Commit 2c61074

Browse files
committed
dynamic_gen2: code cleanup
remove now unused mca parameter, get rid of an unnecesary if-else part, and move setting the flag outside of the while loop. Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu>
1 parent d65480d commit 2c61074

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
12+
* Copyright (c) 2008-2020 University of Houston. All rights reserved.
1313
* Copyright (c) 2015-2018 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* $COPYRIGHT$
@@ -36,7 +36,6 @@ BEGIN_C_DECLS
3636

3737
extern int mca_fcoll_dynamic_gen2_priority;
3838
extern int mca_fcoll_dynamic_gen2_num_groups;
39-
extern int mca_fcoll_dynamic_gen2_write_chunksize;
4039

4140
OMPI_MODULE_DECLSPEC extern mca_fcoll_base_component_2_0_0_t mca_fcoll_dynamic_gen2_component;
4241

ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_component.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Copyright (c) 2004-2005 The Regents of the University of California.
1212
* All rights reserved.
1313
* Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
14-
* Copyright (c) 2008-2016 University of Houston. All rights reserved.
14+
* Copyright (c) 2008-2020 University of Houston. All rights reserved.
1515
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
1616
* reserved.
1717
* $COPYRIGHT$
@@ -42,7 +42,6 @@ const char *mca_fcoll_dynamic_gen2_component_version_string =
4242
*/
4343
int mca_fcoll_dynamic_gen2_priority = 10;
4444
int mca_fcoll_dynamic_gen2_num_groups = 1;
45-
int mca_fcoll_dynamic_gen2_write_chunksize = -1;
4645

4746
/*
4847
* Local function
@@ -95,12 +94,5 @@ dynamic_gen2_register(void)
9594
OPAL_INFO_LVL_9,
9695
MCA_BASE_VAR_SCOPE_READONLY, &mca_fcoll_dynamic_gen2_num_groups);
9796

98-
mca_fcoll_dynamic_gen2_write_chunksize = -1;
99-
(void) mca_base_component_var_register(&mca_fcoll_dynamic_gen2_component.fcollm_version,
100-
"write_chunksize", "Chunk size written at once. Default: stripe_size of the file system",
101-
MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
102-
OPAL_INFO_LVL_9,
103-
MCA_BASE_VAR_SCOPE_READONLY, &mca_fcoll_dynamic_gen2_write_chunksize);
104-
10597
return OMPI_SUCCESS;
10698
}

ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -736,14 +736,13 @@ static int write_init (ompio_file_t *fh, int aggregator, mca_io_ompio_aggregator
736736

737737

738738
if ( aggregator == fh->f_rank && aggr_data->prev_num_io_entries) {
739+
fh->f_flags |= OMPIO_COLLECTIVE_OP;
739740
while ( aggr_data->prev_bytes_to_write > 0 ) {
740741
ssize_t tret;
741742
aggr_data->prev_bytes_to_write -= mca_fcoll_dynamic_gen2_split_iov_array (fh, aggr_data->prev_io_array,
742743
aggr_data->prev_num_io_entries,
743744
&last_array_pos, &last_pos );
744-
fh->f_flags |= OMPIO_COLLECTIVE_OP;
745745
tret = fh->f_fbtl->fbtl_pwritev (fh);
746-
fh->f_flags &= ~OMPIO_COLLECTIVE_OP;
747746
if ( 0 > tret ) {
748747
free ( aggr_data->prev_io_array);
749748
opal_output (1, "dynamic_gen2_write_all: fbtl_pwritev failed\n");
@@ -766,6 +765,7 @@ static int write_init (ompio_file_t *fh, int aggregator, mca_io_ompio_aggregator
766765
fh->f_io_array[n].length);
767766
#endif
768767
}
768+
fh->f_flags &= ~OMPIO_COLLECTIVE_OP;
769769
free ( fh->f_io_array );
770770
free ( aggr_data->prev_io_array);
771771
}
@@ -1643,12 +1643,7 @@ int mca_fcoll_dynamic_gen2_split_iov_array ( ompio_file_t *fh, mca_common_ompio_
16431643

16441644
if ( pos == (int)io_array[array_pos].length ) {
16451645
pos = 0;
1646-
if ((array_pos + 1) < num_entries) {
1647-
array_pos++;
1648-
}
1649-
else {
1650-
break;
1651-
}
1646+
array_pos++;
16521647
}
16531648
} while ( (array_pos < num_entries) && (((off_t)io_array[array_pos].offset+pos ) < endaddr) );
16541649

0 commit comments

Comments
 (0)