From 817395fd26f6282bdc2b43c5436337e3c04a071d Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 9 Mar 2023 17:52:29 -0500 Subject: [PATCH] Try making clang-tidy happy --- source/base/mpi.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/base/mpi.cc b/source/base/mpi.cc index 0e0454697c..f4642bc077 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -777,18 +777,18 @@ namespace Utilities // Initialize Kokkos { - std::vector argv_new; + std::vector argv_new(argc + 2); for (int i = 0; i < argc; ++i) - argv_new.push_back(argv[i]); + argv_new[i] = argv[i]; std::stringstream threads_flag; #if KOKKOS_VERSION >= 30700 threads_flag << "--kokkos-num-threads=" << MultithreadInfo::n_threads(); #else threads_flag << "--kokkos-threads=" << MultithreadInfo::n_threads(); #endif - argv_new.push_back(const_cast(threads_flag.str().c_str())); - argv_new.push_back(nullptr); - int argc_new = argc + 1; + argv_new[argc] = const_cast(threads_flag.str().c_str()); + argv_new[argc + 1] = nullptr; + int argc_new = argc + 1; Kokkos::initialize(argc_new, argv_new.data()); } -- 2.39.5