I have an object with an
Iterator trait that always hand me a reference to the same
Vector, only the content of said vector changes. I'd like then do some parallel computation based on the vector's data.
I'd like to do so while reducing the amount of memory allocated, and avoid any vector copying, so here is what I'm envisioning:
- create a number
- each worker has its own local vector
- at each iteration, a worker is fed a reference to the iterator's vector, and do an elementwise copy of the iterator's vector to its own local vector
- the worker can then do its computation on its own local vector
How should I go about this?