Skip to content

Commit a22238e

Browse files
authored
Fixing compiler warning about VLA (Clang extension) (#3769)
1 parent b41e22f commit a22238e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/eigenvalue.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ void synchronize_bank()
192192
// TODO: protect for MPI_Exscan at rank 0
193193

194194
// Allocate space for bank_position if this hasn't been done yet
195-
int64_t bank_position[mpi::n_procs];
196-
MPI_Allgather(
197-
&start, 1, MPI_INT64_T, bank_position, 1, MPI_INT64_T, mpi::intracomm);
195+
std::vector<int64_t> bank_position(mpi::n_procs);
196+
MPI_Allgather(&start, 1, MPI_INT64_T, bank_position.data(), 1, MPI_INT64_T,
197+
mpi::intracomm);
198198
#else
199199
start = 0;
200200
finish = index_temp;
@@ -289,7 +289,7 @@ void synchronize_bank()
289289
neighbor = mpi::n_procs - 1;
290290
} else {
291291
neighbor =
292-
upper_bound_index(bank_position, bank_position + mpi::n_procs, start);
292+
upper_bound_index(bank_position.begin(), bank_position.end(), start);
293293
}
294294

295295
// Resize IFP receive buffers

0 commit comments

Comments
 (0)