Thomas, Thanks for the quick and helpful response. I just sent a response to Hartmut's answer -- I won't repeat the contents of that message here, but I would like to bring up a different point.
> One possibility would be to create a thread local random number generator > as > suggested here: > http://stackoverflow.com/questions/21237905/how-do-i-generate-thread- > safe-uniform-random-numbers > > The other is of course to really construct a fully parallel number generator. Hmmm... I was unfamiliar with thread_local variables as mentioned in that link. Will need to read up on that one. > > int main(int argc, char *argv[]) { > > std::mt19937_64 rng_; > > hpx::future<std::vector<random_vec_t>> future_vectors_ = > > hpx::async(generate_random_vector_action, rng_); > > Is there any reason to use an action here? async can just take any callable > (including regular function pointers). You could express what you have like > this: > > async(&generate_random_vector, std::ref(rng_)); > Actually, I'm not sure about this at all, and I wanted to ask you / the mailing list about this. I am a bit confused with the idea of Actions, and how using an action differs from calling a function or using a lambda function. Does it have anything to do with where the code actually runs? I haven't made a lot of use of actions so far in the code that I've played around with, and my current learning project still has yet to compile, so I can't check things out empirically... a) What is the difference between an Action vs a named or lambda function? b) when should I choose an action vs a function? Thanks, Shmuel _______________________________________________ hpx-users mailing list [email protected] https://mail.cct.lsu.edu/mailman/listinfo/hpx-users
