Terms Flashcards

1
Q

Race Condition

A

An error caused by timing

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

Critical Section

A

A block of code that can be executed by at most one thread at a time

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

P-Complete

A

A problem C that is solvable in polynomial time and for every other problem L that is solvable in polynomial time, L ≤ log m C

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

≤ log m

A

This is true iff there exists a function f that can be computed using only log-space s.t x ∈ A ⇔ f(x) ∈ B

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

NC

A

The set of all problems that can be solved in O((log n)^c) steps using an O(n^k) processors on a PRAM (for some c and k

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

Cache Coherency

A

The property that when one processor or core changes a cached variable that the value stored by all the other processors in their respective caches is changed to the new value to maintain consistency.

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

Thread Safety

A

A function has this property if multiple threads are able to simultaneously execute code within the function without leading to errors

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

CRCW PRAM

A

A PRAM where memory accesses enforce concurrent reads and concurrent writes among the processors

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

EREW PRAM

A

A PRAM where memory accesses enforce exclusive read and exclusive writes among the processors

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

False Sharing

A

Performance degradation caused by memory accesses that induce frequent cache updates across multiple core in systems that enforce cache coherency

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

How to debug a running process

A
  1. Run program using mpiexec and open another terminal
  2. Use the command:
    gdb -pid 5038
    With all of the pids associated with the mpiexec call
  3. Use the command:
    where
    to find where in the code it is hanging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Amdahl’s Law

A

1 / S+ (1-S)/N
where n is the number of processors
and s is the percentage of program executed sequentially

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

The theory of P-Completeness gives a notion of “efficient parallel computation.” What does that mean, precisely?

A

There is probably no algorithm that can solve a p-complete problem in logarithmic time with a polynomial number of processors.
If P ≠ NC then P-complete is not in NC

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

We know that the circuit value problem (CVP) is P-complete. This tells us that:

A

It is likely that there is no efficient parallel algorithm for CVP

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

Problems known to be P-complete

A
  1. Breadth First Search
  2. Circuit Value Problem
  3. Lexicographically First Depth First Search
  4. CFG membership
  5. Greedy Dominating Set
  6. Linear Programming
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to compile OpenMP program

A

g++ -fopenmp filename

17
Q

Why does the second program produce the wrong answer

A

because the line if (a[i]>a[j]) sum++; causes a race condition

18
Q

Why does the second program run slower than the first even though it is being run on 4 processors?

A

False Sharing - multiple cores attempt to change sum.

Cache issues.

19
Q

Rewrite it so that it runs faster

A
#pragma omp parallel for schedule(static,1) reduce(+,sum)
for(int i=0; ia[j]) sum = sum+1;
      }
}
cout<<<endl;
}
20
Q

What is s, the portion of the execution time that must be executed sequentially?

A

little num/ big num

21
Q

Amdal’s Law

A

1/ S+ (1-S/N)

22
Q

How long would your code take at maximum speedup using 8 processors

A

S = sequential / parallel

23
Q

By Amdahl’s law, what is the maximum speedup possible?

A

1 / S

24
Q

How to run a program using OpenMPI called t3.cc

A

mpic++ t3.cc

25
Q

How to compile using OpenMPI on the p1 and p2 machines

A

mpirun -hp 8 -host p1.cs.ohiou.edu, p2.cs,ohiou.edu