Lecture 5 Flashcards

1
Q

Trapezoidal rule?

A

Integration method used to approximate the definite integral of a function. Divides the area under the curve into trapezoids and calculates their areas to estimate the integral value.

  1. Partition the problem to smaller problems. Each process will be responsible for computing the integral over its assigned sub interval.
  2. The integral over which the integration is performed is divided into subintervals, and these subintervals are distributed among the processes.
  3. Each process calculates the integral over its assigned interval.
  4. Establish communication so the final result can be calculated by combining each partial sum.
  5. Use reduction to combine the partial sums and obtain the global sum.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Speedup and efficiency?

A

Number of cores = p
T_parallel = T_serial / p
Linear speedup.

S = T_serial/T_parallel

Efficiency = S/p

T_parallel = T_serial / p + T_overhead

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Amdahl’s law?

A

Unless all of a serial program is parallelised, the possible speedup is going to be limited - regardless of the number of cores available.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Discuss scalability in terms of efficiency.

A

A problem is scalable if it can handle ever increasing problem sizes.

If we increase the number of processes/threads and keep the efficiency fixed without increasing problem size, the problem is strongly scalable.

If we keep efficiency fixed by increasing the problem size at the same rate as we increase the number of processes/threads, the problem is weakly scalable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Dynamic vs static threads in shared memory?

A

Dynamic threads: Master thread waits for work, forks new threads, and when threads are done, they terminate. Efficient use of resources, but thread creation and termination is time consuming.

Static threads: Pool of threads created and are allocated work, but do not terminate until cleanup. Better performance, but potential waste of system resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How should input collection happen in an MPI program?

A

Only the master process should handle input collection and send that data to the other processes. This is necessary to receive inputs in the correct order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly