From 16f41445b0b0cc8466305a0ca535a140905a0113 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Thu, 28 Dec 2023 19:03:02 -0500 Subject: [PATCH] fixup test_runtime.cpp --- doc/tutorial/test_runtime.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/doc/tutorial/test_runtime.cpp b/doc/tutorial/test_runtime.cpp index ecdc592255d..453b5c2cd9f 100644 --- a/doc/tutorial/test_runtime.cpp +++ b/doc/tutorial/test_runtime.cpp @@ -1,4 +1,5 @@ #include +#include int task (int i) { return i + 1; } @@ -9,18 +10,14 @@ int main(int argc, char* argv[]) { const auto me = world.rank(); const auto nproc = world.size(); - Future f; if (me == 0) { - f = world.taskq.add(&task, 0); - for (auto t = 1; t != 1000; ++t) { + for (auto t = 0; t != 1000; ++t) { const auto proc = t % nproc; - f = world.taskq.add( - proc, &task, f); + auto f = world.taskq.add(proc, &task, t); + assert(f.get() == t+1); } } world.gop.fence(); - if (f.get() != 1000) - abort(); finalize(); return 0;