With this example...
void step1(f32 &val, f32 &arg)
{
arg = (arg + neighbor(arg, 1))*0.5;
};
void step2(f32 &val, f32 &arg)
{
val = (arg + neighbor(arg, 1))*0.5;
};
void steps(f32 &val, f32 &arg)
{
arg = (arg + neighbor(arg, 1))*0.5;
val = (arg + neighbor(arg, 1))*0.5;
};
void do_steps(dense &val, dense &arg)
{
#if 1
arbb::map(step1)(val, arg);
arbb::map(step2)(val, arg);
#else
arbb::map(steps)(val, arg);
#endif
};
...compiling and running with"step1" & "step2" works, but instead with the combined "steps" generates the runtime error "INCORRECT_MAP_USAGE:Invalid use of neighbour-access function on variable other than distributed input"
This leads me to think I don't fully understand how map() is constrained to insulate againste.g. data races. Please describe why the"steps" usage is invalid and anything else we should know about map().
Best regards,
- paul



