@@ -482,6 +482,21 @@ function Get_count(stat::Status, ::Type{T}) where T
482
482
Int (count[])
483
483
end
484
484
485
+ """
486
+ Send(buf::MPIBuffertype{T}, count::Integer, datatype::Cint, dest::Integer,
487
+ tag::Integer, comm::Comm) where T
488
+
489
+ Complete a blocking send of `count` elements of type `datatype` from `buf` to MPI
490
+ rank `dest` of communicator `comm` using the message tag `tag`
491
+ """
492
+ function Send (buf:: MPIBuffertype{T} , count:: Integer , datatype:: Cint , dest:: Integer ,
493
+ tag:: Integer , comm:: Comm ) where T
494
+ ccall (MPI_SEND, Nothing,
495
+ (Ptr{T}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint},
496
+ Ref{Cint}),
497
+ buf, count, datatype, dest, tag, comm. val, 0 )
498
+ end
499
+
485
500
"""
486
501
Send(buf::MPIBuffertype{T}, count::Integer, dest::Integer, tag::Integer,
487
502
comm::Comm) where T
@@ -491,10 +506,7 @@ of communicator `comm` using with the message tag `tag`
491
506
"""
492
507
function Send (buf:: MPIBuffertype{T} , count:: Integer , dest:: Integer ,
493
508
tag:: Integer , comm:: Comm ) where T
494
- ccall (MPI_SEND, Nothing,
495
- (Ptr{T}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint},
496
- Ref{Cint}),
497
- buf, count, mpitype (T), dest, tag, comm. val, 0 )
509
+ Send (buf, count, mpitype (T), dest, tag, comm)
498
510
end
499
511
500
512
"""
@@ -540,6 +552,25 @@ function send(obj, dest::Integer, tag::Integer, comm::Comm)
540
552
Send (buf, dest, tag, comm)
541
553
end
542
554
555
+ """
556
+ Isend(buf::MPIBuffertype{T}, count::Integer, datatype::Cint, dest::Integer,
557
+ tag::Integer, comm::Comm) where T
558
+
559
+ Starts a nonblocking send of `count` elements of type `datatype` from `buf` to
560
+ MPI rank `dest` of communicator `comm` using with the message tag `tag`
561
+
562
+ Returns the commication `Request` for the nonblocking send.
563
+ """
564
+ function Isend (buf:: MPIBuffertype{T} , count:: Integer , datatype:: Cint ,
565
+ dest:: Integer , tag:: Integer , comm:: Comm ) where T
566
+ rval = Ref {Cint} ()
567
+ ccall (MPI_ISEND, Nothing,
568
+ (Ptr{T}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint},
569
+ Ptr{Cint}, Ref{Cint}),
570
+ buf, count, datatype, dest, tag, comm. val, rval, 0 )
571
+ return Request (rval[], buf)
572
+ end
573
+
543
574
"""
544
575
Isend(buf::MPIBuffertype{T}, count::Integer, dest::Integer, tag::Integer,
545
576
comm::Comm) where T
@@ -551,12 +582,7 @@ Returns the commication `Request` for the nonblocking send.
551
582
"""
552
583
function Isend (buf:: MPIBuffertype{T} , count:: Integer ,
553
584
dest:: Integer , tag:: Integer , comm:: Comm ) where T
554
- rval = Ref {Cint} ()
555
- ccall (MPI_ISEND, Nothing,
556
- (Ptr{T}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint},
557
- Ptr{Cint}, Ref{Cint}),
558
- buf, count, mpitype (T), dest, tag, comm. val, rval, 0 )
559
- Request (rval[], buf)
585
+ Isend (buf, count, mpitype (T), dest, tag, comm)
560
586
end
561
587
562
588
"""
@@ -611,6 +637,25 @@ function isend(obj, dest::Integer, tag::Integer, comm::Comm)
611
637
Isend (buf, dest, tag, comm)
612
638
end
613
639
640
+ """
641
+ Recv!(buf::MPIBuffertype{T}, count::Integer, datatype::Cint, src::Integer,
642
+ tag::Integer, comm::Comm) where T
643
+
644
+ Completes a blocking receive of up to `count` elements of type `datatype` into `buf`
645
+ from MPI rank `src` of communicator `comm` using with the message tag `tag`
646
+
647
+ Returns the `Status` of the receive
648
+ """
649
+ function Recv! (buf:: MPIBuffertype{T} , count:: Integer , datatype:: Cint , src:: Integer ,
650
+ tag:: Integer , comm:: Comm ) where T
651
+ stat = Status ()
652
+ ccall (MPI_RECV, Nothing,
653
+ (Ptr{T}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint},
654
+ Ptr{Cint}, Ref{Cint}),
655
+ buf, count, datatype, src, tag, comm. val, stat. val, 0 )
656
+ return stat
657
+ end
658
+
614
659
"""
615
660
Recv!(buf::MPIBuffertype{T}, count::Integer, src::Integer, tag::Integer,
616
661
comm::Comm) where T
@@ -622,12 +667,7 @@ Returns the `Status` of the receive
622
667
"""
623
668
function Recv! (buf:: MPIBuffertype{T} , count:: Integer , src:: Integer ,
624
669
tag:: Integer , comm:: Comm ) where T
625
- stat = Status ()
626
- ccall (MPI_RECV, Nothing,
627
- (Ptr{T}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint},
628
- Ptr{Cint}, Ref{Cint}),
629
- buf, count, mpitype (T), src, tag, comm. val, stat. val, 0 )
630
- stat
670
+ Recv! (buf, count, mpitype (T), src, tag, comm)
631
671
end
632
672
633
673
@@ -672,24 +712,38 @@ function recv(src::Integer, tag::Integer, comm::Comm)
672
712
end
673
713
674
714
"""
675
- Irecv!(buf::MPIBuffertype{T}, count::Integer, src::Integer, tag::Integer,
715
+ Irecv!(buf::MPIBuffertype{T}, count::Integer, datatype::Cint, src::Integer, tag::Integer,
676
716
comm::Comm) where T
677
717
678
- Starts a nonblocking receive of up to `count` elements into `buf` from MPI rank
679
- `src` of communicator `comm` using with the message tag `tag`
718
+ Starts a nonblocking receive of up to `count` elements of type `datatype` into `buf`
719
+ from MPI rank `src` of communicator `comm` using with the message tag `tag`
680
720
681
721
Returns the communication `Request` for the nonblocking receive.
682
722
"""
683
- function Irecv! (buf:: MPIBuffertype{T} , count:: Integer ,
684
- src:: Integer , tag:: Integer , comm:: Comm ) where T
723
+ function Irecv! (buf:: MPIBuffertype{T} , count:: Integer , datatype :: Cint ,
724
+ src:: Integer , tag:: Integer , comm:: Comm ) where T
685
725
val = Ref {Cint} ()
686
726
ccall (MPI_IRECV, Nothing,
687
727
(Ptr{T}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint}, Ref{Cint},
688
728
Ptr{Cint}, Ref{Cint}),
689
- buf, count, mpitype (T) , src, tag, comm. val, val, 0 )
729
+ buf, count, datatype , src, tag, comm. val, val, 0 )
690
730
Request (val[], buf)
691
731
end
692
732
733
+ """
734
+ Irecv!(buf::MPIBuffertype{T}, count::Integer, src::Integer, tag::Integer,
735
+ comm::Comm) where T
736
+
737
+ Starts a nonblocking receive of up to `count` elements into `buf`
738
+ from MPI rank `src` of communicator `comm` using with the message tag `tag`
739
+
740
+ Returns the communication `Request` for the nonblocking receive.
741
+ """
742
+ function Irecv! (buf:: MPIBuffertype{T} , count:: Integer ,
743
+ src:: Integer , tag:: Integer , comm:: Comm ) where T
744
+ Irecv! (buf, count, mpitype (T), src, tag, comm)
745
+ end
746
+
693
747
"""
694
748
Irecv!(buf::Array{T}, src::Integer, tag::Integer, comm::Comm) where T
695
749
@@ -1707,6 +1761,41 @@ function Type_Create_Struct(nfields::Integer, blocklengths::MPIBuffertype{Cint},
1707
1761
return newtype_ref[]
1708
1762
end
1709
1763
1764
+ """
1765
+ Type_Create_Subarray(ndims::Integer, array_of_sizes::MPIBuffertype{Cint},
1766
+ array_of_subsizes::MPIBuffertype{Cint},
1767
+ array_of_starts::MPIBuffertype{Cint}, order::Integer, oldtype)
1768
+
1769
+ Creates a data type describing an `ndims`-dimensional subarray of size `array_of_subsizes`
1770
+ of an `ndims-dimensional` array of size `array_of_sizes` and element type `oldtype`,
1771
+ starting at the top-left location `array_of_starts`. The parameter `order` refers to
1772
+ the memory layout of the parent array, and can be either `MPI_ORDER_C` or
1773
+ `MPI_ORDER_FORTRAN`. Note that, like other MPI data types, the type returned by this
1774
+ function should be committed with `MPI_Type_commit`.
1775
+ """
1776
+ function Type_Create_Subarray (ndims:: Integer ,
1777
+ array_of_sizes:: MPIBuffertype{Cint} ,
1778
+ array_of_subsizes:: MPIBuffertype{Cint} ,
1779
+ array_of_starts:: MPIBuffertype{Cint} ,
1780
+ order:: Integer ,
1781
+ oldtype)
1782
+
1783
+ newtype_ref = Ref {Cint} ()
1784
+ flag = Ref {Cint} ()
1785
+
1786
+ ccall (MPI_TYPE_CREATE_SUBARRAY, Nothing,
1787
+ (Ref{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint},
1788
+ Ref{Cint}, Ref{Cint}, Ptr{Cint}, Ptr{Cint}),
1789
+ ndims, array_of_sizes, array_of_subsizes, array_of_starts,
1790
+ order, mpitype (oldtype), newtype_ref, flag)
1791
+
1792
+ if flag[] != 0
1793
+ throw (ErrorException (" MPI_Type_create_subarray returned non-zero exit status" ))
1794
+ end
1795
+
1796
+ return newtype_ref[]
1797
+ end
1798
+
1710
1799
function Type_Contiguous (count:: Integer , oldtype)
1711
1800
newtype_ref = Ref {Cint} ()
1712
1801
flag = Ref {Cint} ()
0 commit comments