You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**pytest_parallel** is a PyTest plugin that allows you to implement MPI parallel tests using PyTest and mpi4py.
13
+
## Introduction ##
7
14
8
15
```Python
9
16
import pytest_parallel
@@ -15,25 +22,26 @@ def test_fail_one_rank(comm):
15
22
if comm.Get_rank()==1: assertFalse
16
23
```
17
24
18
-
Here we declare a test that should run on two processes. When the test suite is run, the test will execute on two MPI processes. The `comm` fixture is an mpi4py communicator that is private to the test.
25
+
Here a test that should run on two processes is declared. When the test suite is run, the test will execute on two MPI processes. The `comm` fixture is an mpi4py communicator that is private to the test.
@@ -45,7 +53,7 @@ The `comm` fixture that you get when decorating your test with `pytest_parallel.
45
53
46
54
The `pytest_parallel.mark.parallel(n_procs)` decorator takes one argument, `n_procs`.
47
55
48
-
`n_procs` is generally an integer that specify the size of the communicator that will be given to the test through the `comm` fixture.
56
+
`n_procs` is generally an integer that specifies the size of the communicator that will be given to the test through the `comm` fixture.
49
57
50
58
`n_procs` can also be a list of integers to parametrize the test. For instance, the following test
51
59
@@ -59,7 +67,7 @@ will run two times: once with `comm` being a communicator of size 2, once with `
59
67
60
68
## Schedulers ##
61
69
62
-
**pytest_parallel** comes with 3 schedulers. To understand how they work, let's take the following example:
70
+
**pytest_parallel** comes with three kind of schedulers. To understand how they work, let's take the following example:
63
71
64
72
```Python
65
73
import pytest_parallel
@@ -111,7 +119,7 @@ We see that processes 0,1 and 2 wait at the first step for process 3 to finish.
111
119
112
120
### Dynamic scheduler ###
113
121
114
-
The **dynamic** scheduler spawns a new MPI process that act as the master scheduler and sends work to the original processes. The scheduler tries to schedule tests requiring the most processes first. The scheduler tries to send work to idle process until all the processes are busy executing one test, or when not enough processes are ready accept a test. It then waits for a signal that workers have finished their test to schedule further work.
122
+
The **dynamic** scheduler spawns a new MPI process which acts as the master scheduler and sends work to the original processes. The scheduler tries to schedule tests requiring the most processes first. The scheduler tries to send work to idle process until all the processes are busy executing one test, or when not enough processes are ready to accept a test. It then waits for a signal that workers have finished their test to schedule further work.
115
123
116
124
Example:
117
125

0 commit comments