Skip to content

Commit a51faa9

Browse files
fredrikekreJeffBezanson
authored andcommitted
rewrite all ones(...) calls in base, stdlib, test and documentation (#25087)
1 parent 9d08b6f commit a51faa9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/distributed_exec.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ workloads = Int[sum(ids .== i) for i in 2:nprocs()]
289289

290290
# Testing buffered and unbuffered reads
291291
# This large array should write directly to the socket
292-
a = ones(10^6)
292+
a = fill(1, 10^6)
293293
@test a == remotecall_fetch((x)->x, id_other, a)
294294

295295
# Not a bitstype, should be buffered
@@ -1118,7 +1118,7 @@ for i in 1:5
11181118
end
11191119

11201120
# Different global bindings to the same object
1121-
global v3 = ones(10)
1121+
global v3 = fill(1., 10)
11221122
global v4 = v3
11231123
@test remotecall_fetch(()->v3, id_other) == remotecall_fetch(()->v4, id_other)
11241124
@test remotecall_fetch(()->isdefined(Main, :v3), id_other)
@@ -1188,8 +1188,8 @@ end
11881188
@test testsercnt_d[object_id(tsc)] == n
11891189

11901190
# Multiple references in a closure should be serialized only once.
1191-
global mrefs = TestSerCnt(ones(10))
1192-
@test remotecall_fetch(()->(mrefs.v, 2*mrefs.v, 3*mrefs.v), id_other) == (ones(10), 2*ones(10), 3*ones(10))
1191+
global mrefs = TestSerCnt(fill(1.,10))
1192+
@test remotecall_fetch(()->(mrefs.v, 2*mrefs.v, 3*mrefs.v), id_other) == (fill(1.,10), fill(2.,10), fill(3.,10))
11931193
@test testsercnt_d[object_id(mrefs)] == 1
11941194

11951195

@@ -1201,7 +1201,7 @@ v = rand()
12011201
@test remotecall_fetch(x->f2(x), id_other, v) == v
12021202

12031203
# consts
1204-
const c1 = ones(10)
1204+
const c1 = fill(1., 10)
12051205
@test remotecall_fetch(()->c1, id_other) == c1
12061206
@test remotecall_fetch(()->isconst(Main, :c1), id_other)
12071207

@@ -1234,7 +1234,7 @@ end
12341234
wrapped_var_ser_tests()
12351235

12361236
# Test internal data structures being cleaned up upon gc.
1237-
global ids_cleanup = ones(6)
1237+
global ids_cleanup = fill(1., 6)
12381238
global ids_func = ()->ids_cleanup
12391239

12401240
clust_ser = (Distributed.worker_from_id(id_other)).w_serializer
@@ -1449,8 +1449,8 @@ npids = addprocs_with_testenv(WorkerArgTester(`--worker=foobar`, false))
14491449
# Must be run on a new cluster, i.e., all workers must be in the same state.
14501450
rmprocs(workers())
14511451
p1,p2 = addprocs_with_testenv(2)
1452-
@everywhere f22865(p) = remotecall_fetch(x->x.*2, p, ones(2))
1453-
@test ones(2).*2 == remotecall_fetch(f22865, p1, p2)
1452+
@everywhere f22865(p) = remotecall_fetch(x->x.*2, p, fill(1.,2))
1453+
@test fill(2.,2) == remotecall_fetch(f22865, p1, p2)
14541454

14551455
function reuseport_tests()
14561456
# Run the test on all processes.

0 commit comments

Comments
 (0)