@@ -98,7 +98,7 @@ const REQUEST_NULL = Request(MPI_REQUEST_NULL, nothing)
98
98
99
99
type Status
100
100
val:: Array{Cint,1}
101
- Status () = new (Array ( Cint, MPI_STATUS_SIZE))
101
+ Status () = new (Array { Cint} ( MPI_STATUS_SIZE))
102
102
end
103
103
Get_error (stat:: Status ) = Int (stat. val[MPI_ERROR])
104
104
Get_source (stat:: Status ) = Int (stat. val[MPI_SOURCE])
@@ -112,7 +112,7 @@ const UNDEFINED = Int(MPI_UNDEFINED)
112
112
function serialize (x)
113
113
s = IOBuffer ()
114
114
Base. serialize (s, x)
115
- Base . takebuf_array (s)
115
+ take! (s)
116
116
end
117
117
118
118
function deserialize (x)
329
329
function recv (src:: Integer , tag:: Integer , comm:: Comm )
330
330
stat = Probe (src, tag, comm)
331
331
count = Get_count (stat, UInt8)
332
- buf = Array ( UInt8, count)
332
+ buf = Array { UInt8} ( count)
333
333
stat = Recv! (buf, Get_source (stat), Get_tag (stat), comm)
334
334
(MPI. deserialize (buf), stat)
335
335
end
@@ -355,7 +355,7 @@ function irecv(src::Integer, tag::Integer, comm::Comm)
355
355
return (false , nothing , nothing )
356
356
end
357
357
count = Get_count (stat, UInt8)
358
- buf = Array ( UInt8, count)
358
+ buf = Array { UInt8} ( count)
359
359
stat = Recv! (buf, Get_source (stat), Get_tag (stat), comm)
360
360
(true , MPI. deserialize (buf), stat)
361
361
end
@@ -383,11 +383,11 @@ end
383
383
function Waitall! (reqs:: Array{Request,1} )
384
384
count = length (reqs)
385
385
reqvals = [reqs[i]. val for i in 1 : count]
386
- statvals = Array ( Cint, MPI_STATUS_SIZE, count)
386
+ statvals = Array { Cint} ( MPI_STATUS_SIZE, count)
387
387
ccall (MPI_WAITALL, Void,
388
388
(Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
389
389
& count, reqvals, statvals, & 0 )
390
- stats = Array ( Status, count)
390
+ stats = Array { Status} ( count)
391
391
for i in 1 : count
392
392
reqs[i]. val = reqvals[i]
393
393
reqs[i]. buffer = nothing
@@ -403,14 +403,14 @@ function Testall!(reqs::Array{Request,1})
403
403
count = length (reqs)
404
404
reqvals = [reqs[i]. val for i in 1 : count]
405
405
flag = Ref {Cint} ()
406
- statvals = Array ( Cint, MPI_STATUS_SIZE, count)
406
+ statvals = Array { Cint} ( MPI_STATUS_SIZE, count)
407
407
ccall (MPI_TESTALL, Void,
408
408
(Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
409
409
& count, reqvals, flag, statvals, & 0 )
410
410
if flag[] == 0
411
411
return (false , nothing )
412
412
end
413
- stats = Array ( Status, count)
413
+ stats = Array { Status} ( count)
414
414
for i in 1 : count
415
415
reqs[i]. val = reqvals[i]
416
416
reqs[i]. buffer = nothing
@@ -458,8 +458,8 @@ function Waitsome!(reqs::Array{Request,1})
458
458
count = length (reqs)
459
459
reqvals = [reqs[i]. val for i in 1 : count]
460
460
outcnt = Ref {Cint} ()
461
- inds = Array ( Cint, count)
462
- statvals = Array ( Cint, MPI_STATUS_SIZE, count)
461
+ inds = Array { Cint} ( count)
462
+ statvals = Array { Cint} ( MPI_STATUS_SIZE, count)
463
463
ccall (MPI_WAITSOME, Void,
464
464
(Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
465
465
& count, reqvals, outcnt, inds, statvals, & 0 )
@@ -468,8 +468,8 @@ function Waitsome!(reqs::Array{Request,1})
468
468
if outcount == UNDEFINED
469
469
outcount = 0
470
470
end
471
- indices = Array ( Int, outcount)
472
- stats = Array ( Status, outcount)
471
+ indices = Array { Int} ( outcount)
472
+ stats = Array { Status} ( outcount)
473
473
for i in 1 : outcount
474
474
ind = Int (inds[i])
475
475
reqs[ind]. val = reqvals[ind]
@@ -487,8 +487,8 @@ function Testsome!(reqs::Array{Request,1})
487
487
count = length (reqs)
488
488
reqvals = [reqs[i]. val for i in 1 : count]
489
489
outcnt = Ref {Cint} ()
490
- inds = Array ( Cint, count)
491
- statvals = Array ( Cint, MPI_STATUS_SIZE, count)
490
+ inds = Array { Cint} ( count)
491
+ statvals = Array { Cint} ( MPI_STATUS_SIZE, count)
492
492
ccall (MPI_TESTSOME, Void,
493
493
(Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
494
494
& count, reqvals, outcnt, inds, statvals, & 0 )
@@ -497,8 +497,8 @@ function Testsome!(reqs::Array{Request,1})
497
497
if outcount == UNDEFINED
498
498
outcount = 0
499
499
end
500
- indices = Array ( Int, outcount)
501
- stats = Array ( Status, outcount)
500
+ indices = Array { Int} ( outcount)
501
+ stats = Array { Status} ( outcount)
502
502
for i in 1 : outcount
503
503
ind = Int (inds[i])
504
504
reqs[ind]. val = reqvals[ind]
@@ -546,14 +546,14 @@ end
546
546
547
547
function bcast (obj, root:: Integer , comm:: Comm )
548
548
isroot = Comm_rank (comm) == root
549
- count = Array ( Cint, 1 )
549
+ count = Array { Cint} ( 1 )
550
550
if isroot
551
551
buf = MPI. serialize (obj)
552
552
count[1 ] = length (buf)
553
553
end
554
554
Bcast! (count, root, comm)
555
555
if ! isroot
556
- buf = Array ( UInt8, count[1 ])
556
+ buf = Array { UInt8} ( count[1 ])
557
557
end
558
558
Bcast! (buf, root, comm)
559
559
if ! isroot
565
565
function Reduce {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
566
566
op:: Op , root:: Integer , comm:: Comm )
567
567
isroot = Comm_rank (comm) == root
568
- recvbuf = Array (T, isroot ? count : 0 )
568
+ recvbuf = Array {T} ( isroot ? count : 0 )
569
569
ccall (MPI_REDUCE, Void,
570
570
(Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint},
571
571
Ptr{Cint}, Ptr{Cint}),
@@ -618,7 +618,7 @@ include("mpi-op.jl")
618
618
619
619
function Scatter {T} (sendbuf:: MPIBuffertype{T} ,count:: Integer , root:: Integer ,
620
620
comm:: Comm )
621
- recvbuf = Array (T, count)
621
+ recvbuf = Array {T} ( count)
622
622
ccall (MPI_SCATTER, Void,
623
623
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint},
624
624
Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), sendbuf, & count, & mpitype (T),
629
629
function Scatterv {T} (sendbuf:: MPIBuffertype{T} ,
630
630
counts:: Vector{Cint} , root:: Integer ,
631
631
comm:: Comm )
632
- recvbuf = Array (T, counts[Comm_rank (comm) + 1 ])
632
+ recvbuf = Array {T} ( counts[Comm_rank (comm) + 1 ])
633
633
recvcnt = counts[Comm_rank (comm) + 1 ]
634
634
disps = cumsum (counts) - counts
635
635
ccall (MPI_SCATTERV, Void,
641
641
function Gather {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
642
642
root:: Integer , comm:: Comm )
643
643
isroot = Comm_rank (comm) == root
644
- recvbuf = Array (T, isroot ? Comm_size (comm) * count : 0 )
644
+ recvbuf = Array {T} ( isroot ? Comm_size (comm) * count : 0 )
645
645
ccall (MPI_GATHER, Void,
646
646
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
647
647
sendbuf, & count, & mpitype (T), recvbuf, & count, & mpitype (T), & root, & comm. val, & 0 )
661
661
662
662
function Allgather {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
663
663
comm:: Comm )
664
- recvbuf = Array (T, Comm_size (comm) * count)
664
+ recvbuf = Array {T} ( Comm_size (comm) * count)
665
665
ccall (MPI_ALLGATHER, Void,
666
666
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
667
667
sendbuf, & count, & mpitype (T), recvbuf, & count, & mpitype (T), & comm. val, & 0 )
@@ -683,7 +683,7 @@ function Gatherv{T}(sendbuf::MPIBuffertype{T}, counts::Vector{Cint},
683
683
isroot = Comm_rank (comm) == root
684
684
displs = cumsum (counts) - counts
685
685
sendcnt = counts[Comm_rank (comm) + 1 ]
686
- recvbuf = Array (T, isroot ? sum (counts) : 0 )
686
+ recvbuf = Array {T} ( isroot ? sum (counts) : 0 )
687
687
ccall (MPI_GATHERV, Void,
688
688
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
689
689
sendbuf, & sendcnt, & mpitype (T), recvbuf, counts, displs, & mpitype (T), & root, & comm. val, & 0 )
@@ -694,7 +694,7 @@ function Allgatherv{T}(sendbuf::MPIBuffertype{T}, counts::Vector{Cint},
694
694
comm:: Comm )
695
695
displs = cumsum (counts) - counts
696
696
sendcnt = counts[Comm_rank (comm) + 1 ]
697
- recvbuf = Array (T, sum (counts))
697
+ recvbuf = Array {T} ( sum (counts))
698
698
ccall (MPI_ALLGATHERV, Void,
699
699
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
700
700
sendbuf, & sendcnt, & mpitype (T), recvbuf, counts, displs, & mpitype (T), & comm. val, & 0 )
703
703
704
704
function Alltoall {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
705
705
comm:: Comm )
706
- recvbuf = Array (T, Comm_size (comm)* count)
706
+ recvbuf = Array {T} ( Comm_size (comm)* count)
707
707
ccall (MPI_ALLTOALL, Void,
708
708
(Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
709
709
sendbuf, & count, & mpitype (T), recvbuf, & count, & mpitype (T), & comm. val, & 0 )
712
712
713
713
function Alltoallv {T} (sendbuf:: MPIBuffertype{T} , scounts:: Vector{Cint} ,
714
714
rcounts:: Vector{Cint} , comm:: Comm )
715
- recvbuf = Array (T, sum (rcounts))
715
+ recvbuf = Array {T} ( sum (rcounts))
716
716
sdispls = cumsum (scounts) - scounts
717
717
rdispls = cumsum (rcounts) - rcounts
718
718
ccall (MPI_ALLTOALLV, Void,
723
723
724
724
function Scan {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
725
725
op:: Op , comm:: Comm )
726
- recvbuf = Array (T, count)
726
+ recvbuf = Array {T} ( count)
727
727
ccall (MPI_SCAN, Void,
728
728
(Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
729
729
sendbuf, recvbuf, & count, & mpitype (T), & op. val, & comm. val, & 0 )
737
737
738
738
function Exscan {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
739
739
op:: Op , comm:: Comm )
740
- recvbuf = Array (T, count)
740
+ recvbuf = Array {T} ( count)
741
741
ccall (MPI_EXSCAN, Void,
742
742
(Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
743
743
sendbuf, recvbuf, & count, & mpitype (T), & op. val, & comm. val, & 0 )
0 commit comments