Task Parallelism and Manager-Worker Parallelism Flashcards

(14 cards)

1
Q

What do MPI_ANY_SOURCE and MPI_ANY_TAG do? What can they be used for?

A
  • MPI_ANY_SOURCE allows receiving from an unspecified source
  • MPI_ANY_TAG allows receiving from an unspecified tag

In a manager/worker model, we don’t know which worker will request work next

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why define a new communicator instead of using MPI_COMM_WORLD?

A

To limit communication to a subset of processes.

For example all the worker processes (but not the manager process)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the steps to create a new communicator?

A
  1. Get world group handle (MPI_Comm_group)
  2. Create a new group (MPI_Group_incl() or MPI_Group_excl())
  3. Create a communicator (MPI_Comm_create())
  4. Get rank in new communicator (MPI_Comm_rank())
  5. Perform communication
  6. Free the group and communicator (MPI_Group_free(), MPI_Comm_free())
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does MPI_Group_incl do?

A

Creates a new group from an existing group including specific processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does MPI_Group_excl do?

A

Creates a new group from an existing group excluding specific processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does MPI_Group_union do?

A

Combines the union two groups members.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does MPI_Group_intersection do?

A

Creates a group containing only common members.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does MPI_Group_difference do?

A

Creates a group containing processes in the first group but not in the second.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How does the Manager-Worker model work in MPI?

A
  1. The manager assigns work to worker processes
  2. Workers request more work when finished
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do workers signal completion?

A

Workers send a request, receive a task, and exit if the received task is a special end flag.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are two OpenMP work-sharing constructs besides parallel for? When is each used?

A
  1. sections - When there are multiple, independent, blocks of code that can execute concurrently
  2. single - Ensures that only thread executes a block of code inside a parallel region
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does OpenMP handle tasks?

A

One thread generates tasks, and other threads execute them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What OpenMP directive ensures only one thread generates tasks?

A

#pragma omp single

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When using a single construct, which thread executes the code?

A

It can be any thread

How well did you know this?
1
Not at all
2
3
4
5
Perfectly