当前位置:天才代写 > 作业代写 > 并行计算代写 Parallel Computing代写

并行计算代写 Parallel Computing代写

2021-10-18 15:15 星期一 所属: 作业代写 浏览:39

并行计算代写

Parallel Computing

Homework Assignment 1

并行计算代写 1.In the global sum problem that we discussed in class, in lecture 1, if we assume that there is a variable called my_rank (local to each core)

 

1.

In the global sum problem that we discussed in class, in lecture 1, if we assume that there is a variable called my_rank (local to each core) that gives each core a unique rank from 0 to p-1 (for p cores), devise an expression to calculate my_first_i and my_last_i assuming:

a. n is divisible by p and n > p.

b. n is not divisible by p.

 

2.  并行计算代写

We have seen two ways of calculating the final sum in the global sum example we have studied in class. In one of them, the master core receives the partial sums from the other cores and calculates the final sum. The other method is the tree-method. Assume that the master core is core 0. Assume we have p cores and n numbers where n > p.

a. Derive a formula for the number of receives and additions that core 0 does in the first (non-tree) method.

b. Repeat for the tree-method.

c. Make a table showing the number of receives and additions done by core 0 for each method when the number of cores is 2, 4, 8, …, 1024.

d. Which operation do you think is more expensive: receive or addition? and why?

 

3.  并行计算代写

Sometimes you are given a sequential program that is very parallelizable. Yet, you may find that it is better to keep it sequential because it will be faster than the parallel one. What is the situation where this decision is sound?

 

4.

Before multicore processors, that is, during the single core era, programs are getting faster with every new generation of processors without any effort from the program. This is due to two factors. What are they?

 

5.

State two advantages and two disadvantages to each of the following:

  • Shared memory systems
  • Distributed memory systems

 

6.  并行计算代写

Suppose we have the following algorithm (assume N is a large even number):

for(i = 0; i < N/2; i++)

a[i] += a[i+ N/2 ];

a. [3] Can we parallelize the above algorithm? If no, why not? If yes, explain.

b. [2] What Is the maximum number of cores after which no performance enhancement can be seen? Justify

 

并行计算代写
并行计算代写

 

7.

We discussed briefly how caches are designed. Among cache characteristics are whether a cache is write back (when a cache block is modified, it is written back to the lower level cache only when the block is replaced) or write through (whenever a cache block is updated, it updates also the lower level copy). Discuss the pros and cons of each.

 

8.  并行计算代写

Does coherence protocol affect performance positively? or negatively? And Why?

 

9.

When we discussed hardware pipeline, we discussed an implementation that has five stages: Fetch, Decode, Issue, Execute, and Commit. Briefly (in 1-2 sentences) discuss what each stage does.

 

10.   并行计算代写

What is speculative execution? Why is it needed?

 

11.

Now that you know about coherence, how can you make use of this knowledge to write better code? State at least two scenarios.

 

 

 

更多代写:数据结构代写 生物学代考 英国文献综述代写 生态学essay代写 社会心理学代写paper范文 计算机网络考试代写

合作平台:随笔代写 论文代写 写手招聘 英国留学生代写

 

天才代写-代写联系方式