WorksheetsMPI Quiz
Total questions: 15
Worksheet time: 6mins
What does MPI_Comm_rank(MPI_COMM_WORLD, &rank) return?
A) The total number of processes
B) The rank (ID) of the calling process
C) The size of the message to send
D) The memory location of the process
What does MPI_Init(&argc, &argv) do?
A) Initializes the MPI environment
B) Assigns ranks to processes
C) Sends a message between processes
D) Finalizes MPI
What does MPI_Finalize() do?
A) Starts MPI processes
B) Ends the MPI environment
C) Assigns ranks
D) Broadcasts messages
MPI_COMM_WORLD contains:
A) Only process 0
B) All the processes launched by mpirun
C) No processes
D) Only even-ranked processes
Which MPI function is used for sending a message from one process to another?
A) MPI_Recv
B) MPI_Send
C) MPI_Bcast
D) MPI_Reduce
Which MPI function is used to receive a message?
A) MPI_Send
B) MPI_Recv
C) MPI_Comm_size
D) MPI_Init
Can an MPI program call any other MPI functions before calling MPI_Init?
a) Yes
b) No
c)May be
d)Not applicable
Which of the following is mandatory in every MPI program?
a) MPI_Init and MPI_Bcast
b) MPI_Init and MPI_Comm_rank
c) MPI_Init and MPI_Finalize
d) Only MPI_Init
Which communicator is automatically created and available after MPI_Init?
a) MPI_COMM_SELF
b) MPI_COMM_WORLD
c) MPI_COMM_LOCAL
d) MPI_COMM_ROOT
What happens if you pass NULL, NULL instead of &argc, &argv to MPI_Init?
a) The program crashes
b) MPI cannot assign ranks
c) The program still runs, but MPI command-line arguments are ignored
d) MPI uses default values
c) The program still runs, but MPI command-line arguments are ignored
What does MPI stand for?
a) Multi-Processing Interface
b) Message Passing Interface
c) Multiple Program Integration
d) Memory Processing Interface
In MPI, each process is identified uniquely by a:
a) Thread ID
b) Rank
c) Process name
d) Memory address
What happens when you run an MPI program with mpirun -np 4 ./a.out?
a) One process with 4 threads is created
b) Four independent processes are created
c) Four processes share the same memory
d) It runs sequentially
How do processes in MPI communicate with each other?
a) By using shared variables
b) Through sockets only
c) By sending and receiving messages
d) By using semaphores
What type of memory model does MPI follow?
a) Shared memory model
b) Distributed memory model
c) Hybrid memory model
d) None of the above
