Worksheetspc quiz
Total questions: 106
Worksheet time: 35mins
Parallel programming primarily aims to:
Reduce compiler time
Increase execution speed
Reduce machine cost
Increase program length
SIMD stands for:
Single Instruction Multiple Data
Simple Instruction Multiple Data
Single Instruction Multiple Device
Synchronous Instruction Multiple Data
MIMD systems allow:
One instruction stream only
Multiple instruction streams
No parallelism
Vector operations only
Which of the following is a shared-memory model?
MPI
OpenMP
CUDA
None
A cluster of networked computers usually follows:
Distributed-memory model
Shared-memory model
SIMD
SISD
Which interconnection network has constant diameter?
Mesh
Torus
Hypercube
Bus
Cache coherence is mainly an issue in:
Distributed memory
Shared memory
SIMD systems
Interconnection networks
MESI protocol is used for:
GPU programming
Cache coherence
Scheduling
MPI communication
A single bus interconnection suffers from:
Low latency
High scalability
Contention
Multithread safety
In distributed memory, communication happens via:
Shared cache
Message passing
Coherence protocol
DMA operations only
Coordinating threads usually involves:
Locks
Signals
Atomic operations
All the above
Flynn’s taxonomy includes:
SISD, SIMD, MISD, MIMD
SISD, MIID, SIFD, MIUD
SISD only
None
A GPU is an example of:
SIMD
MIMD
SISD
MISD
NUMA stands for:
Non-Unique Memory Architecture
Non-Uniform Memory Access
Non-User Memory Allocation
None
Which network topology is easiest to scale?
Bus
Ring
Hypercube
Mesh
Threads in shared memory communicate using:
Signals
Shared variables
Registers
Disk
Latency refers to:
Time per instruction
Delay in data transfer
Amount of memory
Speedup
Shared memory programming is easier than distributed memory because:
No communication is needed
Memory is implicitly shared
Synchronization is automatic
None
Distributed memory programs scale better because:
Cache is larger
Communication is explicit
Memory increases with nodes
No bus contention
A race condition occurs when:
Two threads access same data without synchronization
Only one thread runs
System is overloaded
GPU stalls
Speedup is defined as:
Serial time / Parallel time
Parallel time / Serial time
CPU time / GPU time
None
Amdahl’s law limits:
Speed
Scalability
Memory
Instruction count
If 50% of a program is parallelizable, max speedup is:
1
2
10
Infinite
GPUs use which parallelism?
Coarse-grained
Fine-grained
Temporal
Loop unrolling
GPU performance depends mainly on:
Memory bandwidth
Clock speed
Number of CUDA cores
All the above
MIMD programs are harder than SIMD due to:
Multiple control flows
Less memory
No parallelism
Expensive hardware
Efficiency is:
Speedup / Processors
Processors / Speedup
Parallel time / Serial time
None
Which is a hybrid system?
CPU + GPU
Two CPUs
Multi-core CPU only
FPGA
Roofline model evaluates:
Timing
Power
Performance
Heat
GPU memory hierarchy includes:
Registers → Shared → Global
Registers → L1 → Disk
Only global
None
A warp contains:
8 threads
16 threads
32 threads
64 threads
GPU speed depends greatly on:
Arithmetic intensity
Disk speed
File I/O
OS version
Strong scaling means:
Increase problem size
Keep problem size constant
Decrease processor count
None
Weak scaling means:
Increase input with processors
Keep input constant
No parallelism
Amdahl’s law
PCIe bandwidth affects:
CPU speed
GPU data transfer
Cache miss rate
None
Timing a parallel program requires:
Wall clock
CPU clock
Both
None
A GPU kernel launches:
Grid of blocks
Blocks only
Threads only
None
Divergence occurs when:
Threads follow different branches
GPU stalls
CPU overheats
Memory allocates wrong
The sequential part of a program:
Limits speedup
Improves speed
Increases memory
None
Efficiency reduces when:
Communication increases
Processors increase
Synchronization overhead increases
All the above
MPI stands for:
Multi Processing Interface
Message Passing Interface
Multi Processor Interconnect
None
MPI_Init must be called:
Anywhere
Before any other MPI function
After MPI_Finalize
Only by master process
MPI_COMM_WORLD refers to:
All processes
Only root process
GPU group
Thread group
Rank in MPI identifies:
A thread
A process
A GPU core
Cache
MPI_Send and MPI_Recv implement:
Point-to-point communication
Collective communication
I/O
Datatype creation
Broadcast is done using:
MPI_Bcast
MPI_Share
MPI_Split
MPI_Signal
MPI_Reduce performs:
File I/O
Collective reduction
Data type creation
Process splitting
MPI derived datatypes allow:
Representing struct-like data
Representing only ints
GPU memory use
Cache coherence
MPI is best used for:
Shared-memory
Distributed-memory
GPU programming
Virtual memory
Deadlock can occur when:
Blocking send/receive mismatches
GPU waits
Cache misses
Thread stalls
Non-blocking calls are created using:
MPI_Send
MPI_Isend / MPI_Irecv
MPI_Reduce
None
Trap rule in MPI requires:
Partitioning intervals
Synchronization
Reduction of partial sums
All the above
Collective communication means:
All processes participate
Only rank 0 participates
Only threads participate
None
MPI_Gather collects data from:
All → One
One → All
Many → Many
None
MPI_Scatter distributes data from:
One → All
All → One
Root → Rank 0
None
MPI_Finalize must be called:
First
Last
Only by root
Only in serial code
Performance of MPI degrades mainly due to:
High communication
Cache misses
GPU stalls
ILP
MPI_Cart_create creates a:
Thread
Cartesian communicator
GPU kernel
None
MPI_File_read is used for:
Parallel I/O
Cache coherence
GPU I/O
None
Parallel sorting in MPI uses:
Partition → local sort → merge
Single-thread quicksort
Cache blocking
None
OpenMP supports:
Shared-memory parallelism
Distributed-memory
GPU
Cloud
OpenMP directives start with:
//OMP
#pragma omp
omp()
@omp
Creating threads uses:
omp parallel
omp create
mpi_spawn
gpu.start
Reduction clause performs:
Parallel loop splitting
Combining partial results
Thread creation
None
Loop scheduling in OpenMP includes:
static
dynamic
guided
all the above
False sharing occurs when:
Threads modify different variables in same cache line
Lock missing
Only one thread runs
GPU divergence
Thread-safe functions:
Can be used by multiple threads safely
Need no locks
Are slower always
Are GPU-only
Tasking is used for:
Recursive parallelism
Static loops only
Single-thread work
None
private clause means:
Variable shared
New copy for each thread
Read-only
GPU-only
critical section ensures:
Atomic execution
GPU synchronization
Compiler optimization
All threads skip it
Which clause avoids race conditions?
private
shared
reduction
collapse
Producers-consumers require:
Locks
Condition variables
Queues
All
The default variable scope is:
private
shared
firstprivate
threadprivate
Loop-carried dependency prevents:
Parallelization
Memory allocation
Synchronization
Clock rate
omp_get_thread_num() returns:
Process ID
Thread ID
Warp ID
None
Barrier is used to:
Synchronize threads
Allocate memory
Free locks
Avoid false sharing
OpenMP program begins execution on:
All threads
Single master thread
GPU threads
None
nowait removes:
Implicit barrier
Race condition
Scheduling
SIMD loop
In OpenMP, nested parallelism means:
Parallel inside parallel
Serial inside parallel
Message passing
GPU offloading
Cache coherence impacts:
Shared memory programs
MPI
CUDA
None
CUDA stands for:
Compute Unified Device Architecture
Common Unified Device API
Computational Device Access
None
GPU kernels run on:
Host
Device
CPU
Cache
CUDA threads are grouped into:
Blocks
Warps
Grids
All
One warp contains:
8
16
32
64 threads
Block size must not exceed:
128
256
512
1024 threads
Global memory is:
Slow but large
Fast but small
Register memory
Cache memory
Shared memory is:
Fast on-chip memory
Slow DRAM
Registers
Texture memory
CUDA kernels are invoked using:
<<>>
{}
()
##
cudaMemcpy is used for:
CPU ↔ GPU data transfer
GPU ↔ GPU
Cache refill
MPI
Compute capability gives:
GPU features
Cache size
Power usage
PCIe speed
Coalesced access improves:
Latency
Memory throughput
Warp divergence
PCIe speed
Divergence occurs when:
Threads in warp take different paths
GPU overheats
Kernel fails
Memory insufficient
Vector addition kernel requires:
One thread per element
One warp per element
One block
No grid
Device functions are declared with:
device
kernel
thread
omp_device
Kernel return values:
Cannot directly return
Can return like CPU
Always return float
Return warp id
Stream processors are called:
CUDA cores
Threads
SMs
Registers
SM stands for:
Streaming Multiprocessor
Shared Memory
System Module
None
Occupancy refers to:
Active warps per SM
Cache usage
Kernel size
Register count
Launching large blocks can reduce:
Parallelism
Performance
Memory
Bandwidth
Using more than one warp per block helps:
Hide latency
Increase divergence
Reduce cache
Slow down
A system with 4 processors executes a parallel loop. Each iteration takes 2 ms and there are 40 iterations. If the loop is perfectly parallelizable, total execution time is:
20 ms
40 ms
10 ms
80 ms
A SIMD architecture processes 128 data elements per instruction. How many instructions are required to process 4096 elements?
16
32
64
128
In a shared-memory system, two threads repeatedly write to different variables located in the same cache line. The performance drops. What phenomenon is this?
Contention
Cache miss
False sharing
Dirty eviction
A 4×4 mesh network has a diameter of:
2
4
6
8
A program takes 100 seconds serially. It has 80% parallel code. What is its maximum speedup using Amdahl’s law?
2
3
4
5
If a parallel program achieves a speedup of 15 on 20 cores, its efficiency is:
50%
75%
60%
90%
