diff options
author | dmcmahill <dmcmahill@pkgsrc.org> | 2002-10-13 04:30:05 +0000 |
---|---|---|
committer | dmcmahill <dmcmahill@pkgsrc.org> | 2002-10-13 04:30:05 +0000 |
commit | 016b72a6681c32bddd614267eef26c49271decf6 (patch) | |
tree | 628721b64d89dfe138c93a2fb6300819f3dc6780 /parallel/p5-Parallel-Pvm/files | |
parent | 07613eebf7f9be152cb1616d7a60afdc12caaaeb (diff) | |
download | pkgsrc-016b72a6681c32bddd614267eef26c49271decf6.tar.gz |
initial import of p5-Parallel-Pvm-1.3.0
Parallel::Pvm is a perl extension for the parallel virtual machine
(PVM) message-passing system.
Diffstat (limited to 'parallel/p5-Parallel-Pvm/files')
-rwxr-xr-x | parallel/p5-Parallel-Pvm/files/hello.pl | 38 | ||||
-rwxr-xr-x | parallel/p5-Parallel-Pvm/files/hello_other.pl | 16 |
2 files changed, 54 insertions, 0 deletions
diff --git a/parallel/p5-Parallel-Pvm/files/hello.pl b/parallel/p5-Parallel-Pvm/files/hello.pl new file mode 100755 index 00000000000..cfad6447a4c --- /dev/null +++ b/parallel/p5-Parallel-Pvm/files/hello.pl @@ -0,0 +1,38 @@ +#!@perl@ +# +# $NetBSD: hello.pl,v 1.1.1.1 2002/10/13 04:30:05 dmcmahill Exp $ +# + +use Parallel::Pvm; +use File::Basename; + +$mytid = Parallel::Pvm::mytid ; +printf "My task ID is %x\n", $mytid; + +# spawn 1 copy of "hello_other" +$cmd="@exampledir@/hello_other.pl"; + +($ntask, @tids) = Parallel::Pvm::spawn($cmd, 1); +print "ntask = $ntask\n"; +print "tids = @tids\n"; + +if ($ntask == 1) { + # receive a message from the task we have spawned + $bufid=Parallel::Pvm::recv(); + + if ($bufid >= 0) { + ($info,$bytes,$tag,$stid) = Parallel::Pvm::bufinfo($bufid) ; + print "info = $info\n"; + print "bytes = $bytes\n"; + print "tag = $tag\n"; + printf "stid = %x\n",$stid; + $str = Parallel::Pvm::unpack; + printf "from t%x: \"%s\"\n",$stid,$str; + } +} else { + printf "can't start hello_other\n"; +} + +Parallel::Pvm::exit(); + + diff --git a/parallel/p5-Parallel-Pvm/files/hello_other.pl b/parallel/p5-Parallel-Pvm/files/hello_other.pl new file mode 100755 index 00000000000..5fbc13f3359 --- /dev/null +++ b/parallel/p5-Parallel-Pvm/files/hello_other.pl @@ -0,0 +1,16 @@ +#!@perl@ +# +# $NetBSD: hello_other.pl,v 1.1.1.1 2002/10/13 04:30:05 dmcmahill Exp $ +# + +use Parallel::Pvm; +use Sys::Hostname; +my $host = hostname(); + +$ptid = Parallel::Pvm::parent; +Parallel::Pvm::initsend(PvmDataDefault) ; +$buf=Parallel::Pvm::pack("Hi from hello_other.pl running on $host"); +Parallel::Pvm::send($ptid,$buf); +Parallel::Pvm::exit; +exit 0; + |