Sample perl bindings for bproc

Daniel Ridge newt at scyld.com
Fri Feb 9 16:02:36 PST 2001


Fellow Beowulfers,

A number of people who talked to me about Scyld Beowulf cluster
webserving and saw my web server demos at LinuxWorld last week and have
since been after me to get a copy of my sleazy perl->bproc bindings for
use with our Beowulf distribution.

Sample bindings are available from Scyld via
ftp://ftp.scyld.com/pub/bproc-perl

Inlined is a trivial example:
-------------------------------------------------
#!/usr/bin/perl

use Parallel::Bproc;

$numnodes = Parallel::Bproc::bproc_numnodes();

while(1)
{
  $node=int(rand($numnodes+1));

  if(Parallel::Bproc::bproc_nodestatus($node) == 3)
  {
    printf("Moving to node %d\n",$node);

    Parallel::Bproc::bproc_move($node);

    printf("Current node is %d\n",Parallel::Bproc::bproc_currnode());

    sleep(5);
  }
}

Regards (and good luck!),
	Dan Ridge
	Scyld Computing Corporation





More information about the Beowulf mailing list