Dynamic process groups in parallel virtual machine , Computer Networking

Assignment Help:

Dynamic Process Groups

To generate and manage dynamic groups, a separate library libgpvm3.a must be connected with the user programs that make use of any of the set functions. Group management work is handled by a group server that is automatically in progress when the first group function is invoked. Any PVM task can connect or leave any group dynamically at any time without having to inform any other task in the affected groups. Tasks can shows messages to groups of which they are not members. Now we are giving some routines that manage dynamic processes:

  • int pvm_joingroup( char *group )

Enrolls the calling process in a named group. group is a group name of an presenting group. Returns instance number. Instance numbers run from 0 to the number of group members minus 1. In PVM 3, a task can connect multiple groups. If a process departs a group and then rejoins it, that process may receive a dissimilar instance number.

  • int info = pvm_lvgroup( char *group )

   Unenrolls the calling process from a named group.

  • int pvm_gettid( char *group, int inum )

Returns the tid of the process recognized by a group name and instance number.

  • int pvm_getinst( char *group, int tid )

Returns the instance number in a set of a PVM process.

  • int size = pvm_gsize( char *group )

Returns the number of members at present in the named group.

  • int pvm_barrier( char *group, int count )

Blocks the calling process up to all the processes in a group has called it. count shows the number of group members that must call pvm_barrier before they are all released.

  • int pvm_bcast( char *group, int msgtag )

Transmits the data in the active message buffer to a group of processes. msgtag is a message tag supplied by the user. It agree to the user's program to distinguish between dissimilar kinds of messages .It should be a nonnegative integer.

  • int info = pvm_reduce( void (*func)(), void *data, int count, int datatype, int msgtag, char *group, int rootginst)

 Performs a decrease operation over members of the particular group. func is function defining the operation performed on the global data. Predefined are, PvmMin, PvmMax ,PvmSum and PvmProduct. Users can describe their own function. data is pointer to the starting address of an array of local values. count shows the number of elements of datatype in the data array. Datatype is the kind of the entries in the data array. msgtag is the message tag supplied by the user. msgtag should be greater than 0. It allows the user's program to distinguish between different kinds of messages. group is the group name of an existing group. rootginst is the illustration number of group member who gets the result.

We are writing here programs that shows the use of these functions in the parallel programming:

Example 2: Hello.c

#include "pvm3.h" main()

{

int cc, tid, msgtag;

char buf[100];

printf("%x\n", pvm_mytid());

cc = pvm_spawn("hello_other", (char**)0, 0, "", 1, &tid);

if (cc == 1) {

msgtag = 1;

pvm_recv(tid, msgtag);

pvm_upkstr(buf);

printf("from t%x: %s\n", tid, buf);

} else

printf("can't start hello_other\n");

pvm_exit();

}

In this program, pvm_mytid( ), returns the TID of the running program (In this case, task id of the program hello.c). This program is intended to be invoked by hand; after printing its task id (obtained with pvm_mytid()), it starts a copy of another program called hello_other using the pvm_spawn() function. A successful spawn happens the program to implement a blocking receive using pvm_recv. After getting the message, the program prints the message sent by its counterpart, as well its task id; the buffer is take out from the message using pvm_upkstr. The final pvm_exit call dissociates the program from the PVM system.

hello_other.c

#include "pvm3.h"

main()

{

int ptid, msgtag;

char buf[100];

ptid = pvm_parent();

strcpy(buf, "hello, world from ");

gethostname(buf + strlen(buf), 64);

msgtag = 1; pvm_initsend(PvmDataDefault); pvm_pkstr(buf);

pvm_send(ptid, msgtag);

pvm_exit();

}

Program is a listing of the ''slave'' or spawned program; its first PVM action is to get the task id of the ''master'' using the pvm_parent call. This program then gets its hostname and transfers it to the master using the three-call sequence - pvm_initsend to initialize the send buffer; pvm_pkstr to place a string, architecture-independent manner and in a strongly typed, into the send buffer; and pvm_send to trasnfer it to the destination process shows by ptid, ''tagging'' the message with the number1.


Related Discussions:- Dynamic process groups in parallel virtual machine

Name some common or popular databases, Name some common or popular database...

Name some common or popular databases Many of the popular databases also provide support of and to the middleware and consequently, the term middleware has become lesser known.

What is ipv6 addressing, QUESTION (a) What are the problems with IPv4 o...

QUESTION (a) What are the problems with IPv4 on today's Internet and how does IPv6 solve these problems? (b) Describe at least three ways in which IPv6 is more efficient tha

What is sonet sts, SONET STS SONET defines a hierarchy of signalling le...

SONET STS SONET defines a hierarchy of signalling levels called as STSs (Synchronous Transport Signals). Every STS level supports a certain data rate specified in megabits p

Facts about fiber optic cables - Computer Network, Facts about  Fiber Opti...

Facts about  Fiber Optic Cables 1. Outer insulating jacket is made  of Teflon or PVC. 2. Kevler fiber  helps  to strengthen  the cable and prevent breakage. 3. A plas

Tcp segment structure - transport layer, TCP Segment Structure Figure ...

TCP Segment Structure Figure shows the format of the TCP segment. The  header consists  of a 20 bytes  fixed  part  plus a variable size  options fields. The description  o

Explain the bit-level encryption, Q. Explain the Bit-Level Encryption? ...

Q. Explain the Bit-Level Encryption? Bit-Level Encryption - Data is divided into blocks of bits then altered by encoding/decoding, permutation, substitution, exclusive OR

Subscriber database - computer network, Subscriber Database Core ne...

Subscriber Database Core network  also hosts  the subscribers  database ( for e, g HLR in GSM systems). Subscriber  database  is accessed by core  network  nodes fro  funct

Software overheads in parallel programming , Besides these hardware overhea...

Besides these hardware overheads, there are certain software overheads imposed by libraries, parallel compilers, tools and operating systems. The parallel programming languages

Sonet frame format - sonet sdh, SONET Frame Format SONET  uses  a basic...

SONET Frame Format SONET  uses  a basic  transmission  rate of STS -1 that  is equivalent to 51.84 mbps. Higher level  signals  are integer multiples of the base rate. For  exa

Describe a basic communication model, NETWORK MANAGEMENT & SECURITY 1. ...

NETWORK MANAGEMENT & SECURITY 1. Describe a basic communication model. 2. State the following terms: a. Configuration Management b. Fault Management c. Security Management

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd