Skip to content

Commit

Permalink
fixup test_runtime.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed Dec 29, 2023
1 parent 8d4a101 commit 16f4144
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions doc/tutorial/test_runtime.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <madness/world/worldgop.h>
#include <cassert>

int task (int i) { return i + 1; }

Expand All @@ -9,18 +10,14 @@ int main(int argc, char* argv[]) {
const auto me = world.rank();
const auto nproc = world.size();

Future<int> 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;
Expand Down

0 comments on commit 16f4144

Please sign in to comment.