When to use codistributed arrays
Show older comments
Imagine I have the following matrix:
A = rand(6400,6400)
Now imagine I create a distributed array from it: (I have 4 workers)
dist = codistributor1d();
dist = codistributor2dbc([2 2],3200);
B = codistributed(A,dist)
There are two ways for me to distribute it. Either each worker stores a 3200x3200 matrix or each worker stores a 6400x1600 matrix.
My questions are:
- When should I distribute an array?
- How do I know which function, codistributor1d or codistributor2dbc, I should use whenever I have some array I want to distribute between workers? I know how to work with both type of arrays but I don't know when one is better than the other.
If anyone could help me I'd appreciate.
Accepted Answer
More Answers (1)
How you cut up the array would depend on what portions of your array each parallel job needs. If each parallel job requires all rows of A, but not all columns, it makes more sense to split as 6400x1600 than as 1600x6400. That way all data needed for the job will be available on the associated lab.
Categories
Find more on Distributed Arrays in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!