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
Copy file name to clipboardExpand all lines: src/MPIOperator/mpioperator.jl
+14-6Lines changed: 14 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,21 @@
1
1
## This shallow struct is used to indicate that each LazyMIPOperator should be evaluated on each rank and the result is to be reduced across all ranks using MPI.Allreduce
2
-
struct MPIOperator{O,T}
2
+
struct MPIOperator{O}
3
3
parent::O
4
+
functionMPIOperator(parent::O) where {O}
5
+
if!MPI.Initialized()
6
+
@warn"MPI is currently not initialized. Please initialize MPI by running \n `using MPI; MPI.Init()` \n before creating an MPIOperator." maxlog=1
7
+
end
8
+
returnnew{O}(parent)
9
+
end
4
10
end
5
11
6
-
function Base.parent(op::MPIOperator{O,T})::Owhere {O,T}
12
+
function Base.parent(op::MPIOperator{O})::Owhere {O}
7
13
return op.parent
8
14
end
9
15
10
-
function (Op::MPIOperator{O,T})(x::S) where {O,T,S}
0 commit comments