10
10
* University of Stuttgart. All rights reserved.
11
11
* Copyright (c) 2004-2005 The Regents of the University of California.
12
12
* All rights reserved.
13
- * Copyright (c) 2008-2011 University of Houston. All rights reserved.
13
+ * Copyright (c) 2008-2019 University of Houston. All rights reserved.
14
14
* Copyright (c) 2014-2018 Research Organization for Information Science
15
15
* and Technology (RIST). All rights reserved.
16
16
* Copyright (c) 2015 Los Alamos National Security, LLC. All rights
@@ -156,23 +156,26 @@ int mca_fcoll_two_phase_calc_aggregator(ompio_file_t *fh,
156
156
{
157
157
158
158
159
- int rank_index , rank ;
159
+ int rank_index , rank ;
160
160
OMPI_MPI_OFFSET_TYPE avail_bytes ;
161
-
162
- rank_index = (int ) ((off - min_off + fd_size )/ fd_size - 1 );
163
-
161
+ long long off_ll = (long long ) off ;
162
+ long long min_off_ll = (long long ) min_off ;
163
+ long long fd_size_ll = (long long ) fd_size ;
164
+ long long rank_index_ll ;
165
+
166
+ rank_index_ll = (((off_ll - min_off_ll + fd_size_ll )/ fd_size_ll ) - 1 );
167
+ rank_index = (int ) rank_index_ll ;
164
168
if (striping_unit > 0 ){
165
169
rank_index = 0 ;
166
170
while (off > fd_end [rank_index ]) rank_index ++ ;
167
171
}
168
172
169
-
170
173
if (rank_index >= num_aggregators || rank_index < 0 ) {
171
174
fprintf (stderr ,
172
- "Error in ompi_io_ompio_calcl_aggregator() :" );
175
+ "Error in mca_fcoll_two_phase_calc_aggregator :" );
173
176
fprintf (stderr ,
174
- "rank_index(%d) >= num_aggregators(%d)fd_size=%lld off=%lld \n" ,
175
- rank_index ,num_aggregators ,fd_size ,off );
177
+ "rank_index(%d) >= num_aggregators(%d) fd_size=%ld off=%ld min_off=%ld striping_unit=%d \n" ,
178
+ rank_index , num_aggregators , fd_size , off , min_off , striping_unit );
176
179
ompi_mpi_abort (& ompi_mpi_comm_world .comm , 1 );
177
180
}
178
181
@@ -184,9 +187,9 @@ int mca_fcoll_two_phase_calc_aggregator(ompio_file_t *fh,
184
187
185
188
rank = aggregator_list [rank_index ];
186
189
187
- #if 0
190
+ #if 0
188
191
printf ("rank : %d, rank_index : %d\n" ,rank , rank_index );
189
- #endif
192
+ #endif
190
193
191
194
return rank ;
192
195
}
0 commit comments