1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/// Specifies the option for MPI_Init_thread
///
/// From <https://enccs.github.io/intermediate-mpi/mpi-and-threads-pt1/>
///
/// * MPI_THREAD_SINGLE - rank is not allowed to use threads, which is basically equivalent to calling MPI_Init.
/// With MPI_THREAD_SINGLE, the rank may use MPI freely and will not use threads.
/// * MPI_THREAD_FUNNELED - rank can be multi-threaded but only the main thread may call MPI functions.
/// Ideal for fork-join parallelism such as used in #pragma omp parallel, where all MPI calls are outside the OpenMP regions.
/// With MPI_THREAD_FUNNELED, the rank can use MPI from only the main thread.
/// * MPI_THREAD_SERIALIZED - rank can be multi-threaded but only one thread at a time may call MPI functions.
/// The rank must ensure that MPI is used in a thread-safe way.
/// One approach is to ensure that MPI usage is mutually excluded by all the threads, eg. with a mutex.
/// With MPI_THREAD_SERIALIZED, the rank can use MPI from any thread so long as it ensures the threads synchronize
/// such that no thread calls MPI while another thread is doing so.
/// * MPI_THREAD_MULTIPLE - rank can be multi-threaded and any thread may call MPI functions.
/// The MPI library ensures that this access is safe across threads.
/// Note that this makes all MPI operations less efficient, even if only one thread makes MPI calls,
/// so should be used only where necessary. With MPI_THREAD_MULTIPLE, the rank can use MPI from any thread.
/// The MPI library ensures the necessary synchronization
///
/// **Note:** The performance may be affected with MPI_THREAD_MULTIPLE
pub
/// Specifies the MPI operator used in reduce-like functions (for integer arrays)
/// Specifies the MPI operator used in reduce-like functions (for real number arrays)
/// Specifies the MPI operator used in reduce-like functions (for complex number arrays)
/// Specifies the MPI operator used in reduce-like functions (for byte arrays)