Skip to content

Commit dd3e256

Browse files
committed
Disable custom reduction operators in 32-bit Windows
Addresses #246.
1 parent a76657b commit dd3e256

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

.appveyor.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ platform:
88
- x86 # 32-bit
99
- x64 # 64-bit
1010

11-
matrix:
12-
allow_failures:
13-
- platform: x86
14-
1511
branches:
1612
only:
1713
- master

src/operators.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ function _mpi_user_function(_a::Ptr{Nothing}, _b::Ptr{Nothing}, _len::Ptr{Cint},
4444
end
4545

4646
function user_op(opfunc::Function)
47+
if Sys.iswindows() && Sys.WORD_SIZE == 32
48+
error("Custom reduction operators are not supported on 32-bit Windows.\nSee https://github.com/JuliaParallel/MPI.jl/issues/246 for more details.")
49+
end
50+
4751
# we must initialize these at runtime, but it can't be done in __init__
4852
# since MPI.Init is not called yet. So we do it lazily here:
4953
if _user_op.val == OP_NULL.val

test/runtests.jl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ singlefiles = ["test_spawn.jl"]
1818

1919
excludedfiles = String[]
2020
if Sys.iswindows()
21-
push!(excludedfiles, "test_info.jl")
22-
push!(excludedfiles, "test_onesided.jl")
23-
push!(excludedfiles, "test_finalize_atexit.jl")
24-
if Sys.WORD_SIZE == 32
25-
push!(excludedfiles, "test_spawn.jl")
26-
end
2721
end
2822

2923
function runtests()

test/test_allreduce.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ MPI.Init()
55

66
comm_size = MPI.Comm_size(MPI.COMM_WORLD)
77

8+
if Sys.iswindows() && Sys.WORD_SIZE == 32
9+
operators = [MPI.SUM, +]
10+
else
11+
operators = [MPI.SUM, +, (x,y) -> 2x+y-x]
12+
end
13+
814
for typ=[Int]
915
for dims = [1, 2, 3]
1016
send_arr = zeros(typ, Tuple(3 for i in 1:dims))
1117
send_arr[:] .= 1:length(send_arr)
1218

13-
for op in (MPI.SUM, +, (x,y) -> 2x+y-x)
19+
for op in operators
1420

1521
# Non allocating version
1622
recv_arr = zeros(typ, size(send_arr))

test/test_reduce.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,18 @@ comm_size = MPI.Comm_size(MPI.COMM_WORLD)
3232

3333
send_arr = Int[1, 2, 3]
3434

35+
if Sys.iswindows() && Sys.WORD_SIZE == 32
36+
operators = [MPI.SUM, +]
37+
else
38+
operators = [MPI.SUM, +, (x,y) -> 2x+y-x]
39+
end
40+
3541
for typ=[Int]
3642
for dims = [1, 2, 3]
3743
send_arr = zeros(typ, Tuple(3 for i in 1:dims))
3844
send_arr[:] .= 1:length(send_arr)
3945

40-
for op in (MPI.SUM, +, (x,y) -> 2x+y-x)
46+
for op in operators
4147

4248
# Non allocating version
4349
recv_arr = zeros(typ, size(send_arr))

0 commit comments

Comments
 (0)