Review Questions for "Supercomputing in Plain English" ====================================================== Choose the BEST answer for each question. ------------------------------------------------------------------------ (1) Which of these is *NOT* a concern in the field of supercomputing? (a) Size (b) Object Oriented Programming (c) Parallelism (d) Speed ANSWER: (b). Although OOP can be used in supercomputing, it is not necessary, and many popular supercomputing applications do not use OOP. ------------------------------------------------------------------------ (2) Which of these is *NOT* a common category of supercomputing use? (a) Data mining (b) Graphical User Interfaces (c) Visualization (d) Simulation of physical phenomena ANSWER: (b). In fact, many popular supercomputing applications have no GUI, because interactive use of a computer is not high performance. ------------------------------------------------------------------------ (3) What is a compiler? (a) A program that converts human-readable source code into machine-readable executable code. (b) A program that executes other programs in parallel on a cluster. (c) A programming language. (d) A program that converts audible human speech to visible text. ANSWER: (a) ------------------------------------------------------------------------ (4) Which of these is a difference between shared memory parallelism and distributed parallelism? (a) Many tasks execute simultaneously. (b) In one of these forms of parallelism, all data are private, while in the other, some data can be shared among processors. (c) The number of processes/threads must be specified. (d) The number of processes/threads must be the same as the number of processors available. ANSWER: (b) ------------------------------------------------------------------------ (5) Which of these is the correct order of speed, from fastest to slowest? (a) CD-ROM, hard disk, main memory, cache memory (b) Main memory, cache memory, hard disk, CD-ROM (c) Hard disk, cache memory, CD-ROM, main memory (d) Cache memory, main memory, hard disk, CD-ROM ANSWER: (d) ------------------------------------------------------------------------ (6) Which of these is the correct order of price, from highest to lowest? (a) CD-ROM, hard disk, main memory, cache memory (b) Main memory, cache memory, hard disk, CD-ROM (c) Hard disk, cache memory, CD-ROM, main memory (d) Cache memory, main memory, hard disk, CD-ROM ANSWER: (d) ------------------------------------------------------------------------ (7) Which of these is the correct order of size, from largest to smallest, on a typical computer? (a) CD-ROM, hard disk, main memory, cache memory (b) Main memory, cache memory, hard disk, CD-ROM (c) Hard disk, cache memory, CD-ROM, main memory (d) Cache memory, main memory, hard disk, CD-ROM ANSWER: (a) ------------------------------------------------------------------------ (8) Which of these best describes the kind of data held in registers? (a) Data that are being used right now. (b) Data that are about to be used, or have just been used. (c) Data that are being used by a program that is currently running. (d) Data that need to be saved even when the computer's power is turned off. ANSWER: (a) ------------------------------------------------------------------------ (9) Which of these best describes the kind of data held in cache? (a) Data that are being used right now. (b) Data that are about to be used, or have just been used. (c) Data that are being used by a program that is currently running. (d) Data that need to be saved even when the computer's power is turned off. ANSWER: (b) ------------------------------------------------------------------------ (10) Which of these best describes the kind of data held in RAM? (a) Data that are being used right now. (b) Data that are about to be used, or have just been used. (c) Data that are being used by a program that is currently running. (d) Data that need to be saved even when the computer's power is turned off. ANSWER: (c) ------------------------------------------------------------------------ (11) Which of these best describes the kind of data held on hard disk? (a) Data that are being used right now. (b) Data that are about to be used, or have just been used. (c) Data that are being used by a program that is currently running. (d) Data that need to be saved even when the computer's power is turned off. ANSWER: (d) ------------------------------------------------------------------------ (12) Why do most contemporary computers have cache? (a) The CPU can calculate a little bit faster than data can move between the CPU and cache, but a lot faster than data can move between the CPU and RAM. (b) Cache is where temporary results are stored during calculation, but these results will never move to RAM. (c) Cache is where temporary results are stored during calculation, and these results will eventually move to RAM. (d) A program's most important data are stored in cache but not in RAM. ANSWER: (a) ------------------------------------------------------------------------ (13) Which of these is *NOT* a synonym for main memory? (a) Random Access Memory (RAM) (b) Core (c) Read Only Memory (ROM) ANSWER: (c) ------------------------------------------------------------------------ (14) What is a cache line? (a) A single byte of cache. (b) A double precision floating point value (i.e., 8 bytes). (c) A fixed number of bytes, depending on the type of CPU, that all move into or out of cache together. (d) All of the bytes in cache. ANSWER: (c) ------------------------------------------------------------------------ (15) In a direct mapped cache scheme, how many different locations in cache could a byte of RAM go into? (a) 1 (b) 2 (c) 4 (d) Any location in cache ANSWER: (a) ------------------------------------------------------------------------ (16) In a fully associative cache scheme, how many different locations in cache could a byte of RAM go into? (a) 1 (b) 2 (c) 4 (d) Any location in cache ANSWER: (d) ------------------------------------------------------------------------ (17) In a 4-way set associative cache scheme, how many different locations in cache could a byte of RAM go into? (a) 1 (b) 2 (c) 4 (d) Any location in cache ANSWER: (c) ------------------------------------------------------------------------ (18) In a direct mapped cache scheme, what happens in the event of a cache conflict? (a) The data currently in the given cache line is copied back to RAM if necessary, and then the new line of RAM clobbers the given cache line. (b) One of limited number of possible cache lines is selected, the data currently in that cache line is copied back to RAM if necessary, and then the new line of RAM clobbers that cache line. (c) Any of the cache lines is selected, the data currently in that cache line is copied back to RAM if necessary, and then the new line of RAM clobbers that cache line. ANSWER: (a) ------------------------------------------------------------------------ (19) Are direct mapped cache schemes popular? (a) Yes, because they are inexpensive. (b) No, because there is an unreasonably high probability of clobbering a cache line that will be needed soon. (c) No, because the high number of connections between RAM and cache make this scheme too expensive. (d) No, because the many possible mapping algorithms for this scheme make hardware design difficult. ANSWER: (b) ------------------------------------------------------------------------ (20) Are set associative cache schemes popular? (a) Yes, because there is a reasonably low probability of clobbering a cache line that will be needed soon, combined with a reasonably low number of connections between RAM and cache and therefore a reasonable cost. (c) No, because the high number of connections between RAM and cache make this scheme too expensive. (d) No, because the many possible mapping algorithms for this scheme make hardware design difficult. ANSWER: (a) ------------------------------------------------------------------------ (21) Are fully associative cache schemes popular? (a) Yes, because there is a very low probability of clobbering a cache line that will be needed soon. (b) Yes, because they are inexpensive. (c) No, because the high number of connections between RAM and cache make this scheme too expensive. (d) No, because the many possible mapping algorithms for this scheme make hardware design difficult. ANSWER: (c) ------------------------------------------------------------------------ (22) Which of these is *NOT* a cache replacement strategy? (a) Least Recently Used (b) Least Recently Modified (c) Round Robin (d) First Fit ANSWER: (d) ------------------------------------------------------------------------ (23) If a variable is in cache, is it also in RAM? (a) Yes, because cache holds a subset of RAM. (b) No, because cache and RAM are disjoint. (c) Maybe, because a program may be using cache but not using RAM. (d) No, because a program can't use both at the same time. ANSWER: (a) ------------------------------------------------------------------------ (24) What does it mean for a cache line to be dirty? (a) All of the bytes in the cache line have been changed. (b) Any of the bytes in the cache line have been changed. (c) None of the bytes in the cache line have been changed. (d) The cache line is not currently in use. ANSWER: (b) ------------------------------------------------------------------------ (25) What is temporal data locality? (a) If data at a particular address have been used recently, then that data will be used again soon. (b) If data at a particular address have been used recently, then data at nearby addresses will be used soon. (c) If data at a particular address have been used recently, then then no data within a given distance of that address will be used for a given amount of time. (d) At any time, data at all addresses have equal probability of being used. ANSWER: (a) ------------------------------------------------------------------------ (26) What is spatial data locality? (a) If data at a particular address have been used recently, then that data will be used again soon. (b) If data at a particular address have been used recently, then data at nearby addresses will be used soon. (c) If data at a particular address have been used recently, then then no data within a given distance of that address will be used for a given amount of time. (d) At any time, data at all addresses have equal probability of being used. ANSWER: (b) ------------------------------------------------------------------------ (27) What is tiling? (a) Breaking up a problem domain into pieces that can each fit into cache, to increase the number of cache hits and therefore the performance. (b) Breaking up a problem domain into pieces of identical size, to increase the number of cache hits and therefore the performance. (c) Adding any kind of extra code to a program to improve its performance. ANSWER: (a) ------------------------------------------------------------------------ (28) Why is hard disk slower than RAM? (a) Hard disk is mechanical while RAM is electronic. (b) Hard disk is bigger than RAM. (c) Hard disk uses magnetism while RAM uses electricity. (d) Hard disk is cheaper than RAM. ANSWER: (a) ------------------------------------------------------------------------ (29) Why should your hard disk I/O use binary representations rather than human-readable text? (a) Binary data typically consume less disk space than text. (b) Human-readable data are less secure than machine-readable data. (c) Binary data are always portable between different kinds of computers. (d) Binary data can't be easily converted to human-readable text. ANSWER: (a) ------------------------------------------------------------------------ (30) Which of these is *NOT* a reason to use a portable I/O library such as HDF or NetCDF? (a) Portable I/O libraries are optimized for speed. (b) Binary data is more compact than text. (c) Portable binary data can be read on a different kind of machine than it was written on. (d) Portable binary data always retains exact bit-for-bit copies of the data that were originally in RAM. ANSWER: (d) ------------------------------------------------------------------------ (31) Which of these best defines parallelism? (a) Running on a cluster. (b) Running on shared memory computer. (c) Running on multiple processors. (d) Having multiple flows of execution running concurrently. ANSWER: (d) ------------------------------------------------------------------------ (32) Which of these best defines instruction-level parallelism? (a) A set of techniques for executing multiple instructions at the same time. (b) A set of techniques for executing multiple instructions at the same time within the same computer. (c) A set of techniques for executing multiple instructions at the same time within the same CPU. (d) A set of techniques for executing multiple instructions at the same time on many CPUs. ANSWER: (c) ------------------------------------------------------------------------ (33) Which of these is *NOT* a form of instruction-level parallelism? (a) Superscalar (b) Pipeline (c) Vector (d) OpenMP ANSWER: (d) ------------------------------------------------------------------------ (34) Which of these is *NOT* a kind of instruction? (a) Memory access (e.g., load, store) (b) Arithmetic operation (e.g., add, divide) (c) Branch (jump from one sequence of instructions to another) (d) Back substitution (solve a system of equations that has been factored by LU decomposition) ANSWER: (d) ------------------------------------------------------------------------ (35) If a CPU has a speed of 1 GHz, how many cycles will it have? (a) 1 billion per second (b) 2 billion per second (c) 1 million per second (d) 2 million per second ANSWER: (a) ------------------------------------------------------------------------ (36) Two instructions are independent when: (a) It doesn't matter which of them is executed first. (b) It matters which of them is executed first. (c) They operate on different pieces of data. (d) One uses data that are in cache and the other uses data that are in RAM. ANSWER: (a) ------------------------------------------------------------------------ (37) Which of these is *NOT* a reason why loops are easy to optimize? (a) Their behavior is highly predictable. (b) They are very common in the kinds of programs that people use supercomputing for. (c) They are guaranteed to have high data locality. (d) They can be unrolled. ANSWER: (c) ------------------------------------------------------------------------ (38) Which of these is the best definition of a "reduction?" (a) Performing a calculation that converts many data to a single value. (b) Calculating the sum or the product of an array. (c) Calculating the dot product of two arrays. (d) Adding two arrays (componentwise) to get a new array. ANSWER: (a) ------------------------------------------------------------------------ (39) Which of these arithmetic operations typically takes the least amount of time to execute? (a) Floating point addition (b) Floating point division (c) Floating point square root (d) Raising a floating point number to a floating point power ANSWER: (a) ------------------------------------------------------------------------ (40) Which of these arithmetic operations typically takes the most amount of time to execute? (a) Floating point addition (b) Floating point division (c) Floating point square root (d) Raising a floating point number to a floating point power ANSWER: (d) ------------------------------------------------------------------------ (41) Which of these will *NOT* prevent pipelining? (a) Doing lots of adds, subtracts and multiplies. (b) Exiting the loop prematurely. (c) Calling a function or subroutine. (d) Doing I/O inside the loop. ANSWER: (a) ------------------------------------------------------------------------ (42) Which of these best describes a vector register? (a) A collection of registers that all perform the same instruction at the same time. (b) A collection of registers that all perform the same instruction at the same time on different data. (c) A single register that can perform the same instruction on many data very quickly in sequence. (d) A collection of single registers that can perform the same instruction on many data very quickly in sequence. ANSWER: (b) ------------------------------------------------------------------------ (43) Which of these is an example of a control dependency? (a) IF (a > b) THEN c = d END IF (b) IF (1 > 2) THEN q = r END IF (c) b = a c = b (d) b = a c = d ANSWER: (a) ------------------------------------------------------------------------ (44) Which of these is an example of a branch dependency? (a) IF (a > b) THEN c = d END IF (b) IF (1 > 2) THEN q = r END IF (c) b = a c = b (d) b = a c = d ANSWER: (a) ------------------------------------------------------------------------ (45) Which of these is an example of a loop-carried dependency? (a) DO i = 2, n q(i) = a(i-1) + b(i) END DO (b) DO i = 2, n q(i) = a(i-1) + q(i) END DO (c) DO i = 2, n q(i) = q(i-1) + b(i) END DO (d) DO i = 2, n q(i) = q(i) + b(i) END DO ANSWER: (c) ------------------------------------------------------------------------ (46) What kind of dependency is this an example of? DO i = 2, n IF (x(i) /= 0) THEN y(i) = LOG(x(i)) END IF END DO (a) Branch (b) Data (c) Loop-carried (d) Output ANSWER: (a) ------------------------------------------------------------------------ (47) What kind of dependency is this an example of? q = x + y r = z + w q = f - g (a) Branch (b) Data (c) Loop-carried (d) Output ANSWER: (d) ------------------------------------------------------------------------ (48) Which of these is *NOT* a reduction? (a) sum = 0 DO i = 1, n sum = sum + a(i) END DO (b) product = 1 DO i = 1, n product = product * a(i) END DO (c) maximum = a(1) DO i = 2, n IF (maximum < a(i)) THEN maximum = a(i) END IF END DO (d) DO i = 1, n IF (a(i) > 0) THEN a(i) = a(i) + 1 END IF END DO ANSWER: (d) ------------------------------------------------------------------------ (49) What optimization strategy is represented by this code conversion? a = b c = a + d BECOMES a = b c = b + d (a) Copy propagation (b) Constant folding (c) Dead code removal (d) Strength reduction ANSWER: (a) ------------------------------------------------------------------------ (50) What optimization strategy is represented by this code conversion? a = 2 b = 4 c = a * b BECOMES c = 6 (a) Copy propagation (b) Constant folding (c) Dead code removal (d) Strength reduction ANSWER: (b) ------------------------------------------------------------------------ (51) What optimization strategy is represented by this code conversion? a = b STOP c = d BECOMES a = b STOP (a) Copy propagation (b) Common subexpression elimination (c) Dead code removal (d) Strength reduction ANSWER: (c) ------------------------------------------------------------------------ (52) What optimization strategy is represented by this code conversion? a = b ** 3 BECOMES a = b * b * b (a) Variable renaming (b) Constant folding (c) Dead code removal (d) Strength reduction ANSWER: (d) ------------------------------------------------------------------------ (53) What optimization strategy is represented by this code conversion? a = b + c * d f = e * c * d BECOMES t = c * d a = b + t f = e * t (a) Variable renaming (b) Common subexpression elimination (c) Dead code removal (d) Strength reduction ANSWER: (b) ------------------------------------------------------------------------ (54) What optimization strategy is represented by this code conversion? a = b + c * d f = e * c * d a = q + r BECOMES z = b + c * d f = e * c * d a = q + r (a) Variable renaming (b) Common subexpression elimination (c) Dead code removal (d) Strength reduction ANSWER: (a) ------------------------------------------------------------------------ (55) What optimization strategy is represented by this code conversion? DO i = 1, n q(i) = r(i) + f * 3 END DO BECOMES t = f * 3 DO i = 1, n q(i) = r(i) + t END DO (a) Hoisting loop invariant code (b) Unswitching (c) Iteration peeling (d) Loop interchange ANSWER: (a) ------------------------------------------------------------------------ (56) What optimization strategy is represented by this code conversion? DO i = 1, n DO j = 2, n IF (f(i) /= 0) THEN a(i,j) = a(i,j) / f(i) ELSE a(i,j) = 0 END IF END DO END DO BECOMES DO i = 1, n IF (f(i) /= 0) THEN DO j = 2, n a(i,j) = a(i,j) / f(i) END DO ELSE DO j = 2, n a(i,j) = 0 END DO END IF END DO (a) Hoisting loop invariant code (b) Unswitching (c) Iteration peeling (d) Loop interchange ANSWER: (b) ------------------------------------------------------------------------ (57) What optimization strategy is represented by this code conversion? DO i = 1, n IF (i == 1) THEN a(i) = 3 * b(i) ELSE a(i) = 3 * b(i - 1) END IF END DO BECOMES a(1) = 3 * b(1) DO i = 2, n a(i) = 3 * b(i - 1) END DO (a) Hoisting loop invariant code (b) Unswitching (c) Iteration peeling (d) Loop interchange ANSWER: (c) ------------------------------------------------------------------------ (58) What optimization strategy is represented by this code conversion? DO i = 1, ni DO j = 1, nj q(i,j) = r(i,j) * 2 END DO END DO BECOMES DO j = 1, nj DO i = 1, ni q(i,j) = r(i,j) * 2 END DO END DO (a) Hoisting loop invariant code (b) Unswitching (c) Iteration peeling (d) Loop interchange ANSWER: (d) ------------------------------------------------------------------------ (59) What optimization strategy is represented by this code conversion? DO i = 1, n q(i) = r(i) * 2 IF (i > (n / 2)) THEN s(i) = t(i) / 5 END IF END DO BECOMES DO i = 1, n / 2 q(i) = r(i) * 2 END DO DO i = n / 2 + 1, n q(i) = r(i) * 2 s(i) = t(i) / 5 END DO (a) Index set splitting (b) Unrolling (c) Loop fusion (d) Loop fission ANSWER: (a) ------------------------------------------------------------------------ (60) What optimization strategy is represented by this code conversion? DO i = 1, n q(i) = r(i) * 2 END DO BECOMES DO i = 1, n, 4 q(i) = r(i) * 2 q(i+1) = r(i+1) * 2 q(i+2) = r(i+2) * 2 q(i+3) = r(i+3) * 2 END DO (a) Index set splitting (b) Unrolling (c) Loop fusion (d) Loop fission ANSWER: (b) ------------------------------------------------------------------------ (61) What optimization strategy is represented by this code conversion? DO i = 1, n q(i) = r(i) * 2 END DO DO i = 1, n s(i) = r(i) / 2 END DO BECOMES DO i = 1, n q(i) = r(i) * 2 s(i) = r(i) / 2 END DO (a) Index set splitting (b) Unrolling (c) Loop fusion (d) Loop fission ANSWER: (c) ------------------------------------------------------------------------ (62) What optimization strategy is represented by this code conversion? DO i = 1, n q(i) = r(i) * 2 s(i) = r(i) / 2 END DO BECOMES DO i = 1, n q(i) = r(i) * 2 END DO DO i = 1, n s(i) = r(i) / 2 END DO (a) Index set splitting (b) Unrolling (c) Loop fusion (d) Loop fission ANSWER: (d) ------------------------------------------------------------------------ (63) Which of these is *NOT* a reason that inlining can improve performance? (a) It reduces the number of routine calls and therefore the time spent executing the calls. (b) If the inlined routine was inside a loop, then the compiler may be able to do loop optimizations, which wouldn't be possible inside a routine that doesn't have the loop. (c) It decreases the compile time. ANSWER: (c) ------------------------------------------------------------------------ (64) Which of these does *NOT* contribute to runtime? (a) Compile time (b) The number of users on the system being run on (c) Operating system (d) Hardware ANSWER: (a) ------------------------------------------------------------------------ (65) Subroutine profiling gives what kind of information? (a) How much time was spent in each routine (b) How much time was spent doing calculations (c) How much time was spent doing I/O (d) How much time was spent moving data between memory and the CPU ANSWER: (a) ------------------------------------------------------------------------ (66) Which of these is true? (a) Threads use shared memory, but processes don't. (b) Processes use shared memory, but threads don't. (c) Threads and processes both use shared memory. (d) Neither threads nor processes use shared memory. ANSWER: (a) ------------------------------------------------------------------------ (67) Which of these is *NOT* associated with threads? (a) Shared memory (b) Processors exchanging data via memory (c) Some threads fork off from others (d) Message passing ANSWER: (d) ------------------------------------------------------------------------ (68) Which of these is a property of Amdahl's Law? (a) Speedup is limited by the portion of the code that is not parallelizable. (b) Speedup is limited by the portion of the code that is neither serial nor parallel. (c) Speedup is limited by the portion of the code that does I/O. (d) Speedup is limited by the portion of the code that passes messages. ANSWER: (a) ------------------------------------------------------------------------ (69) What does "linear speedup" mean? (a) The speedup of the code is equal to the number of processors. (b) The speedup of the code is less than the number of processors. (c) The speedup of the code is greater than the number of processors. (d) The speedup of the code is inversely proportional to the number of processors. ANSWER: (a) ------------------------------------------------------------------------ (70) What are "coarse grain" and "fine grain" parallelism? (a) "Coarse grain" is when the program has a small number of large pieces to be run in parallel; "fine grain" is when it has a large number of small pieces. (b) "Coarse grain" is when the program has a large number of small pieces to be run in parallel; "fine grain" is when it has a small number of large pieces. (c) "Coarse grain" is when the program has a large number of large pieces to be run in parallel; "fine grain" is when it has a small number of small pieces. (d) "Coarse grain" is when the program has a small number of small pieces to be run in parallel; "fine grain" is when it has a large number of large pieces. ANSWER: (a) ------------------------------------------------------------------------ (71) Which of these factors does *NOT* contribute to parallel overhead? (a) Managing threads/processes (b) Communication between threads/processes (c) Synchronization (d) Calculations ANSWER: (d) ------------------------------------------------------------------------ (72) What is load balancing? (a) Ensuring that all processors have roughly the same amount of work to do (b) Ensuring that all processors have a lot of work to do (c) Ensuring that all processors have different amounts work to do (d) Ensuring that all processors finish their work at roughly the same time ANSWER: (d) ------------------------------------------------------------------------ (73) Is load balancing easy or difficult? (a) Easy (b) Difficult (c) Always the same amount of difficulty regardless of the application or the algorithm (d) The difficulty depends on the application and the algorithm ANSWER: (d) ------------------------------------------------------------------------ (74) Which of these best describes "forking?" (a) A thread spawns a "child" thread. (b) A "child" thread shuts down, leaving only its parent. (c) A thread spawns a "child" process. (d) All threads shut down at the end of the program. ANSWER: (a) ------------------------------------------------------------------------ (75) Which of these best describes "joining?" (a) A thread spawns a "child" thread. (b) A "child" thread shuts down, leaving only its parent. (c) A thread spawns a "child" process. (d) All threads shut down at the end of the program. ANSWER: (b) ------------------------------------------------------------------------ (76) Which of these is *NOT* a part of OpenMP? (a) Compiler directives (b) Functions (c) Environment variables (d) Message passing ANSWER: (d) ------------------------------------------------------------------------ (77) What does the OpenMP environment variable OMP_NUM_THREADS indicate? (a) How many threads a parallel section should use. (b) How many processes a parallel section should use. (c) How many messages a parallel section should exchange. (d) How many iterations a parallel loop should have. ANSWER: (a) ------------------------------------------------------------------------ (78) When iterations of a parallel loop are executed, in what order are they executed? (a) First to last (b) Last to first (c) In a predefined random sequence (d) In a non-deterministic random sequence ANSWER: (d) ------------------------------------------------------------------------ (79) Which of these best describes the key difference between private and shared data? (a) Private data are visible to only one thread, while shared data are available to all threads. (b) Private data are visible to all threads, while shared data are available to only one thread. (c) Private data are visible to only one thread at a time, while shared data are available to all threads. (d) Private data are visible to all threads, while shared data are available to only one thread at a time. ANSWER: (a) ------------------------------------------------------------------------ (80) Can a parallel loop have only shared data, with no private data at all? (a) Yes. (b) No, because the loop index variable (also called the counter) must be private. (c) No, because the array that the loop operates on must be private. (d) No, because any scalar variables used for intermediate calculations must be private. ANSWER: (b) ------------------------------------------------------------------------ (81) Can a parallel loop have only private data, with no shared data at all? (a) Yes. (b) No, because the loop index variable (also called the counter) must be shared. (c) No, because the array that the loop operates on must be shared. (d) No, because any scalar variables used for intermediate calculations must be shared. ANSWER: (a) ------------------------------------------------------------------------ (82) Which of these statements about scheduling strategies is *FALSE*? (a) Static has the least overhead. (b) Dynamic is for loops with iterations that do highly variable amounts of work, so that the loops are hard to load balance. (c) Guided is a compromise between static and dynamic. (d) The best strategy can always be known before testing all three. ANSWER: (a) ------------------------------------------------------------------------ (83) Which of these best describes synchronization? (a) Every thread waits for all the other threads to finish a particular parallel loop before any go on to the next parallel loop. (b) Only one thread at a time can be executing a particular part of the code. (c) Only the master thread can execute a particular part of the code. (d) Every thread executes the same block of code in lockstep, all executing the same instruction at the same time. ANSWER: (a) ------------------------------------------------------------------------ (84) Which of these statements about barriers is *FALSE*? (a) A barrier forces synchronization. (b) A parallel loop has an implied barrier at its end. (c) A barrier can be placed anywhere in any parallel section. (d) A parallel loop has an implied barrier at its beginning. ANSWER: (d) ------------------------------------------------------------------------ (85) Which of these best describes critical sections? (a) Every thread waits for all the other threads to finish a particular parallel loop before any go on to the next parallel loop. (b) Only one thread at a time can be executing a particular part of the code. (c) Only the master thread can execute a particular part of the code. (d) Every thread executes the same block of code in lockstep, all executing the same instruction at the same time. ANSWER: (b) ------------------------------------------------------------------------ (86) Which of these best describes a race condition? (a) The value placed into a particular variable is nondeterministic, because several different threads are trying to modify it at the same time. (b) The value placed into a particular variable is nondeterministic, because each thread has its own private copy. (c) Multiple threads are trying to fill different elements of the same array at the same time. (d) Multiple threads are trying to fill the different arrays at the same time. ANSWER: (a) ------------------------------------------------------------------------ (87) Which of these statements about distributed processing is true? (a) Some data are shared. (b) Processes communicate via memory-to-memory copies. (c) The only cost of a communication that matters is the bandwidth. (d) All data are private. ANSWER: (d) ------------------------------------------------------------------------ (88) Which of these definitions is best? (a) Latency is the amount of time it takes to connect and bandwidth is the time per byte. (b) Bandwidth is the amount of time it takes to connect and latency is the time per byte. (c) Latency is the dollar cost of connecting and bandwidth is the dollar cost per byte. (d) Bandwidth is the dollar cost of connecting and latency is the dollar cost per byte. ANSWER: (a) ------------------------------------------------------------------------ (89) Which of these best describes why load balancing is important? (a) Because an unbalanced load leads to some processors being idle some of the time, which increases total runtime compared to a balanced load. (b) Because some processors will overheat if they are given too much work to do. (c) Because load balancing is a problem with a generally applicable solution that ought to be used in most cases. (d) Because load balancing increases the number of processors that can operate on a problem. ANSWER: (a) ------------------------------------------------------------------------ (90) Which MPI routine must be called before any other MPI routine? (a) MPI_Init (b) MPI_Comm_size (c) MPI_Comm_rank (d) MPI_Finalize ANSWER: (a) ------------------------------------------------------------------------ (91) Which MPI routine must be called after all other MPI routines? (a) MPI_Init (b) MPI_Comm_size (c) MPI_Comm_rank (d) MPI_Finalize ANSWER: (d) ------------------------------------------------------------------------ (92) Which MPI routine determines the number of processes being used by the current run? (a) MPI_Init (b) MPI_Comm_size (c) MPI_Comm_rank (d) MPI_Finalize ANSWER: (b) ------------------------------------------------------------------------ (93) Which MPI routine identifies which of the processes is the current process? (a) MPI_Init (b) MPI_Comm_size (c) MPI_Comm_rank (d) MPI_Finalize ANSWER: (c) ------------------------------------------------------------------------ (94) Which of these best describes communication hiding? (a) Performing communication while simultaneously performing computation, in order to eliminate the time cost of the communication. (b) Performing communication while simultaneously performing computation, in order to eliminate the time cost of the computation. (c) Performing communication before performing computation, in order to eliminate the time cost of the communication. (c) Performing communication before performing computation, in order to eliminate the time cost of the computation. ANSWER: (a) ------------------------------------------------------------------------ (95) Which of these is *NOT* a good way to solve a system of linear equations? (a) Invert the matrix, then multiply. (b) Use a standard, portable solver library. (c) Use a version of a standard, portable solver library that's optimized for the platform that you're running on. (d) Use information about the linear system to choose the most efficient solver algorithm possible. ANSWER: (a) ------------------------------------------------------------------------ (96) Which of these matrix properties will *NOT* help you speed up the solution of a system of linear equations? (a) Symmetry (b) Tridiagonality (c) Sparsity (d) Asymmetry ANSWER: (d) ------------------------------------------------------------------------