2

I am trying to use the all_reduce function to collect a boolean from each processor and reduce them to true if any of the booleans are true(ie the "or" operator). But I am having issues finding the right syntax for this. What I have right now is

all_reduce(world,update,update_sum,or());

I get the following compiler errors when I try to run this.

time_step_Gear_Verlet.cpp:94: error: expected primary-expression before '||' token
time_step_Gear_Verlet.cpp:94: error: expected primary-expression before ')' token

I tried just using ||() instead of or(), but that doesn't work either. Maybe I'm missing something? Or is there another way I have to go about doing this?

ildjarn
  • 62,044
  • 9
  • 127
  • 211
Kyle
  • 217
  • 2
  • 13

1 Answers1

4

You should use std::logical_or. The tutorial page has tables of operations from C MPI to their corresponding operations in Boost.MPI.

James Custer
  • 857
  • 6
  • 12