]> git.donarmstrong.com Git - libparallel-mpi-simple-perl.git/commitdiff
support MPI_ANY_TAG features/mpi_any_tag
authorDon Armstrong <don@donarmstrong.com>
Thu, 7 Jun 2012 23:17:55 +0000 (16:17 -0700)
committerDon Armstrong <don@donarmstrong.com>
Thu, 7 Jun 2012 23:17:55 +0000 (16:17 -0700)
Simple.pm
Simple.xs

index 45e3a9539f9a5b3694861110df8960264329f445..ea709cc1c4081390cc2a54ecb547c766347c5dc5 100644 (file)
--- a/Simple.pm
+++ b/Simple.pm
@@ -16,7 +16,7 @@ sub import {
     my $call = (caller())[0];
     no strict 'refs';
     # subs (MPI_ function calls)
-    foreach (qw(Init Finalize COMM_WORLD ANY_SOURCE Comm_rank Comm_size
+    foreach (qw(Init Finalize COMM_WORLD ANY_SOURCE ANY_TAG Comm_rank Comm_size
                Recv Send Barrier Bcast Gather
                Scatter Allgather Alltoall Reduce
                Comm_compare Comm_dup Comm_free Comm_split Comm_spawn
@@ -298,6 +298,8 @@ can be given.  If needed, use C<MPI_Barrier>.
 
 C<$source> can be C<MPI_ANY_SOURCE> which will do what it says.
 
+C<$msg_tag> can be C<MPI_ANY_TAG> which will match any tag.
+
 =cut
 
 sub Recv {
index 802eca85f6391107a9209589511b4f8b7c1a2ee1..8090de30eda9c257a08656aeff6f7a1848d281e7 100644 (file)
--- a/Simple.xs
+++ b/Simple.xs
@@ -146,6 +146,11 @@ SV* ANY_SOURCE () {
   return newSViv((IV)MPI_ANY_SOURCE);
 }
 
+/* returns SV whose IV slot is a cast pointer to the MPI_ANY_TAG value */
+SV* ANY_TAG () {
+  return newSViv((IV)MPI_ANY_TAG);
+}
+
 /* calls MPI_Barrier for comm */
 int Barrier (SV*comm) {
   MPI_Barrier((MPI_Comm)SvIVX(comm));
@@ -298,6 +303,9 @@ COMM_WORLD ()
 SV *
 ANY_SOURCE ()
 
+SV *
+ANY_TAG ()
+
 int
 Barrier (comm)
        SV *    comm