为了在2个矩阵A和B(nxm尺寸)之间以平行方式计算产品,我有以下限制:服务器从矩阵A向每个客户发送了若干行,并从矩阵B中抽出若干行。 这不能改变。 此外,客户可以相互交流信息,以便计算矩阵产品,但不能要求服务器发送任何其他数据。
这样做应当尽可能高效,即尽可能减少各进程之间发送的信息数量——认为这是一项昂贵的行动——并同时进行尽可能小的计算。
From what I have researched, practically the highest number of messages exchanged between the clients is n^2, in case each process broadcasts its lines to all the others. Now, the problem is that if I minimize the number of messages sent - this would be around log(n) for distributing the input data - but the computation then would only be done by one process, or more, but anyhow, it is not anymore done in parallel, which was the main idea of the problem.
哪一种算法是更有效率的算法,可以计算这一产品?
(I am using MPI, if it makes any difference).