0% found this document useful (0 votes)
19 views7 pages

MPI Communication Parameters Explained

The document outlines a Continuous Assessment Test for a course on Parallel Programming and High Performance Computing, scheduled for March 8, 2025. It contains a series of multiple-choice questions related to MPI (Message Passing Interface) functions, Pthreads, and performance metrics in parallel computing. The test covers various topics including communication parameters, synchronization, load balancing, and performance evaluation in MPI programs.

Uploaded by

ilakkia.aids
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views7 pages

MPI Communication Parameters Explained

The document outlines a Continuous Assessment Test for a course on Parallel Programming and High Performance Computing, scheduled for March 8, 2025. It contains a series of multiple-choice questions related to MPI (Message Passing Interface) functions, Pthreads, and performance metrics in parallel computing. The test covers various topics including communication parameters, synchronization, load balancing, and performance evaluation in MPI programs.

Uploaded by

ilakkia.aids
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Set 02

Department of Artificial Intelligence and Data science


Continuous Assessment Test-1, March-2025
Parallel Programming and High Performance Computing- U23MXT401
Day and Date: Saturday and 08.03.2025 Year/Sem: II/IV/A
Time: 9 am to 10.40 am Max. Marks- 50
Answer all the questions

1. What is the first parameter in most d) The type of communicator used


MPI communication functions?
a) Message size 5. What does the source parameter in
b) Data buffer MPI_Recv() specify?
c) Communicator a) The number of processes
d) Status object involved in communication
b) The rank of the process sending
2. What is the purpose of the count the message
parameter in MPI communication c) The maximum message size
functions? d) The buffer address of the
a) Specifies the number of received message
elements in the buffer
b) Defines the rank of the sender or 6. What is the function of the tag
receiver parameter in MPI communication
c) Determines the number of calls?
processes involved in a) Specifies the data type
communication b) Defines a unique identifier for
d) Specifies the size of the message messages
in bytes c) Determines the number of bytes
in transmission
3. What does the datatype parameter d) Sets the priority of messages
in MPI communication functions
specify? 7. Which parameter in MPI_Recv()
a) The type of communication stores information about the
(blocking or non-blocking) received message?
b) The MPI data type of the a) buffer
elements in the buffer b) status
c) The memory address of the c) datatype
message buffer d) source
d) The rank of the process involved
in communication 8. In MPI_Bcast(), what does the root
parameter specify?
4. What does the dest parameter in a) The communicator used
MPI_Send() represent? b) The rank of the process that
a) The tag of the message broadcasts data
b) The rank of the receiving c) The number of processes
process receiving data
c) The number of bytes to send d) The number of elements in the

pg. 1
buffer a) MPI_SUM
b) MPI_MAX
9. Which parameter in MPI_Scatter() c) MPI_MULTIPLY
defines how many elements each d) MPI_MIN
process receives?
a) sendbuf 15. How does MPI_Allgather() differ
b) recvcount from MPI_Gather() in terms of the
c) root recvbuf parameter?
d) source a) MPI_Allgather() does not use
recvbuf
10. What happens if a non-root process b) In MPI_Allgather(), all
provides a non-null sendbuf in processes receive the gathered data
MPI_Bcast()? c) MPI_Gather() requires an extra
a) The function fails communicator parameter
b) The value is ignored d) MPI_Allgather() needs a special
c) The value is used instead of the root parameter
root’s data
d) The process becomes the new 16. What does the sendcount parameter
root in MPI_Allgather() specify?
a) The number of elements each
11. What does the recvbuf parameter in process sends
MPI_Gather() store? b) The process rank that gathers the
a) The message size data
b) The gathered data from all c) The total number of elements
processes at the root gathered
c) The rank of the receiving d) The number of bytes per process
process
d) The number of elements each 17. What is the role of the comm
process contributes parameter in MPI functions?
a) Defines the communication
12. In MPI_Reduce(), what does the op context for the operation
parameter specify? b) Specifies the data type being
a) The operation to apply to all transmitted
values (e.g., MPI_SUM) c) Sets the number of processes
b) The number of processes involved in communication
participating d) Determines the root process in
c) The message size limit collectives
d) The rank of the root process
18. What happens if an invalid
13. In MPI_Reduce(), what does the communicator is passed to an MPI
root parameter indicate? function?
a) The process that receives the a) The function silently ignores it
final reduced result b) The function returns an error
b) The number of elements in the c) The function creates a default
buffer communicator
c) The communicator used d) The function automatically
d) The operation to be applied selects MPI_COMM_WORLD

14. Which of the following is NOT a 19. What does the displs parameter in
valid MPI reduction operation? MPI_Scatterv() represent?

