Skip to content

Commit

Permalink
Use std::accumulate instead of std::reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
range3 committed Aug 4, 2022
1 parent cc3ffa8 commit 986490d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.14...3.22)
# Note: update this to your new project's name and version
project(
Rdbench
VERSION 0.4.0
VERSION 0.4.1
LANGUAGES CXX C
)

Expand Down
4 changes: 2 additions & 2 deletions src/rdbench/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ struct RdbenchInfo {
int ecode;
info.topo = parsed["topology"].as<std::vector<int>>();
std::vector<int> dims_ml(2 * info.topo.size());
auto nprocs_in_topo = std::reduce(info.topo.begin(), info.topo.end(), 1,
[](int acc, int cur) { return acc * cur; });
auto nprocs_in_topo = std::accumulate(info.topo.begin(), info.topo.end(), 1,
[](int acc, int cur) { return acc * cur; });
if (nprocs_in_topo != info.nprocs) {
throw std::invalid_argument(
"nprocs specified in --topology does not match nprocs in mpirun");
Expand Down

0 comments on commit 986490d

Please sign in to comment.