wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

MPI Quiz

Total questions: 15

Worksheet time: 6mins

Name
Class
Date
1.

What does MPI_Comm_rank(MPI_COMM_WORLD, &rank) return?

a)

A) The total number of processes

b)

B) The rank (ID) of the calling process

c)

C) The size of the message to send

d)

D) The memory location of the process

2.

What does MPI_Init(&argc, &argv) do?

a)

A) Initializes the MPI environment

b)

B) Assigns ranks to processes

c)

C) Sends a message between processes

d)

D) Finalizes MPI

3.

What does MPI_Finalize() do?

a)

A) Starts MPI processes

b)

B) Ends the MPI environment

c)

C) Assigns ranks

d)

D) Broadcasts messages

4.

MPI_COMM_WORLD contains:

a)

A) Only process 0

b)

B) All the processes launched by mpirun

c)

C) No processes

d)

D) Only even-ranked processes

5.

Which MPI function is used for sending a message from one process to another?

a)

A) MPI_Recv

b)

B) MPI_Send

c)

C) MPI_Bcast

d)

D) MPI_Reduce

6.

Which MPI function is used to receive a message?

a)

A) MPI_Send

b)

B) MPI_Recv

c)

C) MPI_Comm_size

d)

D) MPI_Init

7.

Can an MPI program call any other MPI functions before calling MPI_Init?

a)
  • a) Yes

b)
  • b) No

c)

c)May be

d)

d)Not applicable

8.

Which of the following is mandatory in every MPI program?

a)
  • a) MPI_Init and MPI_Bcast

b)
  • b) MPI_Init and MPI_Comm_rank

c)
  • c) MPI_Init and MPI_Finalize

d)
  • d) Only MPI_Init

9.

Which communicator is automatically created and available after MPI_Init?

a)
  • a) MPI_COMM_SELF

b)
  • b) MPI_COMM_WORLD

c)
  • c) MPI_COMM_LOCAL

d)
  • d) MPI_COMM_ROOT

10.

What happens if you pass NULL, NULL instead of &argc, &argv to MPI_Init?

a)
  • a) The program crashes

b)
  • b) MPI cannot assign ranks

c)
  • c) The program still runs, but MPI command-line arguments are ignored

  • d) MPI uses default values

d)

c) The program still runs, but MPI command-line arguments are ignored

11.

What does MPI stand for?

a)
  • a) Multi-Processing Interface

b)
  • b) Message Passing Interface

c)
  • c) Multiple Program Integration

d)
  • d) Memory Processing Interface

12.

In MPI, each process is identified uniquely by a:

a)
  • a) Thread ID

b)
  • b) Rank

c)
  • c) Process name

d)
  • d) Memory address

13.

What happens when you run an MPI program with mpirun -np 4 ./a.out?

a)
  • a) One process with 4 threads is created

b)
  • b) Four independent processes are created

c)
  • c) Four processes share the same memory

d)
  • d) It runs sequentially

14.

How do processes in MPI communicate with each other?

a)
  • a) By using shared variables

b)
  • b) Through sockets only

c)
  • c) By sending and receiving messages

d)
  • d) By using semaphores

15.

What type of memory model does MPI follow?

a)
  • a) Shared memory model

b)
  • b) Distributed memory model

c)
  • c) Hybrid memory model

d)
  • d) None of the above