pg. 2
a) The displacement offsets for point before proceeding
each process's data c) Creates deadlocks
b) The total number of elements d) Used for debugging
sent
c) The rank of the root process
26. Which function is used to wait for a
d) The buffer size of the message
condition variable?
a) pthread_cond_wait
20. Which library must be included for
b) pthread_wait
Pthreads in C?
c) pthread_condition
a) <pthreads.h>
d) pthread_sleep
b) <thread.h>
c) <pthread.h>
d) <threads.h> 27. What is false sharing?
a) When multiple threads access the
same variable
21. Which function is used to create a
b) When multiple threads use different
thread in Pthreads?
parts of the same cache line
a) pthread_start
c) When threads use shared memory
b) pthread_create
efficiently
c) pthread_begin
d) None of the above
d) pthread_launch

28. What is cache coherence?


22. Which function is used to synchronize 1. a) Ensuring multiple caches
threads? have consistent data
a) pthread_wait 2. b) Storing cache in a single
b) pthread_join location
c) pthread_sync 3. c) Using cache for non-
d) pthread_lock volatile storage
4. d) None of the above
29. What is false sharing?
23. What is a critical section in
1. a) Unnecessary copying of
multithreading?
cache blocks
a) A segment of code where threads
2. b) When multiple threads
execute freely
modify different parts of
b) A section of code that must not be
the same cache block
executed by more than one thread at a
3. c) Sharing cache across
time
c) A debugging tool
multiple processors
d) None of the above
4. d) Using read-write locks
incorrectly
30. Which protocol is commonly used
24. Which mechanism is used to prevent
to maintain cache coherence?
race conditions?
1. a) MESI
a) Mutex
b) Deadlock
2. b) HTTP
c) Fork
3. c) TCP/IP
d) Cache
4. d) DNS

25. What is the purpose of a barrier in


31. What is the primary metric used to
Pthreads?
measure the execution time of an
a) Prevents all threads from executing
MPI program?
b) Ensures all threads reach a certain a) Clock speed

pg. 3
b) Wall-clock time d) Bandwidth
c) Number of cores
d) Cache size 37. What is latency in the context of
MPI communication?
32. Which of the following is NOT a a) The delay in process scheduling
key factor in MPI program b) The time taken for a message to
performance evaluation? travel from sender to receiver
a) Load balancing c) The amount of memory used by
b) Communication overhead a process
c) Memory allocation speed d) The rate at which a process
d) Floating point unit size executes instructions

33. The term scalability in MPI 38. Bandwidth in MPI programs refers
programs refers to: to:
a) The ability to increase a) The total number of processes in
computation time with more the system
processes b) The speed at which messages are
b) The ability to handle increasing transmitted
problem sizes efficiently c) The number of floating-point
c) The ability to reduce execution operations per second
time as more processes are added d) The memory capacity of the
d) The ability to keep cache usage system
minimal
39. Which of the following can cause
34. Speedup is defined as: load imbalance in MPI programs?
a) The ratio of sequential execution a) Unequal data distribution among
time to parallel execution time processes
b) The time taken for message b) Use of shared memory
transmission in MPI c) Increasing the number of threads
c) The number of floating-point d) Using fewer MPI processes
operations per second
d) The average CPU utilization of 40. What is the primary source of
the program communication overhead in MPI
programs?
35. Efficiency in MPI performance a) Number of floating-point
evaluation is given by: operations
a) Speedup×Number of Processors b) Data synchronization among
b) Speedup/Number of Processors processes
c) c) Using fewer MPI processes
Parallel Execution Time/Sequential d) Increasing cache size
Execution Time
d) 41. Which MPI tool is commonly used
Execution Time×Number of Cores for profiling and analyzing
performance?
36. Which metric is used to evaluate a) gprof
how efficiently an MPI program b) Valgrind
utilizes system resources? c) mpiP
a) Latency d) Makefile
b) Throughput
c) Efficiency

pg. 4
42. Which method helps reduce communication
communication overhead in MPI d) The total execution time of the
programs? function
a) Using synchronous
communication 47. In MPI_Scatterv(), what does the
b) Increasing message size for sendcounts parameter specify?
fewer communications a) The rank of the receiving
c) Reducing the number of cores process
used b) The number of elements each
d) Using blocking communication process should receive
for all operations c) The total number of elements in
the communicator
43. Amdahl’s Law states that: d) The tag associated with the
a) Parallel execution is always message
faster than sequential execution
b) There is a limit to speedup based 48. What happens if
on the serial portion of the code MPI_ANY_SOURCE is used as
c) Speedup is directly proportional the source parameter in
to the number of processors MPI_Recv()?
d) Communication delay has no a) The function fails with an error
effect on performance b) The message is received from
any available sender
44. What is the best approach to c) Only messages from process
improve load balancing in MPI rank 0 are accepted
programs? d) The function blocks indefinitely
a) Assign equal work to all
processes 49. In MPI_Reduce_scatter(), what
b) Increase the number of nodes does the recvcounts parameter
c) Use dynamic load balancing define?
techniques a) The number of elements each
d) Reduce the problem size process will receive after reduction
b) The communicator used for the
45. In MPI_Type_create_struct(), what operation
does the blocklengths parameter c) The total number of messages
define? sent
a) The number of elements in each d) The process rank performing the
data block reduction
b) The rank of the sending process
c) The communication topology 50. In MPI_Gatherv(), what is the
d) The size of the MPI purpose of the displs parameter?
communicator a) It specifies the amount of data
each process contributes
46. What does the status parameter in b) It defines the displacement
MPI_Recv() contain after the offsets for placing received data in
function call? recvbuf
a) The total number of bytes c) It represents the rank of the root
received process
b) The rank of the sender and d) It sets the total number of
message tag elements to be gathered
c) The communicator used for

