Dear HPX-ers,

I am studying the futurization example from the manual (a great example 
by the way!) and have two questions about it. Maybe one of you can help 
me clarify these.


In example 2, do_work is implemented to return a

hpx::future<std::vector<hpx::shared_future<double>>>

This future is the result of calling hpx::when_all.

https://github.com/STEllAR-GROUP/hpx/blob/master/examples/1d_stencil/1d_stencil_2.cpp#L61

In hpx_main, .get is called on the future returned by do_work. This 
makes the std::vector<hpx::shared_future<double>> value available.

After that, hpx::wait_all is called passing this 
std::vector<hpx::shared_future<double>> value. My question is why this 
is necessary. Aren't all hpx::shared_future<double> values in the vector 
guaranteed to be ready after the call to .get on the previous line and 
given that the future is returned by hpx::when_all?


In example 8, do_work contains this line, which I think is not necessary:

std::vector<hpx::id_type> localities = hpx::find_all_localities();

https://github.com/STEllAR-GROUP/hpx/blob/master/examples/1d_stencil/1d_stencil_8.cpp#L489

In the code below, hpx::find_here() is used to position partition 
components on the current locality. The localities returned by 
hpx::find_all_localities() are not used. Maybe a left-over from 
copy-and-pasting code from example 7?


Best regards,
Kor
_______________________________________________
hpx-users mailing list
[email protected]
https://mail.cct.lsu.edu/mailman/listinfo/hpx-users

Reply via email to