From 5b401d10f065600a48aeb0fa0cb760adba878592 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 7 Jun 2012 16:17:55 -0700 Subject: [PATCH] support MPI_ANY_TAG --- Simple.pm | 4 +++- Simple.xs | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Simple.pm b/Simple.pm index 45e3a95..ea709cc 100644 --- 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. C<$source> can be C which will do what it says. +C<$msg_tag> can be C which will match any tag. + =cut sub Recv { diff --git a/Simple.xs b/Simple.xs index 802eca8..8090de3 100644 --- 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 -- 2.39.5