【发布时间】:2011-04-27 08:00:29
【问题描述】:
对于毕业作业,我需要实现 4 个并行算法。我完全是并行算法的初学者,所以我不知道该学习什么,我应该使用哪种技术(线程、MPI、OpenMP、...)等。
为清楚起见,下面是其中一种算法的类似 Pascal 的伪代码。
procedure BROADCAST(D,N,A)
Step 1: Processor P1
(i) reads the value in D,
(ii) stores it in its own memory, and
(iii) writes it in A(1)
Step 2: for i = 0 to (logN - 1) do
for j = 2^i + 1 to 2^(i+1) do in parallel
Processor Pj
(i) reads the value in A(j - 2^i)
(ii) stores it in its own memory, and
(iii) writes it in A(j)
end for
end for
- D 是要在其中分布的数据 处理器。
- N 是处理器计数。
- A 是共享中长度为 N 的数组 记忆。
【问题讨论】:
标签: multithreading algorithm parallel-processing implementation mpi