diff --git a/src/eigenvalue.cpp b/src/eigenvalue.cpp index 2fb9dabf16..dc4fbb420b 100644 --- a/src/eigenvalue.cpp +++ b/src/eigenvalue.cpp @@ -192,9 +192,9 @@ void synchronize_bank() // TODO: protect for MPI_Exscan at rank 0 // Allocate space for bank_position if this hasn't been done yet - int64_t bank_position[mpi::n_procs]; - MPI_Allgather( - &start, 1, MPI_INT64_T, bank_position, 1, MPI_INT64_T, mpi::intracomm); + std::vector bank_position(mpi::n_procs); + MPI_Allgather(&start, 1, MPI_INT64_T, bank_position.data(), 1, MPI_INT64_T, + mpi::intracomm); #else start = 0; finish = index_temp; @@ -289,7 +289,7 @@ void synchronize_bank() neighbor = mpi::n_procs - 1; } else { neighbor = - upper_bound_index(bank_position, bank_position + mpi::n_procs, start); + upper_bound_index(bank_position.begin(), bank_position.end(), start); } // Resize IFP receive buffers