Path: news.cs.hut.fi!news.funet.fi!news.eunet.fi!EU.net!howland.erols.net!feed1.news.erols.com!uunet!in1.uu.net!crusty.teleport.com!nntp0.teleport.com!usenet From: edward@nsrc.nus.sg (Edward Walker) Newsgroups: comp.lang.perl.announce,comp.lang.perl.misc Subject: Perl-PVM version 1.1 Followup-To: comp.lang.perl.misc Date: 15 Oct 1996 17:43:38 GMT Organization: National University of Singapore Lines: 526 Approved: merlyn@stonehenge.com (comp.lang.perl.announce) Message-ID: <540iga$e2l@nadine.teleport.com> NNTP-Posting-Host: gadget.cscaper.com X-Disclaimer: The "Approved" header verifies header information for article transmission and does not imply approval of content. Xref: news.cs.hut.fi comp.lang.perl.announce:451 comp.lang.perl.misc:49687 Hi, Version 1.1 of Perl-PVM is now available. This is a perl extension for PVM using dynamic loading. PVM allows you to write parallel applications over a heterogenous network of computers. The differences with 1.0 are as follows: 1, Parallel::Pvm::spawn now accepts argv argument 2, Parallel::Pvm::notify accepts "cnt" argument for PvmHostAdd 3, Parallel::Pvm::recv_notify correctly receives list of host tids for PvmHostAdd notification 4, Some internal buffering optimization. (1--3 was contributed by Rob Torop. Many thanks to him!) You may obtain a copy from my web page http://www.nsrc.nus.sg/STAFF/edward/Pvm.html If you have problems obtaining a copy, get in touch with me. I've included a patch file below if you wish to apply the patch yourself. Enjoy! And may the force be with you. - ed --------------------------------------------------------- Dr Edward Walker National Supercomputing Research Centre 81, Science Park Drive #04-03, The Chadwick Singapore 0511 Email: edward@nsrc.nus.sg Web: http://www.nsrc.nus.sg/STAFF/edward ----------------Cut here: 1.0_2_1.1_patch---------------------- *** Pvm.xs --- Pvm.xs *************** *** 17,28 **** #define MAXPROCS 100 #define MAXHOSTS 100 ! #define MAXSTR 200000 #define STRING 1 #define INTEGER 2 #define DOUBLE 3 static SV *recvf_callback = (SV *)NULL; static int (*olmatch)(); --- 17,29 ---- #define MAXPROCS 100 #define MAXHOSTS 100 ! #define MAXSTR 100000 #define STRING 1 #define INTEGER 2 #define DOUBLE 3 + static char g_buffer[MAXSTR]; static SV *recvf_callback = (SV *)NULL; static int (*olmatch)(); *************** *** 79,85 **** { int cnt=0; ! cnt = strlen(str); /* add 1 for the byte holding the '\0' */ return cnt+1; } --- 80,88 ---- { int cnt=0; ! while( str[cnt] != '\0' ){ ! cnt++; ! } /* add 1 for the byte holding the '\0' */ return cnt+1; } *************** *** 100,105 **** --- 103,115 ---- return STRING; } } + /* else{ + if ( could_be_double ){ + if ( str[i] != '0' ){ + must_be_double = 1; + } + } + } */ i++; } if ( could_be_double ) return DOUBLE; *************** *** 109,131 **** static char * buffer_string( char *str, int new_flag ) { ! static int bufsize; ! static char *buf ; if ( new_flag ){ ! bufsize = 1; ! free(buf); ! buf = (char *)malloc((strlen(str)+1)*sizeof(char)); ! buf[0] = '\0'; ! bufsize = (strlen(str)+1)*sizeof(char); ! sprintf(buf,"%s", str ); }else{ - bufsize += (strlen(str)+1)*sizeof(char); - buf = (char *)realloc(buf,bufsize); /* use vertical tab as token separator */ ! sprintf(buf,"%s\v%s",buf, str ); } ! return buf ; } /*****/ --- 119,140 ---- static char * buffer_string( char *str, int new_flag ) { ! static int cnt; ! int i; if ( new_flag ){ ! cnt=0; ! for (i=0;str[i] && cnt may be given additional argument parameters to control how/where you want a task to be spawned. For example, you can specifically spawn B in the internet ! host by calling Parallel::Pvm::spawn("client",1,PvmTaskHost,"onyx.nsrc.nus.sg"); --- 348,354 ---- For more sophisticated users, B may be given additional argument parameters to control how/where you want a task to be spawned. For example, you can specifically spawn B in the internet ! host B by calling Parallel::Pvm::spawn("client",1,PvmTaskHost,"onyx.nsrc.nus.sg"); *************** *** 357,362 **** --- 357,367 ---- Parallel::Pvm::spawn("client",4,PvmTaskArch,"RS6K"); + Also, if the spawned remote executable requires an argument B, + you can supply this by calling + + Parallel::Pvm::spawn("client",4,PvmTaskArch,"RS6K",argv); + Note that tasks which have been spawned by using B do not need to be explicitly enrolled into the pvm system. *************** *** 662,667 **** --- 667,678 ---- $info = Parallel::Pvm::notify(PvmHostDelete,999,$host_list); + # turns on notification for new host + $info = Parallel::Pvm::notify(PvmHostAdd); + + # turns off notification for new host + $info = Parallel::Pvm::notify(PvmHostAdd,0); + =item B Nonblocking receive. Eg. *************** *** 753,762 **** Receives the notification message initiated by B. This should be preceded by a B. Eg. if ( Parallel::Pvm::probe(-1,$notify_tag) ){ ! $message = Parallel::Pvm::recv_notify ; } =item B Resets the comparison function for accepting messages to the --- 764,777 ---- Receives the notification message initiated by B. This should be preceded by a B. Eg. + # for PvmTaskExit and PvmHostDelete notification if ( Parallel::Pvm::probe(-1,$notify_tag) ){ ! $message = Parallel::Pvm::recv_notify(PvmTaskExit) ; } + # for PvmHostAdd notification + @htid_list = Parallel::Pvm::recv_notify(PvmHostAdd); + =item B Resets the comparison function for accepting messages to the *************** *** 829,834 **** --- 844,851 ---- ($ntask,@tid_list) = Parallel::Pvm::spawn("compute.pl",4); ($ntask,@tid_list) = Parallel::Pvm::spawn("compute.pl",4,PvmTaskHost,"onyx"); + + ($ntask,@tid_list) = Parallel::Pvm::spawn("compute.pl",4,PvmTaskHost,"onyx",argv); =item B