pg. 5
51. What is the purpose of MPI_Init in an d) The number of threads
MPI program?
a) Initialize MPI environment
b) Terminate MPI environment 58. SPMD stands for:
c) Create new processes a) Simple Parallel Multi Data
d) Define communication channels b) Single Program Multiple Data
c) Systematic Parallel Multi Data
d) None of the above
52. Which function is used to properly
exit an MPI program?
a) MPI_Exit 59. In an SPMD model, all processes
b) MPI_Terminate execute:
c) MPI_Finalize a) The same program with different
d) MPI_End data
b) Different programs with the same
data
53. Can MPI functions be called before c) Completely different programs
MPI_Init? d) None of the above
a) Yes
b) No
60. Which function is used for sending
messages in MPI?
54. What happens if a process calls a) MPI_Send
MPI_Finalize but another process is b) MPI_Transmit
still running? c) MPI_MessageSend
a) It waits for all processes d) MPI_Broadcast
b) It terminates all processes
c) It returns an error
d) It continues execution 61. Which function is used for receiving
messages in MPI?
a) MPI_Receive
55. What is the default communicator in b) MPI_Recv
MPI? c) MPI_MessageRecv
a) MPI_COMM_SELF d) MPI_Get
b) MPI_COMM_WORLD
c) MPI_COMM_DEFAULT
d) MPI_GROUP_WORLD 62. What must match between sender and
receiver for a successful message
transfer?
56. Which function is used to create a new a) Only the message size
communicator from an existing one? b) The message tag, communicator,
a) MPI_Comm_create and datatype
b) MPI_Comm_new c) Only the sender rank
c) MPI_Comm_split d) Only the communicator
d) MPI_Comm_dup

63. Which function is used to open a file


57. What does MPI_Comm_rank return? in MPI I/O?
a) Number of processes in the a) MPI_File_open
communicator b) MPI_Open
b) Process ID in the communicator c) MPI_IO_Open
c) The total number of communicators d) MPI_FOpen

pg. 6
64. Which function is used to write to a 70. What does the MPI_Status structure
file in MPI? provide after calling MPI_Recv?
a) MPI_Write 1. a) The rank of the sender
b) MPI_File_write and error codes
c) MPI_Write_to_file 2. b) The total number of
d) MPI_FileWrite received messages
3. c) The rank of the receiver
4. d) The size of the sent data
65. Which MPI function performs
reduction operations?
71. Which compiler wrapper is
a) MPI_Scatter
commonly used to compile MPI
b) MPI_Gather
programs in C?
c) MPI_Reduce
d) MPI_Bcast
1. a) mpicc
2. b) gcc
3. c) mpi_compile
66. Which function sends data from all 4. d) mpic++
processes to one process? 72. Which command is used to execute
a) MPI_Scatter an MPI program?
b) MPI_Gather 1. a) mpirun
c) MPI_Bcast 2. b) mpiexec
d) MPI_Reduce 3. c) Both a and b
4. d) mpi_start
73. What flag is used with mpicc to
67. What are the parameters of specify an output executable file?
MPI_Send? 1. a) -o
1. a) buffer, count, datatype, 2. b) -exec
destination, tag, 3. c) -out
communicator 4. d) -run
2. b) buffer, size, destination 74. How can you specify the number of
3. c) rank, count, buffer processes when running an MPI
4. d) process ID, message, size program?
68. Which parameter in MPI_Recv 1. a) mpirun -np
specifies the rank of the sending <num_processes> ./program
process? 2. b) mpirun ./program -np
1. a) source <num_processes>
2. b) tag 3. c) mpi_exec ./program
3. c) communicator <num_processes>
4. d) buffer 4. d) mpirun <num_processes> -
69. What is the purpose of the count exec ./program
parameter in MPI_Send and 75. Which of the following MPI
MPI_Recv? functions is commonly used to
1. a) Specifies the number of measure execution time?
elements being a) MPI_Init()
sent/received b) MPI_Comm_size()
2. b) Defines the rank of the c) MPI_Wtime()
sender d) MPI_Finalize()
3. c) Identifies the message
tag
4. d) Determines the
communicator used

pg. 7

You might also like