@@ -98,7 +98,7 @@ const REQUEST_NULL = Request(MPI_REQUEST_NULL, nothing)
9898
9999type Status
100100 val:: Array{Cint,1}
101- Status () = new (Array ( Cint, MPI_STATUS_SIZE))
101+ Status () = new (Array { Cint} ( MPI_STATUS_SIZE))
102102end
103103Get_error (stat:: Status ) = Int (stat. val[MPI_ERROR])
104104Get_source (stat:: Status ) = Int (stat. val[MPI_SOURCE])
@@ -112,7 +112,7 @@ const UNDEFINED = Int(MPI_UNDEFINED)
112112function serialize (x)
113113 s = IOBuffer ()
114114 Base. serialize (s, x)
115- Base . takebuf_array (s)
115+ take! (s)
116116end
117117
118118function deserialize (x)
329329function recv (src:: Integer , tag:: Integer , comm:: Comm )
330330 stat = Probe (src, tag, comm)
331331 count = Get_count (stat, UInt8)
332- buf = Array ( UInt8, count)
332+ buf = Array { UInt8} ( count)
333333 stat = Recv! (buf, Get_source (stat), Get_tag (stat), comm)
334334 (MPI. deserialize (buf), stat)
335335end
@@ -355,7 +355,7 @@ function irecv(src::Integer, tag::Integer, comm::Comm)
355355 return (false , nothing , nothing )
356356 end
357357 count = Get_count (stat, UInt8)
358- buf = Array ( UInt8, count)
358+ buf = Array { UInt8} ( count)
359359 stat = Recv! (buf, Get_source (stat), Get_tag (stat), comm)
360360 (true , MPI. deserialize (buf), stat)
361361end
@@ -383,11 +383,11 @@ end
383383function Waitall! (reqs:: Array{Request,1} )
384384 count = length (reqs)
385385 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)
387387 ccall (MPI_WAITALL, Void,
388388 (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
389389 & count, reqvals, statvals, & 0 )
390- stats = Array ( Status, count)
390+ stats = Array { Status} ( count)
391391 for i in 1 : count
392392 reqs[i]. val = reqvals[i]
393393 reqs[i]. buffer = nothing
@@ -403,14 +403,14 @@ function Testall!(reqs::Array{Request,1})
403403 count = length (reqs)
404404 reqvals = [reqs[i]. val for i in 1 : count]
405405 flag = Ref {Cint} ()
406- statvals = Array ( Cint, MPI_STATUS_SIZE, count)
406+ statvals = Array { Cint} ( MPI_STATUS_SIZE, count)
407407 ccall (MPI_TESTALL, Void,
408408 (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
409409 & count, reqvals, flag, statvals, & 0 )
410410 if flag[] == 0
411411 return (false , nothing )
412412 end
413- stats = Array ( Status, count)
413+ stats = Array { Status} ( count)
414414 for i in 1 : count
415415 reqs[i]. val = reqvals[i]
416416 reqs[i]. buffer = nothing
@@ -458,8 +458,8 @@ function Waitsome!(reqs::Array{Request,1})
458458 count = length (reqs)
459459 reqvals = [reqs[i]. val for i in 1 : count]
460460 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)
463463 ccall (MPI_WAITSOME, Void,
464464 (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
465465 & count, reqvals, outcnt, inds, statvals, & 0 )
@@ -468,8 +468,8 @@ function Waitsome!(reqs::Array{Request,1})
468468 if outcount == UNDEFINED
469469 outcount = 0
470470 end
471- indices = Array ( Int, outcount)
472- stats = Array ( Status, outcount)
471+ indices = Array { Int} ( outcount)
472+ stats = Array { Status} ( outcount)
473473 for i in 1 : outcount
474474 ind = Int (inds[i])
475475 reqs[ind]. val = reqvals[ind]
@@ -487,8 +487,8 @@ function Testsome!(reqs::Array{Request,1})
487487 count = length (reqs)
488488 reqvals = [reqs[i]. val for i in 1 : count]
489489 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)
492492 ccall (MPI_TESTSOME, Void,
493493 (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
494494 & count, reqvals, outcnt, inds, statvals, & 0 )
@@ -497,8 +497,8 @@ function Testsome!(reqs::Array{Request,1})
497497 if outcount == UNDEFINED
498498 outcount = 0
499499 end
500- indices = Array ( Int, outcount)
501- stats = Array ( Status, outcount)
500+ indices = Array { Int} ( outcount)
501+ stats = Array { Status} ( outcount)
502502 for i in 1 : outcount
503503 ind = Int (inds[i])
504504 reqs[ind]. val = reqvals[ind]
@@ -546,14 +546,14 @@ end
546546
547547function bcast (obj, root:: Integer , comm:: Comm )
548548 isroot = Comm_rank (comm) == root
549- count = Array ( Cint, 1 )
549+ count = Array { Cint} ( 1 )
550550 if isroot
551551 buf = MPI. serialize (obj)
552552 count[1 ] = length (buf)
553553 end
554554 Bcast! (count, root, comm)
555555 if ! isroot
556- buf = Array ( UInt8, count[1 ])
556+ buf = Array { UInt8} ( count[1 ])
557557 end
558558 Bcast! (buf, root, comm)
559559 if ! isroot
565565function Reduce {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
566566 op:: Op , root:: Integer , comm:: Comm )
567567 isroot = Comm_rank (comm) == root
568- recvbuf = Array (T, isroot ? count : 0 )
568+ recvbuf = Array {T} ( isroot ? count : 0 )
569569 ccall (MPI_REDUCE, Void,
570570 (Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint},
571571 Ptr{Cint}, Ptr{Cint}),
@@ -618,7 +618,7 @@ include("mpi-op.jl")
618618
619619function Scatter {T} (sendbuf:: MPIBuffertype{T} ,count:: Integer , root:: Integer ,
620620 comm:: Comm )
621- recvbuf = Array (T, count)
621+ recvbuf = Array {T} ( count)
622622 ccall (MPI_SCATTER, Void,
623623 (Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint},
624624 Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), sendbuf, & count, & mpitype (T),
629629function Scatterv {T} (sendbuf:: MPIBuffertype{T} ,
630630 counts:: Vector{Cint} , root:: Integer ,
631631 comm:: Comm )
632- recvbuf = Array (T, counts[Comm_rank (comm) + 1 ])
632+ recvbuf = Array {T} ( counts[Comm_rank (comm) + 1 ])
633633 recvcnt = counts[Comm_rank (comm) + 1 ]
634634 disps = cumsum (counts) - counts
635635 ccall (MPI_SCATTERV, Void,
641641function Gather {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
642642 root:: Integer , comm:: Comm )
643643 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 )
645645 ccall (MPI_GATHER, Void,
646646 (Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
647647 sendbuf, & count, & mpitype (T), recvbuf, & count, & mpitype (T), & root, & comm. val, & 0 )
661661
662662function Allgather {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
663663 comm:: Comm )
664- recvbuf = Array (T, Comm_size (comm) * count)
664+ recvbuf = Array {T} ( Comm_size (comm) * count)
665665 ccall (MPI_ALLGATHER, Void,
666666 (Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
667667 sendbuf, & count, & mpitype (T), recvbuf, & count, & mpitype (T), & comm. val, & 0 )
@@ -683,7 +683,7 @@ function Gatherv{T}(sendbuf::MPIBuffertype{T}, counts::Vector{Cint},
683683 isroot = Comm_rank (comm) == root
684684 displs = cumsum (counts) - counts
685685 sendcnt = counts[Comm_rank (comm) + 1 ]
686- recvbuf = Array (T, isroot ? sum (counts) : 0 )
686+ recvbuf = Array {T} ( isroot ? sum (counts) : 0 )
687687 ccall (MPI_GATHERV, Void,
688688 (Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
689689 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},
694694 comm:: Comm )
695695 displs = cumsum (counts) - counts
696696 sendcnt = counts[Comm_rank (comm) + 1 ]
697- recvbuf = Array (T, sum (counts))
697+ recvbuf = Array {T} ( sum (counts))
698698 ccall (MPI_ALLGATHERV, Void,
699699 (Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
700700 sendbuf, & sendcnt, & mpitype (T), recvbuf, counts, displs, & mpitype (T), & comm. val, & 0 )
703703
704704function Alltoall {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
705705 comm:: Comm )
706- recvbuf = Array (T, Comm_size (comm)* count)
706+ recvbuf = Array {T} ( Comm_size (comm)* count)
707707 ccall (MPI_ALLTOALL, Void,
708708 (Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
709709 sendbuf, & count, & mpitype (T), recvbuf, & count, & mpitype (T), & comm. val, & 0 )
712712
713713function Alltoallv {T} (sendbuf:: MPIBuffertype{T} , scounts:: Vector{Cint} ,
714714 rcounts:: Vector{Cint} , comm:: Comm )
715- recvbuf = Array (T, sum (rcounts))
715+ recvbuf = Array {T} ( sum (rcounts))
716716 sdispls = cumsum (scounts) - scounts
717717 rdispls = cumsum (rcounts) - rcounts
718718 ccall (MPI_ALLTOALLV, Void,
723723
724724function Scan {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
725725 op:: Op , comm:: Comm )
726- recvbuf = Array (T, count)
726+ recvbuf = Array {T} ( count)
727727 ccall (MPI_SCAN, Void,
728728 (Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
729729 sendbuf, recvbuf, & count, & mpitype (T), & op. val, & comm. val, & 0 )
737737
738738function Exscan {T} (sendbuf:: MPIBuffertype{T} , count:: Integer ,
739739 op:: Op , comm:: Comm )
740- recvbuf = Array (T, count)
740+ recvbuf = Array {T} ( count)
741741 ccall (MPI_EXSCAN, Void,
742742 (Ptr{T}, Ptr{T}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}),
743743 sendbuf, recvbuf, & count, & mpitype (T), & op. val, & comm. val, & 0 )
0 commit comments